/// <summary>
 /// Implements the OnChange event handler for the item associated with the attachment.
 /// </summary>
 /// <param name="serviceObject">The service object that triggered the OnChange event.</param>
 private void ItemChanged(ServiceObject serviceObject)
 {
     if (this.Owner != null)
     {
         this.Owner.PropertyBag.Changed();
     }
 }
        /// <summary>
        /// Writes the update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ownerObject">The ews object.</param>
        /// <param name="propertyDefinition">Property definition.</param>
        /// <returns>True if property generated serialization.</returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToXml(
            EwsServiceXmlWriter writer,
            ServiceObject ownerObject,
            PropertyDefinition propertyDefinition)
        {
            if (this.collectionIsCleared)
            {
                if (this.AddedItems.Count == 0)
                {
                    // Delete the whole members collection
                    this.WriteDeleteMembersCollectionToXml(writer);
                }
                else
                {
                    // The collection is cleared, so Set
                    this.WriteSetOrAppendMembersToXml(writer, this.AddedItems, true);
                }
            }
            else
            {
                // The collection is not cleared, i.e. dl.Members.Clear() is not called.
                // Append AddedItems.
                this.WriteSetOrAppendMembersToXml(writer, this.AddedItems, false);

                // Since member replacement is not supported by server
                // Delete old ModifiedItems, then recreate new instead.
                this.WriteDeleteMembersToXml(writer, this.ModifiedItems);
                this.WriteSetOrAppendMembersToXml(writer, this.ModifiedItems, false);

                // Delete RemovedItems.
                this.WriteDeleteMembersToXml(writer, this.RemovedItems);
            }

            return(true);
        }
        /// <summary>
        /// Writes the update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">Property definition.</param>
        /// <returns>
        /// True if property generated serialization.
        /// </returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToXml(
            EwsServiceXmlWriter writer,
            ServiceObject ewsObject,
            PropertyDefinition propertyDefinition)
        {
            List <ExtendedProperty> propertiesToSet = new List <ExtendedProperty>();

            propertiesToSet.AddRange(this.AddedItems);
            propertiesToSet.AddRange(this.ModifiedItems);

            foreach (ExtendedProperty extendedProperty in propertiesToSet)
            {
                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetSetFieldXmlElementName());
                extendedProperty.PropertyDefinition.WriteToXml(writer);

                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetXmlElementName());
                extendedProperty.WriteToXml(writer, XmlElementNames.ExtendedProperty);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }

            foreach (ExtendedProperty extendedProperty in this.RemovedItems)
            {
                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetDeleteFieldXmlElementName());
                extendedProperty.PropertyDefinition.WriteToXml(writer);
                writer.WriteEndElement();
            }

            return(true);
        }
 /// <summary>
 /// Writes the set update to XML.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="ownerDictionaryXmlElementName">Name of the owner dictionary XML element.</param>
 /// <returns>True if update XML was written.</returns>
 internal virtual bool WriteSetUpdateToXml(
     EwsServiceXmlWriter writer,
     ServiceObject ewsObject,
     string ownerDictionaryXmlElementName)
 {
     return(false);
 }
        /// <summary>
        /// Writes the set update to json.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">The property definition.</param>
        /// <param name="updates">The updates.</param>
        /// <returns></returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToJson(
            ExchangeService service,
            ServiceObject ewsObject,
            PropertyDefinition propertyDefinition,
            List <JsonObject> updates)
        {
            List <ExtendedProperty> propertiesToSet = new List <ExtendedProperty>();

            propertiesToSet.AddRange(this.AddedItems);
            propertiesToSet.AddRange(this.ModifiedItems);

            foreach (ExtendedProperty extendedProperty in propertiesToSet)
            {
                updates.Add(
                    PropertyBag.CreateJsonSetUpdate(
                        extendedProperty,
                        service,
                        ewsObject));
            }

            foreach (ExtendedProperty extendedProperty in this.RemovedItems)
            {
                updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject));
            }

            return(true);
        }
 /// <summary>
 /// Writes the set update to json.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="propertyDefinition">The property definition.</param>
 /// <param name="updates">The updates.</param>
 /// <returns></returns>
 internal virtual bool WriteSetUpdateToJson(
     ExchangeService service,
     ServiceObject ewsObject,
     PropertyDefinition propertyDefinition,
     List <JsonObject> updates)
 {
     return(false);
 }
        /// <summary>
        /// Initializes a new instance of PropertyBag.
        /// </summary>
        /// <param name="owner">The owner of the bag.</param>
        internal PropertyBag(ServiceObject owner)
        {
            EwsUtilities.Assert(
                owner != null,
                "PropertyBag.ctor",
                "owner is null");

            this.owner = owner;
        }
 /// <summary>
 /// Writes the set update to json.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="propertyDefinition">The property definition.</param>
 /// <param name="updates">The updates.</param>
 /// <returns></returns>
 bool ICustomUpdateSerializer.WriteSetUpdateToJson(
     ExchangeService service,
     ServiceObject ewsObject,
     PropertyDefinition propertyDefinition,
     List <JsonObject> updates)
 {
     // TODO: Implement
     throw new NotImplementedException();
 }
        /// <summary>
        /// Creates the property instance.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <returns>ComplexProperty.</returns>
        internal override ComplexProperty CreatePropertyInstance(ServiceObject owner)
        {
            Folder folder = owner as Folder;

            EwsUtilities.Assert(
                folder != null,
                "PermissionCollectionPropertyDefinition.CreatePropertyInstance",
                "The owner parameter is not of type Folder or a derived class.");

            return(new FolderPermissionCollection(folder));
        }
