none
Hi, I am working in outlook Addins. I just want to call the folder switch event in another function RRS feed

  • Question

  • this is a function it work for the event 'while i switch the folder',  but now i need to call it in another function how can i call this function

        formsManager_ADXFolderSwitchEx(object sender, AddinExpress.OL.FolderSwitchExEventArgs args)

    Tuesday, February 4, 2014 6:37 AM

Answers

  • Create a separate function and move the code to that function. Add some parameters if required. Then call this function from formsManager_ADXFolderSwitchEx and from other places.

    • Marked as answer by Marvin_Guo Wednesday, February 12, 2014 11:49 AM
    Tuesday, February 4, 2014 9:08 AM

All replies

  • Create a separate function and move the code to that function. Add some parameters if required. Then call this function from formsManager_ADXFolderSwitchEx and from other places.

    • Marked as answer by Marvin_Guo Wednesday, February 12, 2014 11:49 AM
    Tuesday, February 4, 2014 9:08 AM
  • Hello talent_guy,

    It looks like you need to refactor the code extracting the method which will handle the event. Then you can call the extracted method from the ADXFolderSwitchEx event handler and your function.

    For example, you can find a sample code described on the Martin Fowler's web site and Extract Method Refactoring (C#) page in MSDN.

    Finally, I'd recommend contacting the support service department for explanations related to commercial components.

    • Proposed as answer by Eugene Astafiev Wednesday, February 12, 2014 2:11 PM
    Thursday, February 6, 2014 8:12 AM