Microsoft.Protocols.TestSuites.MS_OXWSMTGS.S01_CreateGetDeleteCalendarRelatedItem.GetFirstOccurrenceItem C# (CSharp) Method

GetFirstOccurrenceItem() private method

Get the first occurrence of a recurring meeting.
private GetFirstOccurrenceItem ( CalendarItemType meetingItem, Role role ) : ItemType
meetingItem Microsoft.Protocols.TestSuites.Common.CalendarItemType A recurring meeting.
role Role The role to get the recurring meeting.
return Microsoft.Protocols.TestSuites.Common.ItemType
        private ItemType GetFirstOccurrenceItem(CalendarItemType meetingItem, Role role)
        {
            if (meetingItem != null)
            {
                #region Get the calendar the targeted occurrence belongs to.
                CalendarItemType calendar = this.SearchSingleItem(role, DistinguishedFolderIdNameType.calendar, "IPM.Appointment", meetingItem.UID) as CalendarItemType;
                Site.Assert.IsNotNull(calendar, "The calendar the targeted occurrence belongs to should exist.");

                OccurrenceItemIdType occurrenceId = new OccurrenceItemIdType();
                occurrenceId.RecurringMasterId = calendar.ItemId.Id;
                occurrenceId.InstanceIndex = 1;
                #endregion

                #region Get the occurrence item
                ItemInfoResponseMessageType getItem = this.GetSingleCalendarItem(role, occurrenceId);
                if (getItem != null)
                {
                    return getItem.Items.Items[0];
                }
                #endregion
            }

            return null;
        }
S01_CreateGetDeleteCalendarRelatedItem