/// <summary>
        /// Validate the request
        /// </summary>
        internal override void Validate()
        {
            base.Validate();

            // TODO - Validate each emailaddress
            EwsUtilities.ValidateParamCollection(this.Emailaddresses, "EmailAddresses");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Validates the request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            EwsUtilities.ValidateParamCollection(this.Items, "Items");
            for (int i = 0; i < this.Items.Count; i++)
            {
                if ((this.Items[i] == null) || this.Items[i].IsNew)
                {
                    throw new ArgumentException(string.Format(Strings.ItemToUpdateCannotBeNullOrNew, i));
                }
            }

            if (this.SavedItemsDestinationFolder != null)
            {
                this.SavedItemsDestinationFolder.Validate(this.Service.RequestedServerVersion);
            }

            // Validate each item.
            foreach (Item item in this.Items)
            {
                item.Validate();
            }

            if (this.SuppressReadReceipts && this.Service.RequestedServerVersion < ExchangeVersion.Exchange2013)
            {
                throw new ServiceVersionException(
                          string.Format(
                              Strings.ParameterIncompatibleWithRequestVersion,
                              "SuppressReadReceipts",
                              ExchangeVersion.Exchange2013));
            }
        }
    void Validate()
    {
        super.Validate();

        // TODO - Validate each emailaddress
        EwsUtilities.ValidateParamCollection(this.Emailaddresses, "EmailAddresses");
    }
Ejemplo n.º 4
0
    void Validate()
    {
        super.Validate();

        if (this.ids != null)
        {
            EwsUtilities.ValidateParamCollection(this.ids, "Ids");
        }
    }
        /// <summary>
        /// Validate request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();

            if (this.ids != null)
            {
                EwsUtilities.ValidateParamCollection(this.ids, "Ids");
            }
        }
 void Validate()
 {
     super.Validate();
     EwsUtilities.ValidateParamCollection(this.conversationActions, "conversationActions");
     for (int iAction = 0; iAction < this.ConversationActions.Count; iAction++)
     {
         this.ConversationActions[iAction].Validate();
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Validate request.
 /// </summary>
 internal override void Validate()
 {
     base.Validate();
     EwsUtilities.ValidateParamCollection(this.Attachments, "Attachments");
     for (int i = 0; i < this.Attachments.Count; i++)
     {
         EwsUtilities.ValidateParam(this.Attachments[i].Id, string.Format("Attachment[{0}].Id", i));
     }
 }
        /// <summary>
        /// Validate request..
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            EwsUtilities.ValidateParamCollection(this.DelegateUsers, "DelegateUsers");

            foreach (DelegateUser delegateUser in this.DelegateUsers)
            {
                delegateUser.ValidateUpdateDelegate();
            }
        }
Ejemplo n.º 9
0
    void Validate()
    {
        super.Validate();
        EwsUtilities.ValidateParamCollection(this.DelegateUsers, "DelegateUsers");

        for (DelegateUser delegateUser in this.DelegateUsers)
        {
            delegateUser.ValidateUpdateDelegate();
        }
    }
Ejemplo n.º 10
0
        /// <summary>
        /// Adds the specified properties to the property set.
        /// </summary>
        /// <param name="properties">The properties to add.</param>
        public void AddRange(IEnumerable <PropertyDefinitionBase> properties)
        {
            this.ThrowIfReadonly();
            EwsUtilities.ValidateParamCollection(properties, "properties");

            foreach (PropertyDefinitionBase property in properties)
            {
                this.Add(property);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamingSubscriptionConnection"/> class.
        /// </summary>
        /// <param name="service">The ExchangeService instance this connection uses to connect to the server.</param>
        /// <param name="subscriptions">The streaming subscriptions this connection is receiving events for.</param>
        /// <param name="lifetime">The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.</param>
        public StreamingSubscriptionConnection(
            ExchangeService service,
            IEnumerable <StreamingSubscription> subscriptions,
            int lifetime) :
            this(service, lifetime)
        {
            EwsUtilities.ValidateParamCollection(subscriptions, "subscriptions");

            foreach (StreamingSubscription subscription in subscriptions)
            {
                this.subscriptions.Add(subscription.Id, subscription);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Validate request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            EwsUtilities.ValidateParamCollection(this.DelegateUsers, "DelegateUsers");

            foreach (DelegateUser delegateUser in this.DelegateUsers)
            {
                delegateUser.ValidateUpdateDelegate();
            }

            if (this.MeetingRequestsDeliveryScope.HasValue)
            {
                EwsUtilities.ValidateEnumVersionValue(this.MeetingRequestsDeliveryScope.Value, this.Service.RequestedServerVersion);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Validates the request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            EwsUtilities.ValidateParamCollection(this.Folders, "Folders");
            for (int i = 0; i < this.Folders.Count; i++)
            {
                Folder folder = this.Folders[i];

                if ((folder == null) || folder.IsNew)
                {
                    throw new ArgumentException(string.Format(Strings.FolderToUpdateCannotBeNullOrNew, i));
                }

                folder.Validate();
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Validate request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            EwsUtilities.ValidateParam(this.FolderIds, "FolderIds");
            EwsUtilities.ValidateParamCollection(this.EventTypes, "EventTypes");
            this.FolderIds.Validate(this.Service.RequestedServerVersion);

            // Check that caller isn't trying to subscribe to Status events.
            if (this.EventTypes.Count <EventType>(eventType => (eventType == EventType.Status)) > 0)
            {
                throw new ServiceValidationException(Strings.CannotSubscribeToStatusEvents);
            }

            // If Watermark was specified, make sure it's not a blank string.
            if (!string.IsNullOrEmpty(this.Watermark))
            {
                EwsUtilities.ValidateNonBlankStringParam(this.Watermark, "Watermark");
            }

            this.EventTypes.ForEach(eventType => EwsUtilities.ValidateEnumVersionValue(eventType, this.Service.RequestedServerVersion));
        }
        /// <summary>
        /// Validate request.
        /// </summary>
        internal override void Validate()
        {
            base.Validate();
            if (this.Attachments.Count > 0)
            {
                EwsUtilities.ValidateParamCollection(this.Attachments, "Attachments");
            }

            if (this.AttachmentIds.Count > 0)
            {
                EwsUtilities.ValidateParamCollection(this.AttachmentIds, "AttachmentIds");
            }

            if (this.AttachmentIds.Count == 0 && this.Attachments.Count == 0)
            {
                throw new ArgumentException(Strings.CollectionIsEmpty, @"Attachments/AttachmentIds");
            }
            for (int i = 0; i < this.AdditionalProperties.Count; i++)
            {
                EwsUtilities.ValidateParam(this.AdditionalProperties[i], string.Format("AdditionalProperties[{0}]", i));
            }
        }
Ejemplo n.º 16
0
 void Validate()
 {
     super.Validate();
     EwsUtilities.ValidateParamCollection(this.FolderIds, "FolderIds");
     this.FolderIds.Validate(this.Service.RequestedServerVersion);
 }
Ejemplo n.º 17
0
 void Validate()
 {
     super.Validate();
     EwsUtilities.ValidateParamCollection(this.Ids, "Ids");
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Validates request.
 /// </summary>
 internal override void Validate()
 {
     base.Validate();
     EwsUtilities.ValidateParamCollection(this.FolderIds, "FolderIds");
     this.FolderIds.Validate(this.Service.RequestedServerVersion);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Validate request.
 /// </summary>
 internal override void Validate()
 {
     base.Validate();
     EwsUtilities.ValidateParamCollection(this.Ids, "Ids");
 }