public OutlookItem Create(object obj) { if (obj == null) { throw new ArgumentNullException("obj"); } OutlookItem retVal = null; Outlook._AppointmentItem appItem = obj as Outlook._AppointmentItem; if (obj is Outlook._AppointmentItem) { retVal = new OutlookAppointment(_listener, (Outlook._AppointmentItem)obj); } else if (obj is Outlook.RecurrencePattern) { retVal = new OutlookRecurrencePattern(_listener, (Outlook.RecurrencePattern)obj); } else if (obj is Outlook.Exception) { retVal = new OutlookException(_listener, (Outlook.Exception)obj); } else if (obj is Outlook.Recipient) { retVal = new OutlookRecipient(_listener, (Outlook.Recipient)obj); } else if (obj is Outlook.MAPIFolder) { retVal = new OutlookFolder(_listener, (Outlook.MAPIFolder)obj); } return(retVal); }
/// <summary> /// Gets the recurrence pattern. /// </summary> /// <param name="oAppItem">The o app item.</param> /// <returns></returns> public OutlookRecurrencePattern GetRecurrencePattern(Outlook._AppointmentItem oAppItem) { if (oAppItem == null) { throw new ArgumentNullException("oAppItem"); } OutlookRecurrencePattern retVal = null; if (this.InvokeRequired) { Func <Outlook.AppointmentItem, OutlookRecurrencePattern> func = GetRecurrencePattern; retVal = this.Invoke(func, oAppItem) as OutlookRecurrencePattern; } else { Outlook.RecurrencePattern oRecPattern = oAppItem.GetRecurrencePattern(); if (oRecPattern != null) { retVal = _factory.Create <OutlookItem>(oRecPattern) as OutlookRecurrencePattern; } } return(retVal); }
public RecurrencePatternSerializer(OutlookRecurrencePattern rPattern) { _rPattern = rPattern; }