Exemple #10
0
        /// <summary>
        /// Writes the delete update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <returns>True if update XML was written.</returns>
        internal override bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject)
        {
            foreach (string xmlElementName in PhysicalAddressSchema.XmlElementNames)
            {
                this.InternalWriteDeleteFieldToXml(
                    writer,
                    ewsObject,
                    xmlElementName);
            }

            return(true);
        }
Exemple #11
0
        /// <summary>
        /// Writes field deletion to json.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="updates">The updates.</param>
        /// <returns></returns>
        internal override bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List <JsonObject> updates)
        {
            foreach (string propertyName in PhysicalAddressSchema.XmlElementNames)
            {
                this.InternalWriteDeleteUpdateToJson(
                    ewsObject,
                    propertyName,
                    updates);
            }

            return(true);
        }
Exemple #12
0
 /// <summary>
 /// Write field deletion to XML.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="fieldXmlElementName">Name of the field XML element.</param>
 private void InternalWriteDeleteFieldToXml(
     EwsServiceXmlWriter writer,
     ServiceObject ewsObject,
     string fieldXmlElementName)
 {
     writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetDeleteFieldXmlElementName());
     writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.IndexedFieldURI);
     writer.WriteAttributeValue(XmlAttributeNames.FieldURI, GetFieldUri(fieldXmlElementName));
     writer.WriteAttributeValue(XmlAttributeNames.FieldIndex, this.Key.ToString());
     writer.WriteEndElement(); // IndexedFieldURI
     writer.WriteEndElement(); // ewsObject.GetDeleteFieldXmlElementName()
 }
        /// <summary>
        /// Creates the property instance.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <returns>ComplexProperty instance.</returns>
        internal override ComplexProperty CreatePropertyInstance(ServiceObject owner)
        {
            TComplexProperty complexProperty = this.propertyCreationDelegate();
            IOwnedProperty   ownedProperty   = complexProperty as IOwnedProperty;

            if (ownedProperty != null)
            {
                ownedProperty.Owner = owner;
            }

            return(complexProperty);
        }
