备份周期会议的周期属性
Beispiel #1
0
        /// <summary>
        /// 保存打开的约会信息 2014/11/6 
        /// </summary>
        /// <param name="item">需要保存的约会</param>
        private BackUpAppointment copyAppointMentItem(AppointmentItem item)
        {
            string attendences = item.RequiredAttendees;
            try
            {
                if (attendences != null && attendences.IndexOf(";") > 0)
                {
                    attendences = attendences.Substring(attendences.IndexOf(";") + 1);
                }
                else
                {
                    attendences = "";
                }
            }
            catch (System.Exception ex)
            {
                attendences = "";
                ThisAddIn.g_log.Error(string.Format("new inspector error: {0}", ex.Message));
            }

            BackUpAppointment bak_app = BackUpAppointment.backUp(item.Subject, item.Start, item.End, item.Location, item.Resources, attendences, item.Body);
            bak_app.IsRecurring = item.IsRecurring;

            //2014/11/10  备份周期会议的会议属性
            if (item.IsRecurring)
            {
                BackUpRecurrencePattern bakRecurrence = new BackUpRecurrencePattern();
                bak_app.bak_recurrencePattern = bakRecurrence.backUpRePattern(item.GetRecurrencePattern());
            }

            UserProperty up = item.UserProperties.Find(ThisAddIn.PROPERTY_CONFERENCE_PASSWORD, Type.Missing);
            if (up != null)
            {
                bak_app.bak_confPwd = up.Value;
            }
            else
            {
                bak_app.bak_confPwd = ThisAddIn.g_SystemSettings.strConfPWD;
            }

            up = item.UserProperties.Find(ThisAddIn.PROPERTY_VIDEO_SITES_COUNT, Type.Missing);
            if (up != null)
            {
                bak_app.bak_videoCount = up.Value;
            }
            else
            {
                bak_app.bak_videoCount = ThisAddIn.g_SystemSettings.nVideoSitesCount;
            }

            up = item.UserProperties.Find(ThisAddIn.PROPERTY_VOICE_SITES_COUNT, Type.Missing);
            if (up != null)
            {
                bak_app.bak_voiceCount = up.Value;
            }
            else
            {
                bak_app.bak_voiceCount = ThisAddIn.g_SystemSettings.nVoiceSitesCount;
            }

            //is recording
            up = item.UserProperties.Find(ThisAddIn.PROPERTY_IS_RECORDING, Type.Missing);
            if (up != null)
            {
                bak_app.bak_record = up.Value;
            }
            else
            {
                bak_app.bak_record = Convert.ToBoolean(ThisAddIn.g_SystemSettings.nRecording);
            }

            //is living
            up = item.UserProperties.Find(ThisAddIn.PROPERTY_IS_LIVING, Type.Missing);
            if (up != null)
            {
                bak_app.bak_liveBoradcast = up.Value;
            }
            else
            {
                bak_app.bak_liveBoradcast = Convert.ToBoolean(ThisAddIn.g_SystemSettings.nLiving);
            }

            //site rate
            up = item.UserProperties.Find(ThisAddIn.PROPERTY_SITE_RATE, Type.Missing);
            if (up != null)
            {
                bak_app.bak_siteRate = up.Value;
            }
            else
            {
                bak_app.bak_siteRate = ThisAddIn.g_SystemSettings.strSiteRate;
            }

            up = item.UserProperties.Find(ThisAddIn.PROPERTY_SECURITY_LEVEL, Type.Missing);
            if (up != null)
            {
                bak_app.bak_securityLevel = up.Value;
            }
            else
            {
                bak_app.bak_securityLevel = ThisAddIn.g_SystemSettings.nMediaEncryptType;
            }

            up = item.UserProperties.Find(ThisAddIn.PROPERTY_BILL_CODE, Type.Missing);
            if (up != null)
            {
                bak_app.bak_billCode = up.Value;
            }
            else
            {
                bak_app.bak_billCode = ThisAddIn.g_SystemSettings.strBillCode;
            }

            up = item.UserProperties.Find(ThisAddIn.PROPERTY_CPRESOURCE, Type.Missing);
            if (up != null)
            {
                bak_app.bak_cpResource = string.Format("{0}", up.Value);
            }
            else
            {
                bak_app.bak_cpResource = string.Format("{0}", ThisAddIn.g_SystemSettings.nCPResource);
            }
            return bak_app;
        }
        public BackUpRecurrencePattern backUpRePattern(RecurrencePattern rPattern)
        {
            BackUpRecurrencePattern bak_RecurrencePattern = new BackUpRecurrencePattern();
            bak_RecurrencePattern.DayOfMonth = rPattern.DayOfMonth;
            bak_RecurrencePattern.DayOfWeekMask = rPattern.DayOfWeekMask;
            bak_RecurrencePattern.Duration = rPattern.Duration;
            bak_RecurrencePattern.EndTime = rPattern.EndTime;
            bak_RecurrencePattern.Instance = rPattern.Instance;
            bak_RecurrencePattern.Interval = rPattern.Interval;
            bak_RecurrencePattern.MonthOfYear = rPattern.MonthOfYear;
            bak_RecurrencePattern.NoEndDate = rPattern.NoEndDate;
            bak_RecurrencePattern.Occurrences = rPattern.Occurrences;
            bak_RecurrencePattern.PatternEndDate = rPattern.PatternEndDate;
            bak_RecurrencePattern.PatternStartDate = rPattern.PatternStartDate;
            bak_RecurrencePattern.RecurrenceType = (Int32)rPattern.RecurrenceType;
            bak_RecurrencePattern.Regenerate = rPattern.Regenerate;
            bak_RecurrencePattern.StartTime = rPattern.StartTime;

            return bak_RecurrencePattern;
        }