예제 #1
0
        /// <summary>
        /// Creates the json for update.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="jsonObject">The json object.</param>
        private void ToJsonForUpdate(ExchangeService service, JsonObject jsonObject)
        {
            jsonObject.AddTypeParameter(this.Owner.GetChangeXmlElementName());

            jsonObject.Add(this.Owner.GetId().GetJsonTypeName(), this.Owner.GetId().InternalToJson(service));

            List <JsonObject> jsonUpdates = new List <JsonObject>();

            foreach (PropertyDefinition propertyDefinition in this.addedProperties)
            {
                this.WriteSetUpdateToJson(jsonUpdates, propertyDefinition, service);
            }

            foreach (PropertyDefinition propertyDefinition in this.modifiedProperties)
            {
                this.WriteSetUpdateToJson(jsonUpdates, propertyDefinition, service);
            }

            foreach (KeyValuePair <PropertyDefinition, object> property in this.deletedProperties)
            {
                this.WriteDeleteUpdateToJson(
                    jsonUpdates,
                    property.Key,
                    property.Value,
                    service);
            }

            jsonObject.Add(XmlElementNames.Updates, jsonUpdates.ToArray());
        }
예제 #2
0
        /// <summary>
        /// Creates a JSON representation of this object.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        object IJsonSerializable.ToJson(ExchangeService service)
        {
            JsonObject jsonRequest = new JsonObject();

            JsonObject jsonSubscribeRequest = new JsonObject();

            jsonSubscribeRequest.AddTypeParameter(this.GetSubscriptionXmlElementName());
            jsonSubscribeRequest.Add(XmlElementNames.EventTypes, this.EventTypes.ToArray());

            if (this.FolderIds.Count > 0)
            {
                jsonSubscribeRequest.Add(XmlElementNames.FolderIds, this.FolderIds.InternalToJson(service));
            }
            else
            {
                jsonSubscribeRequest.Add(XmlAttributeNames.SubscribeToAllFolders, true);
            }

            if (!string.IsNullOrEmpty(this.Watermark))
            {
                jsonSubscribeRequest.Add(XmlElementNames.Watermark, this.Watermark);
            }

            this.AddJsonProperties(jsonSubscribeRequest, service);

            jsonRequest.Add(XmlElementNames.SubscriptionRequest, jsonSubscribeRequest);

            return(jsonRequest);
        }
예제 #3
0
        internal override object InternalToJson(ExchangeService service)
        {
            JsonObject jsonFilter = new JsonObject();

            jsonFilter.AddTypeParameter(this.GetXmlElementName());

            return(jsonFilter);
        }
예제 #4
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);
        }
        /// <summary>
        /// Creates a JSON representation of this object.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        object IJsonSerializable.ToJson(ExchangeService service)
        {
            JsonObject jsonPropertyDefinition = new JsonObject();

            jsonPropertyDefinition.AddTypeParameter(this.GetJsonType());
            this.AddJsonProperties(jsonPropertyDefinition, service);

            return(jsonPropertyDefinition);
        }
            /// <summary>
            /// Patterns to json.
            /// </summary>
            /// <param name="service">The service.</param>
            /// <returns></returns>
            internal override JsonObject PatternToJson(ExchangeService service)
            {
                JsonObject jsonPattern = new JsonObject();

                jsonPattern.AddTypeParameter(this.XmlElementName);
                jsonPattern.Add(XmlElementNames.Interval, this.Interval);

                return jsonPattern;
            }
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service"></param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal override object InternalToJson(ExchangeService service)
        {
            JsonObject jsonProperty = new JsonObject();

            jsonProperty.AddTypeParameter(this.GetXmlElementName());
            jsonProperty.Add(XmlAttributeNames.RecurringMasterId, this.UniqueId);
            jsonProperty.Add(XmlAttributeNames.InstanceIndex, this.OccurrenceIndex);

            return(jsonProperty);
        }
예제 #8
0
        /// <summary>
        /// Writes the URI to json.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        private JsonObject WriteUriToJson(TKey key)
        {
            JsonObject jsonUri = new JsonObject();

            jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
            jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI());
            jsonUri.Add(XmlAttributeNames.FieldIndex, this.GetFieldIndex(key));

            return(jsonUri);
        }
예제 #9
0
            /// <summary>
            /// Patterns to json.
            /// </summary>
            /// <param name="service">The service.</param>
            /// <returns></returns>
            internal override JsonObject PatternToJson(ExchangeService service)
            {
                JsonObject jsonPattern = new JsonObject();

                jsonPattern.AddTypeParameter(this.XmlElementName);
                jsonPattern.Add(XmlElementNames.DayOfMonth, this.DayOfMonth);
                jsonPattern.Add(XmlElementNames.Month, this.Month);

                return(jsonPattern);
            }