Exemple #14
0
        /// <summary>
        /// Writes the update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="ownerDictionaryXmlElementName">Name of the owner dictionary XML element.</param>
        /// <returns>True if update XML was written.</returns>
        internal override bool WriteSetUpdateToXml(
            EwsServiceXmlWriter writer,
            ServiceObject ewsObject,
            string ownerDictionaryXmlElementName)
        {
            List <string> fieldsToSet = new List <string>();

            foreach (string xmlElementName in this.propertyBag.AddedItems)
            {
                fieldsToSet.Add(xmlElementName);
            }

            foreach (string xmlElementName in this.propertyBag.ModifiedItems)
            {
                fieldsToSet.Add(xmlElementName);
            }

            foreach (string xmlElementName in fieldsToSet)
            {
                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetSetFieldXmlElementName());

                writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.IndexedFieldURI);
                writer.WriteAttributeValue(XmlAttributeNames.FieldURI, GetFieldUri(xmlElementName));
                writer.WriteAttributeValue(XmlAttributeNames.FieldIndex, this.Key.ToString());
                writer.WriteEndElement(); // IndexedFieldURI

                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetXmlElementName());
                writer.WriteStartElement(XmlNamespace.Types, ownerDictionaryXmlElementName);
                writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Entry);
                this.WriteAttributesToXml(writer);
                writer.WriteElementValue(
                    XmlNamespace.Types,
                    xmlElementName,
                    this.propertyBag[xmlElementName]);
                writer.WriteEndElement(); // Entry
                writer.WriteEndElement(); // ownerDictionaryXmlElementName
                writer.WriteEndElement(); // ewsObject.GetXmlElementName()

                writer.WriteEndElement(); // ewsObject.GetSetFieldXmlElementName()
            }

            foreach (string xmlElementName in this.propertyBag.RemovedItems)
            {
                this.InternalWriteDeleteFieldToXml(
                    writer,
                    ewsObject,
                    xmlElementName);
            }

            return(true);
        }
Exemple #15
0
        /// <summary>
        /// Writes updates to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">Property definition.</param>
        /// <returns>
        /// True if property generated serialization.
        /// </returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToXml(
            EwsServiceXmlWriter writer,
            ServiceObject ewsObject,
            PropertyDefinition propertyDefinition)
        {
            List <TEntry> tempEntries = new List <TEntry>();

            foreach (TKey key in this.addedEntries)
            {
                tempEntries.Add(this.entries[key]);
            }
            foreach (TKey key in this.modifiedEntries)
            {
                tempEntries.Add(this.entries[key]);
            }

            foreach (TEntry entry in tempEntries)
            {
                if (!entry.WriteSetUpdateToXml(
                        writer,
                        ewsObject,
                        propertyDefinition.XmlElementName))
                {
                    writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetSetFieldXmlElementName());
                    this.WriteUriToXml(writer, entry.Key);

                    writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetXmlElementName());
                    writer.WriteStartElement(XmlNamespace.Types, propertyDefinition.XmlElementName);
                    entry.WriteToXml(writer, this.GetEntryXmlElementName(entry));
                    writer.WriteEndElement();
                    writer.WriteEndElement();

                    writer.WriteEndElement();
                }
            }

            foreach (TEntry entry in this.removedEntries.Values)
            {
                if (!entry.WriteDeleteUpdateToXml(writer, ewsObject))
                {
                    writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetDeleteFieldXmlElementName());
                    this.WriteUriToXml(writer, entry.Key);
                    writer.WriteEndElement();
                }
            }

            return(true);
        }
Exemple #16
0
        /// <summary>
        /// Internal the write delete update to json.
        /// </summary>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="updates">The updates.</param>
        internal void InternalWriteDeleteUpdateToJson(ServiceObject ewsObject, string propertyName, List <JsonObject> updates)
        {
            JsonObject jsonUpdate = new JsonObject();

            jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());

            JsonObject jsonUri = new JsonObject();

            jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
            jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName));
            jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString());

            jsonUpdate.Add(JsonNames.Path, jsonUri);

            updates.Add(jsonUpdate);
        }
