Exemplo n.º 1
0
        private static SyncTransferData CreateTransferData(EntityObject entityObject)
        {
            SyncTransferData retVal = null;
            string           transferName;

            if (_entity2transfer.TryGetValue(entityObject.MetaClassName, out transferName))
            {
                switch (transferName)
                {
                case AppointmentTransferData.DataName:
                    retVal = new AppointmentTransferData();
                    break;

                case RecurrencePatternTransferData.DataName:
                    retVal = new RecurrencePatternTransferData();
                    break;

                case RecipientTransferData.DataName:
                    retVal = new RecipientTransferData();
                    break;
                }
                if (retVal != null)
                {
                    CopyProperies(entityObject, retVal);
                }
            }

            return(retVal);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Serializes this instance.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public SyncTransferData Serialize()
        {
            RecurrencePatternTransferData retVal = new RecurrencePatternTransferData();

            switch (RPattern.RecurrenceType)
            {
            case Outlook.OlRecurrenceType.olRecursDaily:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursDaily;
                break;

            case Outlook.OlRecurrenceType.olRecursMonthly:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursMonthly;
                break;

            case Outlook.OlRecurrenceType.olRecursMonthNth:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursMonthNth;
                break;

            case Outlook.OlRecurrenceType.olRecursWeekly:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursWeekly;
                break;

            case Outlook.OlRecurrenceType.olRecursYearly:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursYearly;
                break;

            case Outlook.OlRecurrenceType.olRecursYearNth:
                retVal.RecurrenceType = (int)eRecurrenceType.RecursYearNth;
                break;
            }

            retVal.DayOfWeekMask = (int)RPattern.DayOfWeekMask;

            retVal.MonthOfYear = RPattern.MonthOfYear;
            retVal.DayOfMonth  = RPattern.DayOfMonth;
            if (RPattern.Instance != 0)
            {
                retVal.Instance = RPattern.Instance;
            }
            retVal.Interval = RPattern.Interval;

            retVal.Occurrences = RPattern.Occurrences;
            if (retVal.Occurrences == 0)
            {
                retVal.PatternEndDate = RPattern.PatternEndDate;
            }

            return(retVal);
        }