sourceFolder Parameter

Add-in Express™ Support Service
That's what is more important than anything else

sourceFolder Parameter
What is the purpose of this parameter 
German Hayles




Posts: 41
Joined: 2015-04-27
I noticed that this parameter ("sourceFolder") is added to the ItemsEvents handlers ItemAdd, ItemChange, ItemRemove.

I was wondering what purpose it served, and what information is in it.
Posted 11 Jan, 2017 18:24:40 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello German,

Consider passing true to the recursive parameter of the ADXOutlookItemsEvents.ConnectTo() method. In this case, the class connects to the events of all the folders in the folder hierarchy and you need to know the actual folder generating the event.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jan, 2017 08:18:56 Top
German Hayles




Posts: 41
Joined: 2015-04-27
Ah. Your team has put together a very interesting framework. After doing some inspecting I see that what you mean by folder you mean the default folders like "Calendar", "Inbox", etc.

In my current project we only process events coming from the Calendar. "sourceFolder" will simplify the logic.

Very nice design.
Posted 12 Jan, 2017 09:47:33 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
German Hayles writes:
After doing some inspecting I see that what you mean by folder you mean the default folders like "Calendar", "Inbox", etc.


Nope. I meant "a folder with subfolders". That is, you can connect to the events of the Items collection of a folder and all its subfolders if you set the "recursive" parameter of the ConnectTo() method to true. The sourceFolder parameter of the corresponding event handlers let you identify the folder producing the event in this case.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jan, 2017 10:43:42 Top
German Hayles




Posts: 41
Joined: 2015-04-27
Thanks for the clarification!!! I went in the wrong direction there. :D
Posted 12 Jan, 2017 11:46:42 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2017 02:54:23 Top