Exemple #17
0
        /// <summary>
        /// Writes the update to Json.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">Property definition.</param>
        /// <param name="updates">The updates.</param>
        /// <returns>
        /// True if property generated serialization.
        /// </returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List <JsonObject> updates)
        {
            // If the collection is empty, delete the property.
            if (this.Count == 0)
            {
                JsonObject jsonUpdate = new JsonObject();

                jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());
                jsonUpdate.Add(JsonNames.Path, (propertyDefinition as IJsonSerializable).ToJson(service));
                return(true);
            }

            // Otherwise, use the default Json serializer.
            else
            {
                return(false);
            }
        }
Exemple #18
0
        /// <summary>
        /// Writes the set update to json.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">The property definition.</param>
        /// <param name="updates">The updates.</param>
        /// <returns></returns>
        internal override bool WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List <JsonObject> updates)
        {
            List <string> propertiesToSet = new List <string>();

            propertiesToSet.AddRange(this.propertyBag.AddedItems);
            propertiesToSet.AddRange(this.propertyBag.ModifiedItems);

            foreach (string propertyName in propertiesToSet)
            {
                JsonObject jsonUpdate = new JsonObject();

                jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName());

                JsonObject jsonUri = new JsonObject();

                jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
                jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName));
                jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString());

                jsonUpdate.Add(JsonNames.Path, jsonUri);

                JsonObject jsonProperty = new JsonObject();
                jsonProperty.Add(XmlAttributeNames.Key, this.Key);
                jsonProperty.Add(propertyName, this.propertyBag[propertyName]);

                JsonObject jsonServiceObject = new JsonObject();
                jsonServiceObject.AddTypeParameter(ewsObject.GetXmlElementName());
                jsonServiceObject.Add(propertyDefinition.XmlElementName, new JsonObject[] { jsonProperty });

                jsonUpdate.Add(PropertyBag.GetPropertyUpdateItemName(ewsObject), jsonServiceObject);

                updates.Add(jsonUpdate);
            }

            foreach (string propertyName in this.propertyBag.RemovedItems)
            {
                this.InternalWriteDeleteUpdateToJson(
                    ewsObject,
                    propertyName,
                    updates);
            }

            return(true);
        }
Exemple #19
0
        /// <summary>
        /// Writes the update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="propertyDefinition">Property definition.</param>
        /// <returns>True if property generated serialization.</returns>
        bool ICustomUpdateSerializer.WriteSetUpdateToXml(
            EwsServiceXmlWriter writer,
            ServiceObject ewsObject,
            PropertyDefinition propertyDefinition)
        {
            // If the collection is empty, delete the property.
            if (this.Count == 0)
            {
                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetDeleteFieldXmlElementName());
                propertyDefinition.WriteToXml(writer);
                writer.WriteEndElement();
                return(true);
            }

            // Otherwise, use the default XML serializer.
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Writes the delete update to json.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <param name="updates">The updates.</param>
        /// <returns></returns>
        bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List <JsonObject> updates)
        {
            foreach (ExtendedProperty extendedProperty in this.Items)
            {
                updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject));
            }

            return(true);
        }
Exemple #21
0
 /// <summary>
 /// Gets the name of the property update item.
 /// </summary>
 /// <param name="serviceObject">The service object.</param>
 /// <returns></returns>
 internal static string GetPropertyUpdateItemName(ServiceObject serviceObject)
 {
     return(serviceObject as Folder != null ?
            XmlElementNames.Folder :
            XmlElementNames.Item);
 }
Exemple #22
0
 /// <summary>
 /// Writes deletion update to XML.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <returns>
 /// True if property generated serialization.
 /// </returns>
 bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject)
 {
     return(false);
 }
        /// <summary>
        /// Writes the deletion update to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="ewsObject">The ews object.</param>
        /// <returns>
        /// True if property generated serialization.
        /// </returns>
        bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject)
        {
            foreach (ExtendedProperty extendedProperty in this.Items)
            {
                writer.WriteStartElement(XmlNamespace.Types, ewsObject.GetDeleteFieldXmlElementName());
                extendedProperty.PropertyDefinition.WriteToXml(writer);
                writer.WriteEndElement();
            }

            return(true);
        }
