Esempio n. 1
0
        /// <summary>
        /// Gets the recurrence exceptions.
        /// </summary>
        /// <param name="oRPattern">The o R pattern.</param>
        /// <returns></returns>
        public List <OutlookException> GetRecurrenceExceptions(Outlook.RecurrencePattern oRPattern)
        {
            if (oRPattern == null)
            {
                throw new ArgumentNullException("oRPattern");
            }

            List <OutlookException> retVal = new List <OutlookException>();

            if (this.InvokeRequired)
            {
                Func <Outlook.RecurrencePattern, List <OutlookException> > func = this.GetRecurrenceExceptions;
                retVal = (List <OutlookException>) this.Invoke(func, oRPattern);
            }
            else
            {
                for (int i = 1; i <= oRPattern.Exceptions.Count; i++)
                {
                    Outlook.Exception oException = oRPattern.Exceptions.Item(i);
                    OutlookException  exception  = _factory.Create <OutlookItem>(oException) as OutlookException;
                    if (exception != null)
                    {
                        retVal.Add(exception);
                    }
                }
            }
            return(retVal);
        }
Esempio n. 2
0
        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);
        }