none
EWS Managed API Should I use GUID or DefaultExtendedPropertySet.PublicStrings while constructing DefaultExtendedPropertySet RRS feed

  • Question

  • I am developing C# .NET Framework 4.5 Windows Form application using EWS Managed API 1.2 with Exchange Server 2007 which performs some sort of syncing of mails.

    Now that I am dealing with Extended Properties, I want to be clear some things:

    Q1. What is the purpose of DefaultExtendedPropertySet class? MSDN says "Defines the default sets of extended properties."

    • Is it just to group the extended properties?
    • If yes, why is the grouping there at first place?
    • Do we have any Ews API method which can fetch values of all extended properties belonging to the same group on an item?

    Q2. I am unable to decide whether should I use custom GUID or DefaultExtendedPropertySet.PublicStrings while constructing ExtendedPropertyDefinition:

    ExtendedPropertyDefinition MyXProp = new ExtendedPropertyDefinition(
                         DefaultExtendedPropertySet.PublicStrings, 
                        "MyXProp", MapiPropertyType.String);

    OR

    Guid MyPropertySetId = new Guid("{C11FF724-AA03-4555-9952-FA248A11C3E}");            
    ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(
                         MyPropertySetId, "MyXProp", MapiPropertyType.String);
    • What are the factors that should dictate the above decision?
    • Also what difference it makes by above two approaches?

    • Edited by Mahesha999 Thursday, August 7, 2014 4:33 PM
    Thursday, August 7, 2014 4:32 PM

Answers

  • 1.  Have a read of http://blogs.technet.com/b/exchange/archive/2009/04/06/3407221.aspx which explains the history and why's and what's of named properties.

    >>Do we have any Ews API method which can fetch values of all extended properties belonging to the same group on an item?

    No EWS will only return the properties you ask it to return there is no way to enumerate all the extended properties on an Item.

    2. There is no right or wrong answer to this using PS_PUBLIC_STRINGS with a generic propertyname is generally a bad idea because another product could decide to use the same propertyname and you have a clash. So using your own guid can have it's advantages. Personally I find working with PS_PUBLIC_STRINGS make things more discoverable and easier to use if you need to integrate further with MAPI or Transport Agents.

    Cheers
    Glen

    Friday, August 8, 2014 4:34 AM