Example #1
0
 /// <summary>
 /// Update the recurrence rule and recurrence date collections with the dialog control values
 /// </summary>
 /// <param name="rr">The recurrence rules collection to update</param>
 /// <param name="rd">The recurrence dates collection to update</param>
 /// <remarks>Note that the time zone ID will need to be set in the returned RDATE property collection to
 /// make sure that it is consistent with the containing component.</remarks>
 public void GetValues(RRulePropertyCollection rr, RDatePropertyCollection rd)
 {
     rr.Clear();
     rd.Clear();
     rr.CloneRange(rRules);
     rd.CloneRange(rDates);
 }
Example #2
0
        /// <summary>
        /// Initialize the dialog controls using the specified recurrence rule and recurrence date collections
        /// </summary>
        /// <param name="rr">The recurrence rules from which to get the settings</param>
        /// <param name="rd">The recurrence dates from which to get the settings</param>
        public void SetValues(RRulePropertyCollection rr, RDatePropertyCollection rd)
        {
            rRules.Clear();
            rDates.Clear();
            rRules.CloneRange(rr);
            rDates.CloneRange(rd);

            lbRRules.Items.Clear();

            foreach (RRuleProperty r in rRules)
            {
                lbRRules.Items.Add(r.Recurrence.ToString());
            }

            // We won't handle period RDate values
            lbRDates.Items.Clear();

            foreach (RDateProperty rdt in rDates)
            {
                if (rdt.ValueLocation == ValLocValue.Date)
                {
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d"));
                }
                else
                {
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G"));
                }
            }

            this.SetButtonStates();
        }
Example #3
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        public RecurrenceControl()
        {
            InitializeComponent();

            // Set the short date/long time pattern based on the current culture
            dtpRDate.CustomFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + " " +
                                    CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern;
            dtpRDate.Value = DateTime.Today;

            rRules = new RRulePropertyCollection();
            rDates = new RDatePropertyCollection();
            this.SetButtonStates();
        }
Example #4
0
        /// <summary>
        /// The method can be called to clear all current property values from the observance.  The version and
        /// rule type are left unchanged.
        /// </summary>
        public override void ClearProperties()
        {
            startDate  = null;
            offsetFrom = null;
            offsetTo   = null;
            comment    = null;

            rRules  = null;
            rDates  = null;
            tzNames = null;

            customProps = null;
        }
Example #5
0
        /// <summary>
        /// Update the exception rule and exception date collections with the dialog control values
        /// </summary>
        /// <param name="er">The exception rules collection to update</param>
        /// <param name="ed">The exception dates collection to update</param>
        /// <remarks>Note that the time zone ID will need to be set in the returned EXDATE property collection to
        /// make sure that it is consistent with the containing component.</remarks>
        public void GetValues(RRulePropertyCollection er, ExDatePropertyCollection ed)
        {
            er.Clear();
            ed.Clear();
            er.CloneRange(rRules);

            // Convert the RDates to ExDate format
            foreach (RDateProperty rdate in rDates)
            {
                ExDateProperty edate = new ExDateProperty();
                edate.ValueLocation    = rdate.ValueLocation;
                edate.TimeZoneId       = rdate.TimeZoneId;
                edate.TimeZoneDateTime = rdate.TimeZoneDateTime;
                ed.Add(edate);
            }
        }
Example #6
0
        /// <summary>
        /// Initialize the dialog controls using the specified exception rule and exception date collections
        /// </summary>
        /// <param name="er">The exception rules from which to get the settings</param>
        /// <param name="ed">The exception dates from which to get the settings</param>
        public void SetValues(RRulePropertyCollection er, ExDatePropertyCollection ed)
        {
            rRules.Clear();
            rDates.Clear();
            rRules.CloneRange(er);

            // Convert the exception dates to RDate format internally
            foreach (ExDateProperty edate in ed)
            {
                RDateProperty rd = new RDateProperty();
                rd.ValueLocation    = edate.ValueLocation;
                rd.TimeZoneId       = edate.TimeZoneId;
                rd.TimeZoneDateTime = edate.TimeZoneDateTime;
                rDates.Add(rd);
            }

            lbRRules.Items.Clear();

            foreach (RRuleProperty r in rRules)
            {
                lbRRules.Items.Add(r.Recurrence.ToString());
            }

            lbRDates.Items.Clear();

            foreach (RDateProperty rdt in rDates)
            {
                if (rdt.ValueLocation == ValLocValue.Date)
                {
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d"));
                }
                else
                {
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G"));
                }
            }

            this.SetButtonStates();
        }
