none
[E2007][E2010] [EWS] [C#]: How to get what properties changed on a modified notification RRS feed

  • Question

  • Greetings all,

     

    I've recently discovered that an application I've been helping to write for almost a decade now will no longer receive notifications from Exchange via MAPI if the exchange server is Exchange 2010. As such I had EWS dumped into my lap and I am in the process of adapting the application so that it will work with Ex2010 but will still work with 2003 and above. EWS is quite an interesting technology and one I am looking forward to getting into. After years of slogging through MAPI in C++ and CDO in C# it is a welcome gift. After much googling and pouring through SDK documentation, blogs and various Exchange books however, I seem to be missing something that i need.

    Our app monitors a user's mailbox and responds to events. During those responses, we tag each item we touch with a few properties. Unfortunately this causes yet more notifications which we specifically don't want to know about. Other specific properties we monitor for changes so that we can respond to them. For creation and move/copy, this is not a big deal but I need to get more detail during a modification event so we can make sure that it wasn't our own meddling that caused the notification in the first place.

    So to make a long story short, when I get a modified item or folder notification from EWS I get the ItemTypeId and use that to get the Item and it's Parent folder but I'm not seeing a list of modified properties anywhere. This use to be part of the notification i would get from MAPI every time something happened in Exchange for the users we were monitoring. I do see an interface implementation (INotifyPropertyChanged) on the Item object but since these objects are going to be short lived for me I'm not hooking an event handler up to that and as such it's always null. But even if I were, the notification has already happened so it wouldn't be telling me what has already changed but what had changed going forward. I could probably use the Item class's ExtendedProperties to at least get the properties we care about, though from reading the documentation this just tells me what the values are currently not what they were, who changed them or even that they were changed. I also see a change key property but the docs say that's just for versioning of the item but doesn't tell you anything specific.

    So, is there a way to get this information? Who made the change (if it is for example, the logged in user that the app is running as) and what changes they made? Even just the mapi property IDs of the changes would be fine. Or am I just spinning my wheels here?

    Help is appreciated in advance

    Cosmo

    Tuesday, September 27, 2011 8:50 PM

All replies

  • Hi,

    EWS notifications do not provide such level of detail. You'll just get the ids of the modified items. The INotifyPropertyChanged interface is just for databinding on the client, it has nothing to do with Exchange.

    Each item exposes the LastModifiedName property which states the name of the last user who edited the item.

    Kind regards,
    Henning Krause

    Tuesday, September 27, 2011 9:37 PM
  • hrm... that brings to mind two more questions then.

     

    1. Do you get notified once for each property modified or once for each commit of an iteam

    2. Does the LastModifiedName property represent the user you are impersonating? or the web credentials you are using?

     

    Thanks a lot for your help..

    CK

    Thursday, September 29, 2011 2:25 PM
  • Hi Cosmo,

    1. you get one notification per commit.

    2. I'm not really sure. Perhaps someone else has an answer to this question.

    Kind regards,
    Henning

    Thursday, September 29, 2011 3:38 PM