예제 #10
0
        /// <summary>
        /// Creates a JSON representation of this object.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal object WritePagingToJson(ExchangeService service)
        {
            JsonObject jsonView = new JsonObject();

            jsonView.AddTypeParameter(this.GetViewJsonTypeName());

            this.InternalWritePagingToJson(jsonView, service);

            return(jsonView);
        }
예제 #11
0
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal override object InternalToJson(ExchangeService service)
        {
            JsonObject jsonProperty = new JsonObject();

            jsonProperty.AddTypeParameter(this.GetJsonTypeName());
            jsonProperty.Add(XmlAttributeNames.Id, this.UniqueId);
            jsonProperty.Add(XmlAttributeNames.ChangeKey, this.ChangeKey);

            return(jsonProperty);
        }
예제 #12
0
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="isCalendarFolder">if set to <c>true</c> [is calendar folder].</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal object InternalToJson(ExchangeService service, bool isCalendarFolder)
        {
            JsonObject jsonPermission = new JsonObject();

            jsonPermission.Add(XmlElementNames.UserId, this.UserId.InternalToJson(service));

            if (this.PermissionLevel == FolderPermissionLevel.Custom)
            {
                jsonPermission.Add(
                    XmlElementNames.CanCreateItems,
                    this.CanCreateItems);

                jsonPermission.Add(
                    XmlElementNames.CanCreateSubFolders,
                    this.CanCreateSubFolders);

                jsonPermission.Add(
                    XmlElementNames.IsFolderOwner,
                    this.IsFolderOwner);

                jsonPermission.Add(
                    XmlElementNames.IsFolderVisible,
                    this.IsFolderVisible);

                jsonPermission.Add(
                    XmlElementNames.IsFolderContact,
                    this.IsFolderContact);

                jsonPermission.Add(
                    XmlElementNames.EditItems,
                    this.EditItems);

                jsonPermission.Add(
                    XmlElementNames.DeleteItems,
                    this.DeleteItems);

                jsonPermission.Add(
                    XmlElementNames.ReadItems,
                    this.ReadItems);
            }

            jsonPermission.Add(
                isCalendarFolder ? XmlElementNames.CalendarPermissionLevel : XmlElementNames.PermissionLevel,
                this.PermissionLevel);

            jsonPermission.AddTypeParameter(
                isCalendarFolder ? XmlElementNames.CalendarPermission : XmlElementNames.Permission);

            return(jsonPermission);
        }
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal override object InternalToJson(ExchangeService service)
        {
            JsonObject    jsonProperty = new JsonObject();
            List <object> permissions  = new List <object>();

            foreach (FolderPermission folderPermission in this)
            {
                permissions.Add(folderPermission.InternalToJson(service, this.isCalendarFolder));
            }

            jsonProperty.AddTypeParameter(this.InnerCollectionXmlElementName);
            jsonProperty.Add(this.InnerCollectionXmlElementName, permissions.ToArray());

            return(jsonProperty);
        }
예제 #14
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);
        }
예제 #15
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);
        }
예제 #16
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);
        }
예제 #17
0
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service"></param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal override object InternalToJson(ExchangeService service)
        {
            JsonObject jsonProperty = new JsonObject();

            jsonProperty.AddTypeParameter(this.GetXmlElementName());
            jsonProperty.Add(XmlElementNames.Name, this.Name);
            jsonProperty.Add(XmlElementNames.ContentType, this.ContentType);
            jsonProperty.Add(XmlElementNames.ContentId, this.ContentId);
            jsonProperty.Add(XmlElementNames.ContentLocation, this.ContentLocation);
            if (service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1)
            {
                jsonProperty.Add(XmlElementNames.IsInline, this.IsInline);
            }

            return(jsonProperty);
        }
예제 #18
0
        /// <summary>
        /// Creates the json for create.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="jsonObject">The json object.</param>
        private void ToJsonForCreate(ExchangeService service, JsonObject jsonObject)
        {
            jsonObject.AddTypeParameter(this.Owner.GetXmlElementName());

            foreach (PropertyDefinition propertyDefinition in this.Owner.Schema)
            {
                // The following test should not be necessary since the property bag prevents
                // properties to be set if they don't have the CanSet flag, but it doesn't hurt...
                if (propertyDefinition.HasFlag(PropertyDefinitionFlags.CanSet, service.RequestedServerVersion))
                {
                    if (this.Contains(propertyDefinition))
                    {
                        propertyDefinition.WriteJsonValue(jsonObject, this, service, false);
                    }
                }
            }
        }
