예제 #1
0
        //=====================================================================

        /// <summary>
        /// Add an <see cref="ObservanceRule"/> of the specified type to the collection
        /// </summary>
        /// <param name="ruleType">The type of observance rule to add</param>
        /// <returns>Returns the new rule that was created and added to the collection</returns>
        public ObservanceRule Add(ObservanceRuleType ruleType)
        {
            ObservanceRule rule = new ObservanceRule(ruleType);

            base.Add(rule);

            return(rule);
        }
예제 #2
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            ObservanceRule o = (ObservanceRule)p;

            this.ClearProperties();

            ruleType   = o.RuleType;
            startDate  = (StartDateProperty)o.StartDateTime.Clone();
            offsetFrom = (TimeZoneOffsetProperty)o.OffsetFrom.Clone();
            offsetTo   = (TimeZoneOffsetProperty)o.OffsetTo.Clone();
            comment    = (CommentProperty)o.Comment.Clone();

            this.RecurrenceRules.CloneRange(o.RecurrenceRules);
            this.RecurDates.CloneRange(o.RecurDates);
            this.TimeZoneNames.CloneRange(o.TimeZoneNames);
            this.CustomProperties.CloneRange(o.CustomProperties);
        }
예제 #3
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            ObservanceRule o = (ObservanceRule)p;

            this.ClearProperties();

            ruleType = o.RuleType;
            startDate = (StartDateProperty)o.StartDateTime.Clone();
            offsetFrom = (TimeZoneOffsetProperty)o.OffsetFrom.Clone();
            offsetTo = (TimeZoneOffsetProperty)o.OffsetTo.Clone();
            comment = (CommentProperty)o.Comment.Clone();

            this.RecurrenceRules.CloneRange(o.RecurrenceRules);
            this.RecurDates.CloneRange(o.RecurDates);
            this.TimeZoneNames.CloneRange(o.TimeZoneNames);
            this.CustomProperties.CloneRange(o.CustomProperties);
        }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="type">The type of rule that this represents</param>
 public ObservanceRule(ObservanceRuleType type)
 {
     this.Version = SpecificationVersions.iCalendar20;
     ruleType = type;
 }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="type">The type of rule that this represents</param>
 public ObservanceRule(ObservanceRuleType type)
 {
     this.Version = SpecificationVersions.iCalendar20;
     ruleType     = type;
 }