Exemple #24
0
 /// <summary>
 /// Writes the delete update to json.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="updates">The updates.</param>
 /// <returns></returns>
 bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List <JsonObject> updates)
 {
     return(false);
 }
 /// <summary>
 /// Writes the delete update to XML.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <returns>True if update XML was written.</returns>
 internal virtual bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject)
 {
     return(false);
 }
 /// <summary>
 /// Writes the delete update to json.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="ewsObject">The ews object.</param>
 /// <param name="updates">The updates.</param>
 /// <returns></returns>
 internal virtual bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List <JsonObject> updates)
 {
     return(false);
 }
 /// <summary>
 /// Creates the property instance.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <returns>ComplexProperty.</returns>
 internal abstract ComplexProperty CreatePropertyInstance(ServiceObject owner);
Exemple #28
0
        /// <summary>
        /// Creates the json set update.
        /// </summary>
        /// <param name="propertyDefinition">The property definition.</param>
        /// <param name="service">The service.</param>
        /// <param name="serviceObject">The service object.</param>
        /// <param name="propertyBag">The property bag.</param>
        /// <returns></returns>
        internal static JsonObject CreateJsonSetUpdate(PropertyDefinition propertyDefinition, ExchangeService service, ServiceObject serviceObject, PropertyBag propertyBag)
        {
            JsonObject jsonUpdate = new JsonObject();

            jsonUpdate.AddTypeParameter(serviceObject.GetSetFieldXmlElementName());

            jsonUpdate.Add(JsonNames.Path, (propertyDefinition as IJsonSerializable).ToJson(service));

            JsonObject jsonServiceObject = new JsonObject();

            jsonServiceObject.AddTypeParameter(serviceObject.GetXmlElementName());
            propertyDefinition.WriteJsonValue(jsonServiceObject, propertyBag, service, true);

            jsonUpdate.Add(GetPropertyUpdateItemName(serviceObject), jsonServiceObject);
            return(jsonUpdate);
        }
Exemple #29
0
        /// <summary>
        /// Creates the json set update.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="service">The service.</param>
        /// <param name="serviceObject">The service object.</param>
        /// <returns></returns>
        internal static JsonObject CreateJsonSetUpdate(ExtendedProperty value, ExchangeService service, ServiceObject serviceObject)
        {
            JsonObject jsonUpdate = new JsonObject();

            jsonUpdate.AddTypeParameter(serviceObject.GetSetFieldXmlElementName());

            jsonUpdate.Add(JsonNames.Path, (value.PropertyDefinition as IJsonSerializable).ToJson(service));

            JsonObject jsonServiceObject = new JsonObject();

            jsonServiceObject.AddTypeParameter(serviceObject.GetXmlElementName());
            jsonServiceObject.Add(XmlElementNames.ExtendedProperty, new object[] { value.InternalToJson(service) });

            jsonUpdate.Add(GetPropertyUpdateItemName(serviceObject), jsonServiceObject);
            return(jsonUpdate);
        }
Exemple #30
0
        /// <summary>
        /// Creates the json delete update.
        /// </summary>
        /// <param name="propertyDefinition">The property definition.</param>
        /// <param name="service">The service.</param>
        /// <param name="serviceObject">The service object.</param>
        /// <returns></returns>
        internal static JsonObject CreateJsonDeleteUpdate(PropertyDefinitionBase propertyDefinition, ExchangeService service, ServiceObject serviceObject)
        {
            JsonObject jsonUpdate = new JsonObject();

            jsonUpdate.AddTypeParameter(serviceObject.GetDeleteFieldXmlElementName());

            jsonUpdate.Add("PropertyPath", (propertyDefinition as IJsonSerializable).ToJson(service));
            return(jsonUpdate);
        }