Example #7
0
        /// <summary>
        /// The method can be called to clear all current property values from the observance.  The version and
        /// rule type are left unchanged.
        /// </summary>
        public override void ClearProperties()
        {
            startDate = null;
            offsetFrom = null;
            offsetTo = null;
            comment = null;

            rRules = null;
            rDates = null;
            tzNames = null;

            customProps = null;
        }
Example #8
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
		public RecurrenceControl()
		{
			InitializeComponent();

            // Set the short date/long time pattern based on the current culture
            dtpRDate.CustomFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + " " +
                CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern;
            dtpRDate.Value = DateTime.Today;

            rRules = new RRulePropertyCollection();
            rDates = new RDatePropertyCollection();
            this.SetButtonStates();
		}
Example #9
0
        /// <summary>
        /// Update the exception rule and exception date collections with the dialog control values
        /// </summary>
        /// <param name="er">The exception rules collection to update</param>
        /// <param name="ed">The exception dates collection to update</param>
        /// <remarks>Note that the time zone ID will need to be set in the returned EXDATE property collection to
        /// make sure that it is consistent with the containing component.</remarks>
        public void GetValues(RRulePropertyCollection er, ExDatePropertyCollection ed)
        {
            er.Clear();
            ed.Clear();
            er.CloneRange(rRules);

            // Convert the RDates to ExDate format
            foreach(RDateProperty rdate in rDates)
            {
                ExDateProperty edate = new ExDateProperty();
                edate.ValueLocation = rdate.ValueLocation;
                edate.TimeZoneId = rdate.TimeZoneId;
                edate.TimeZoneDateTime = rdate.TimeZoneDateTime;
                ed.Add(edate);
            }
        }
Example #10
0
 /// <summary>
 /// Update the recurrence rule and recurrence date collections with the dialog control values
 /// </summary>
 /// <param name="rr">The recurrence rules collection to update</param>
 /// <param name="rd">The recurrence dates collection to update</param>
 /// <remarks>Note that the time zone ID will need to be set in the returned RDATE property collection to
 /// make sure that it is consistent with the containing component.</remarks>
 public void GetValues(RRulePropertyCollection rr, RDatePropertyCollection rd)
 {
     rr.Clear();
     rd.Clear();
     rr.CloneRange(rRules);
     rd.CloneRange(rDates);
 }
Example #11
0
        /// <summary>
        /// Initialize the dialog controls using the specified exception rule and exception date collections
        /// </summary>
        /// <param name="er">The exception rules from which to get the settings</param>
        /// <param name="ed">The exception dates from which to get the settings</param>
        public void SetValues(RRulePropertyCollection er, ExDatePropertyCollection ed)
        {
            rRules.Clear();
            rDates.Clear();
            rRules.CloneRange(er);

            // Convert the exception dates to RDate format internally
            foreach(ExDateProperty edate in ed)
            {
                RDateProperty rd = new RDateProperty();
                rd.ValueLocation = edate.ValueLocation;
                rd.TimeZoneId = edate.TimeZoneId;
                rd.TimeZoneDateTime = edate.TimeZoneDateTime;
                rDates.Add(rd);
            }

            lbRRules.Items.Clear();

            foreach(RRuleProperty r in rRules)
                lbRRules.Items.Add(r.Recurrence.ToString());

            lbRDates.Items.Clear();

            foreach(RDateProperty rdt in rDates)
                if(rdt.ValueLocation == ValLocValue.Date)
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d"));
                else
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G"));

            this.SetButtonStates();
        }
Example #12
0
        /// <summary>
        /// Initialize the dialog controls using the specified recurrence rule and recurrence date collections
        /// </summary>
        /// <param name="rr">The recurrence rules from which to get the settings</param>
        /// <param name="rd">The recurrence dates from which to get the settings</param>
        public void SetValues(RRulePropertyCollection rr, RDatePropertyCollection rd)
        {
            rRules.Clear();
            rDates.Clear();
            rRules.CloneRange(rr);
            rDates.CloneRange(rd);

            lbRRules.Items.Clear();

            foreach(RRuleProperty r in rRules)
                lbRRules.Items.Add(r.Recurrence.ToString());

            // We won't handle period RDate values
            lbRDates.Items.Clear();

            foreach(RDateProperty rdt in rDates)
                if(rdt.ValueLocation == ValLocValue.Date)
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d"));
                else
                    lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G"));

            this.SetButtonStates();
        }