public void SetDeliverMeetingRequests(string deliveryScope, DelegateUser randomUser) { MeetingRequestsDeliveryScope scope = (MeetingRequestsDeliveryScope)Enum.Parse(typeof(MeetingRequestsDeliveryScope), deliveryScope); Collection <DelegateUserResponse> result = service.UpdateDelegates(mailbox, scope, randomUser); if (result[0].Result == ServiceResult.Success) { return; } else { throw new EWSException(result[0].ErrorCode.ToString(), result[0]); } }
public void UpdateDelegate(DelegateUser delegateToUpdate, string currentSchedulerOption) { MeetingRequestsDeliveryScope scope = (MeetingRequestsDeliveryScope)Enum.Parse(typeof(MeetingRequestsDeliveryScope), currentSchedulerOption); Collection <DelegateUserResponse> result = service.UpdateDelegates(mailbox, scope, delegateToUpdate); if (result[0].Result == ServiceResult.Success) { return; } else { throw new EWSException(result[0].ErrorCode.ToString(), result[0]); } }
public void AddDelegate(string delegateSmtp, bool receiveSchedulers, bool viewPrivateItems, string currentSchedulerOption) { MeetingRequestsDeliveryScope scope = (MeetingRequestsDeliveryScope)Enum.Parse(typeof(MeetingRequestsDeliveryScope), currentSchedulerOption); DelegateUser delegateUser = new DelegateUser(delegateSmtp); delegateUser.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Editor; delegateUser.ReceiveCopiesOfMeetingMessages = receiveSchedulers; delegateUser.ViewPrivateItems = viewPrivateItems; Collection <DelegateUserResponse> result = service.AddDelegates(mailbox, scope, delegateUser); if (result[0].Result == ServiceResult.Success) { return; } else { throw new EWSException(result[0].ErrorCode.ToString(), result[0]); } }
/// <summary> /// Reads response elements from XML. /// </summary> /// <param name="reader">The reader.</param> internal override void ReadElementsFromXml(EwsServiceXmlReader reader) { base.ReadElementsFromXml(reader); if (this.ErrorCode == ServiceError.NoError) { // If there were no response messages, the reader will already be on the // DeliverMeetingRequests start element, so we don't need to read it. if (this.DelegateUserResponses.Count > 0) { reader.Read(); } // Make sure that we're at the DeliverMeetingRequests element before trying to read the value. // In error cases, the element may not have been returned. if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.DeliverMeetingRequests)) { this.meetingRequestsDeliveryScope = reader.ReadElementValue<MeetingRequestsDeliveryScope>(); } } }
void ReadElementsFromXml(EwsServiceXmlReader reader) { base.ReadElementsFromXml(reader); if (this.ErrorCode == ServiceError.NoError) { // If there were no response messages, the reader will already be on the // DeliverMeetingRequests start element, so we don't need to read it. if (this.DelegateUserResponses.Count > 0) { reader.Read(); } // Make sure that we're at the DeliverMeetingRequests element before trying to read the value. // In error cases, the element may not have been returned. if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.DeliverMeetingRequests)) { this.meetingRequestsDeliveryScope = reader.ReadElementValue <MeetingRequestsDeliveryScope>(); } } }
/// <summary> /// Initializes a DelegateInformation object /// </summary> /// <param name="delegateUserResponses">List of DelegateUserResponses from a GetDelegates request</param> /// <param name="meetingReqestsDeliveryScope">MeetingRequestsDeliveryScope from a GetDelegates request.</param> internal DelegateInformation(IList <DelegateUserResponse> delegateUserResponses, MeetingRequestsDeliveryScope meetingReqestsDeliveryScope) { this.delegateUserResponses = new Collection <DelegateUserResponse>(delegateUserResponses); this.meetingReqestsDeliveryScope = meetingReqestsDeliveryScope; }
/// <summary> /// Initializes a DelegateInformation object /// </summary> /// <param name="delegateUserResponses">List of DelegateUserResponses from a GetDelegates request</param> /// <param name="meetingReqestsDeliveryScope">MeetingRequestsDeliveryScope from a GetDelegates request.</param> internal DelegateInformation(IList<DelegateUserResponse> delegateUserResponses, MeetingRequestsDeliveryScope meetingReqestsDeliveryScope) { this.delegateUserResponses = new Collection<DelegateUserResponse>(delegateUserResponses); this.meetingReqestsDeliveryScope = meetingReqestsDeliveryScope; }