Example #1
0
		/// <remarks/>
		public void GetItemAsync(GetItemType GetItem1, object userState)
		{
			if ((GetItemOperationCompleted == null))
			{
				GetItemOperationCompleted = new SendOrPostCallback(OnGetItemOperationCompleted);
			}
			InvokeAsync("GetItem", new object[]
			                       	{
			                       		GetItem1
			                       	}, GetItemOperationCompleted, userState);
		}
Example #2
0
		/// <remarks/>
		public void GetItemAsync(GetItemType GetItem1)
		{
			GetItemAsync(GetItem1, null);
		}
		private CalendarItemType GetOccurrenceItem(Appointment master, int index)
		{
			ItemIdType masterItemId = new ItemIdType();
			masterItemId.Id = master.Attributes[ExchangeIdAttribute];
			masterItemId.ChangeKey = master.Attributes[ExchangeChangeKeyAttribute];

			OccurrenceItemIdType occurrenceItemId = new OccurrenceItemIdType();
			occurrenceItemId.RecurringMasterId = masterItemId.Id;
			occurrenceItemId.InstanceIndex = index;

			PathToUnindexedFieldType calendarItemTypePath = new PathToUnindexedFieldType();
			calendarItemTypePath.FieldURI = UnindexedFieldURIType.calendarCalendarItemType;

			GetItemType getItemRequest = new GetItemType();
			getItemRequest.ItemShape = new ItemResponseShapeType();
			getItemRequest.ItemShape.BaseShape = DefaultShapeNamesType.IdOnly;
			getItemRequest.ItemShape.AdditionalProperties = new BasePathToElementType[] { calendarItemTypePath };
			getItemRequest.ItemIds = new BaseItemIdType[] { masterItemId, occurrenceItemId };

			GetItemResponseType getItemResponse = Service.GetItem(getItemRequest);

			CalendarItemType occurrenceItem = null;
			foreach (ItemInfoResponseMessageType getItemResponseMessage in getItemResponse.ResponseMessages.Items)
			{
				if (getItemResponseMessage.ResponseClass == ResponseClassType.Success &&
				    getItemResponseMessage.Items.Items != null &&
				    getItemResponseMessage.Items.Items.Length > 0)
				{
					occurrenceItem = (CalendarItemType) getItemResponseMessage.Items.Items[0];
				}
			}

			if (occurrenceItem == null)
			{
				throw new Exception("Unable to find occurrence");
			}

			return occurrenceItem;
		}
Example #4
0
		/// <remarks/>
		public IAsyncResult BeginGetItem(GetItemType GetItem1, AsyncCallback callback, object asyncState)
		{
			return BeginInvoke("GetItem", new object[]
			                              	{
			                              		GetItem1
			                              	}, callback, asyncState);
		}
		protected internal IList<CalendarItemType> GetCalendarItems(ItemIdType[] itemIds)
		{
			if (itemIds.Length == 0)
			{
				return new CalendarItemType[0];
			}

			List<CalendarItemType> calendarItems = new List<CalendarItemType>(itemIds.Length);

			// Form the GetItem request.
			GetItemType getItemRequest = new GetItemType();
			getItemRequest.ItemShape = new ItemResponseShapeType();
			getItemRequest.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties;
			getItemRequest.ItemIds = itemIds;

			GetItemResponseType getItemResponse = Service.GetItem(getItemRequest);

			foreach (ItemInfoResponseMessageType responseMessage in getItemResponse.ResponseMessages.Items)
			{
				if (responseMessage.ResponseClass == ResponseClassType.Success &&
				    responseMessage.Items.Items != null &&
				    responseMessage.Items.Items.Length > 0)
				{
					calendarItems.Add((CalendarItemType) responseMessage.Items.Items[0]);
				}
			}

			return calendarItems.ToArray();
		}