/// <summary>
        ///     Initializes a new instance of the <see cref="RecurringEvaluator" /> class.
        /// </summary>
        /// <param name="obj">The obj.</param>
        public RecurringEvaluator(IRecurrable obj)
        {
            Recurrable = obj;

            // We're not sure if the object is a calendar object
            // or a calendar data type, so we need to assign
            // the associated object manually
            var calendarObject = obj as ICalendarObject;

            if (calendarObject != null)
            {
// ReSharper disable DoNotCallOverridableMethodsInConstructor
                AssociatedObject = calendarObject;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
            }

// ReSharper disable SuspiciousTypeConversion.Global
            var calendarDataType = obj as ICalendarDataType;

// ReSharper restore SuspiciousTypeConversion.Global

            if (calendarDataType != null)
            {
                ICalendarDataType dt = calendarDataType;
// ReSharper disable DoNotCallOverridableMethodsInConstructor
                AssociatedObject = dt.AssociatedObject;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
            }
        }
示例#2
0
 /// <summary>
 /// Copies values from the target object to the
 /// current object.
 /// </summary>
 virtual public void CopyFrom(ICopyable obj)
 {
     if (obj is ICalendarDataType)
     {
         ICalendarDataType dt = (ICalendarDataType)obj;
         AssociatedObject = dt.AssociatedObject;
         _Parameters      = new AssociatedCalendarParameterList(dt.Parameters, _AssociatedObject, _AssociatedObject as ICalendarParameterListContainer);
     }
 }
示例#3
0
 /// <summary>
 /// Copies values from the target object to the
 /// current object.
 /// </summary>
 virtual public void CopyFrom(ICopyable obj)
 {
     if (obj is ICalendarDataType)
     {
         ICalendarDataType dt = (ICalendarDataType)obj;
         _AssociatedObject = dt.AssociatedObject;
         _Proxy.SetParent(_AssociatedObject);
         _Proxy.SetProxiedObject(dt.Parameters);
     }
 }
示例#4
0
        /// <summary>
        ///     Copies values from the target object to the
        ///     current object.
        /// </summary>
        /// <param name="obj"></param>
        public virtual void CopyFrom(ICopyable obj)
        {
            var calendarDataType = obj as ICalendarDataType;

            if (calendarDataType != null)
            {
                ICalendarDataType dt = calendarDataType;
                AssociatedObjectMember = dt.AssociatedObject;
                _proxy.SetParent(AssociatedObjectMember);
                _proxy.SetProxiedObject(dt.Parameters);
            }
        }
        public RecurringEvaluator(IRecurrable obj)
        {
            Recurrable = obj;

            // We're not sure if the object is a calendar object
            // or a calendar data type, so we need to assign
            // the associated object manually
            if (obj is ICalendarObject)
            {
                AssociatedObject = (ICalendarObject)obj;
            }
            if (obj is ICalendarDataType)
            {
                ICalendarDataType dt = (ICalendarDataType)obj;
                AssociatedObject = dt.AssociatedObject;
            }
        }
示例#6
0
        virtual protected ICalendarDataType CreateAndAssociate()
        {
            // Create an instance of the object
            ICalendarDataType dt = Activator.CreateInstance(TargetType) as ICalendarDataType;

            if (dt != null)
            {
                ICalendarObject associatedObject = SerializationContext.Peek() as ICalendarObject;
                if (associatedObject != null)
                {
                    dt.AssociatedObject = associatedObject;
                }

                return(dt);
            }
            return(null);
        }
示例#7
0
        public Evaluator(ICalendarDataType dataType)
        {
            m_AssociatedDataType = dataType;

            Initialize();
        }
示例#8
0
        public Evaluator(ICalendarDataType dataType)
        {
            m_AssociatedDataType = dataType;

            Initialize();
        }
示例#9
0
        protected Evaluator(ICalendarDataType dataType)
        {
            _mAssociatedDataType = dataType;

            Initialize();
        }