예제 #19
0
        /// <summary>
        /// Creates a JSON representation of this object.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        object IJsonSerializable.ToJson(ExchangeService service)
        {
            JsonObject    jsonRequest   = new JsonObject();
            List <object> attachmentIds = new List <object>();

            foreach (Attachment attachment in this.Attachments)
            {
                JsonObject jsonAttachmentId = new JsonObject();
                jsonAttachmentId.AddTypeParameter("AttachmentId");
                jsonAttachmentId.Add(XmlAttributeNames.Id, attachment.Id);

                attachmentIds.Add(jsonAttachmentId);
            }

            jsonRequest.Add(XmlElementNames.AttachmentIds, attachmentIds.ToArray());

            return(jsonRequest);
        }
예제 #20
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);
            }
        }
예제 #21
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);
        }
예제 #22
0
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service"></param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        internal override object InternalToJson(ExchangeService service)
        {
            if (this.FolderName.HasValue)
            {
                JsonObject jsonProperty = new JsonObject();

                jsonProperty.AddTypeParameter(this.GetXmlElementName());
                jsonProperty.Add(XmlAttributeNames.Id, this.FolderName.Value.ToString().ToLowerInvariant());

                if (this.Mailbox != null)
                {
                    jsonProperty.Add(XmlElementNames.Mailbox, this.Mailbox.InternalToJson(service));
                }

                return(jsonProperty);
            }
            else
            {
                return(base.InternalToJson(service));
            }
        }
            /// <summary>
            /// Serializes the property to a Json value.
            /// </summary>
            /// <param name="service">The service.</param>
            /// <returns>
            /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
            /// </returns>
            internal override object InternalToJson(ExchangeService service)
            {
                JsonObject jsonFilter             = base.InternalToJson(service) as JsonObject;
                JsonObject jsonFieldUriOrConstant = new JsonObject();

                if (this.Value != null)
                {
                    JsonObject jsonConstant = new JsonObject();
                    jsonConstant.Add(XmlElementNames.Value, this.Value);
                    jsonConstant.AddTypeParameter(XmlElementNames.Constant);
                    jsonFieldUriOrConstant.Add(XmlElementNames.Item, jsonConstant);
                }
                else
                {
                    jsonFieldUriOrConstant.Add(XmlElementNames.Item, ((IJsonSerializable)this.OtherPropertyDefinition).ToJson(service));
                }

                jsonFilter.Add(XmlElementNames.FieldURIOrConstant, jsonFieldUriOrConstant);

                return(jsonFilter);
            }
        /// <summary>
        /// Creates a JSON representation of this object.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        object IJsonSerializable.ToJson(ExchangeService service)
        {
            List <object> jsonArray = new List <object>();

            foreach (ClientAccessTokenRequest tokenRequestInfo in this.TokenRequests)
            {
                JsonObject innerRequest = new JsonObject();
                innerRequest.AddTypeParameter(XmlElementNames.TokenRequest);
                innerRequest.Add(XmlElementNames.Id, tokenRequestInfo.Id);
                innerRequest.Add(XmlElementNames.TokenType, tokenRequestInfo.TokenType);
                if (!string.IsNullOrEmpty(tokenRequestInfo.Scope))
                {
                    innerRequest.Add(XmlElementNames.HighlightTermScope, tokenRequestInfo.Scope);
                }

                jsonArray.Add(innerRequest);
            }

            JsonObject jsonRequest = new JsonObject();

            jsonRequest.Add(XmlElementNames.TokenRequests, jsonArray.ToArray());
            return(jsonRequest);
        }
예제 #25
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>
        bool ICustomUpdateSerializer.WriteSetUpdateToJson(
            ExchangeService service,
            ServiceObject ewsObject,
            PropertyDefinition propertyDefinition,
            List <JsonObject> updates)
        {
            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.WriteSetUpdateToJson(
                        service,
                        ewsObject,
                        propertyDefinition,
                        updates))
                {
                    JsonObject jsonUpdate = new JsonObject();

                    jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName());

                    JsonObject jsonUri = new JsonObject();

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

                    jsonUpdate.Add(JsonNames.Path, jsonUri);

                    object jsonProperty = entry.InternalToJson(service);

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

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

                    updates.Add(jsonUpdate);
                }
            }

            foreach (TEntry entry in this.removedEntries.Values)
            {
                if (!entry.WriteDeleteUpdateToJson(service, ewsObject, updates))
                {
                    JsonObject jsonUpdate = new JsonObject();

                    jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());

                    JsonObject jsonUri = new JsonObject();

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

                    jsonUpdate.Add(JsonNames.Path, jsonUri);

                    updates.Add(jsonUpdate);
                }
            }

            return(true);
        }
예제 #26
0
 /// <summary>
 /// Adds the properties to json.
 /// </summary>
 /// <param name="jsonProperty">The json property.</param>
 /// <param name="service">The service.</param>
 internal virtual void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
 {
     jsonProperty.AddTypeParameter(this.XmlElementName);
     jsonProperty.Add(XmlElementNames.StartDate, EwsUtilities.DateTimeToXSDate(this.StartDate));
 }