Ejemplo n.º 1
0
 public override iCalObject Copy(iCalObject parent)
 {
     Parameter p = (Parameter)base.Copy(parent);
     foreach (string s in Values)
         p.Values.Add(s);
     return p;
 }
Ejemplo n.º 2
0
 public override iCalObject Copy(iCalObject parent)
 {
     Property p = (Property)base.Copy(parent);
     p.Name = Name;
     p.Value = Value;
     return p;
 }
Ejemplo n.º 3
0
 public override void RemoveChild(iCalObject child)
 {
     if (child is Alarm)
     {
         Alarms.Remove((Alarm)child);
     }
     base.RemoveChild(child);
 }
Ejemplo n.º 4
0
 public override void AddChild(iCalObject child)
 {
     if (child is Alarm)
     {
         Alarms.Add((Alarm)child);
     }
     base.AddChild(child);
 }
Ejemplo n.º 5
0
        public override iCalObject Copy(iCalObject parent)
        {
            Parameter p = (Parameter)base.Copy(parent);

            foreach (string s in Values)
            {
                p.Values.Add(s);
            }
            return(p);
        }
Ejemplo n.º 6
0
 public iCalObject(iCalObject parent)
 {
     this.Parent = parent;
     if (parent != null)
     {
         if (!(this is Property) &&
             !(this is Parameter))
             parent.AddChild(this);
     }
 }
Ejemplo n.º 7
0
 public iCalObject(iCalObject parent)
 {
     Parent = parent;
     if (parent != null)
     {
         if (!(this is Property) &&
             !(this is Parameter))
         {
             parent.AddChild(this);
         }
     }
 }
Ejemplo n.º 8
0
 static public ComponentBase Create(iCalObject parent, string name)
 {            
     switch (name)
     {
         case "VEVENT":
             // For event objects, use our custom event class
             return new CustomEvent(parent);                    
         default:
             // Otherwise, use the default classes
             return ComponentBase.Create(parent, name);
     }
 }
Ejemplo n.º 9
0
        static public ComponentBase Create(iCalObject parent, string name)
        {
            switch (name.ToUpper())
            {
            case "VALARM": return(new Alarm(parent)); break;

            case "VEVENT": return(new Event(parent)); break;

            case "VFREEBUSY": return(new FreeBusy(parent)); break;

            case "VJOURNAL": return(new Journal(parent)); break;

            case "VTIMEZONE": return(new DDay.iCal.Components.TimeZone(parent)); break;

            case "VTODO": return(new Todo(parent)); break;

            default: return(new ComponentBase(parent, name)); break;
            }
        }
Ejemplo n.º 10
0
 public Parameter(iCalObject parent) : base(parent)
 {
 }
Ejemplo n.º 11
0
 public Property(iCalObject parent, string name, string value) : this(parent, name)
 {
     Value = value;
 }
Ejemplo n.º 12
0
 public iCalObjectSerializer(DDay.iCal.Objects.iCalObject iCalObject)
 {
     this.m_object = iCalObject;
 }
Ejemplo n.º 13
0
 public Parameter(iCalObject parent) : base(parent) { }
Ejemplo n.º 14
0
 public Property(iCalObject parent, string name, string value) : this(parent, name)
 {
     Value = value;            
 }
Ejemplo n.º 15
0
 public RecurringComponent(iCalObject parent) : base(parent)
 {
     Initialize();
 }
Ejemplo n.º 16
0
 public ContentLine(iCalObject parent) : base(parent) { }
Ejemplo n.º 17
0
 public override iCalObject Copy(iCalObject parent)
 {
     iCalDataType icdt = (iCalDataType)Activator.CreateInstance(GetType());
     icdt.CopyFrom(this);
     icdt.Parent = parent;
     return icdt;            
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Adds an <see cref="iCalObject"/>-based object as a child
 /// of the current object.
 /// </summary>
 /// <param name="child">The <see cref="iCalObject"/>-based object to add.</param>
 virtual public void AddChild(iCalObject child)
 {
     Children.Add(child);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Removed an <see cref="iCalObject"/>-based object from the <see cref="Children"/>
 /// collection.
 /// </summary>
 /// <param name="child"></param>
 virtual public void RemoveChild(iCalObject child)
 {
     if (Children.Contains(child))
         Children.Remove(child);
 }
Ejemplo n.º 20
0
 public UniqueComponent(iCalObject parent) : base(parent)
 {
 }
Ejemplo n.º 21
0
 public RecurringComponent(iCalObject parent, string name) : base(parent, name)
 {
     DateTimes = new ArrayList();
     Alarms    = new List <Alarm>();
 }
Ejemplo n.º 22
0
 public RecurringComponent(iCalObject parent, string name) : base(parent, name)
 {
     Periods = new List <Period>();
     Alarms  = new List <Alarm>();
 }
Ejemplo n.º 23
0
 public CustomComponentBase(iCalObject parent) : base(parent) { }
Ejemplo n.º 24
0
 public Parameter(iCalObject parent, string name) : base(parent, name)
 {
     AddToParent();
 }
Ejemplo n.º 25
0
 public iCalObject(iCalObject parent, string name)
     : this(parent)
 {
     Name = name;
 }
Ejemplo n.º 26
0
 public RecurringComponent(iCalObject parent) : base(parent)
 {
     DateTimes = new ArrayList();
 }
Ejemplo n.º 27
0
 public ComponentBase(iCalObject parent, string name) : base(parent, name)
 {
 }
Ejemplo n.º 28
0
 public RecurringComponent(iCalObject parent, string name) : base(parent, name)
 {
     Initialize();
 }
Ejemplo n.º 29
0
 public iCalObjectSerializer(DDay.iCal.Objects.iCalObject iCalObject)
 {
     this.m_object = iCalObject;
 }
Ejemplo n.º 30
0
        virtual public iCalObject Copy(iCalObject parent)
        {
            iCalObject obj = null;
            Type type = GetType();
            ConstructorInfo[] constructors = type.GetConstructors();
            foreach (ConstructorInfo ci in constructors)
            {
                // Try to find a constructor with the following signature:
                // .ctor(iCalObject parent, string name)
                ParameterInfo[] parms = ci.GetParameters();
                if (parms.Length == 2 &&
                    parms[0].ParameterType == typeof(iCalObject) &&
                    parms[1].ParameterType == typeof(string))
                {                    
                    obj = (iCalObject)Activator.CreateInstance(type, parent, Name);
                }
            }
            if (obj == null)
            {
                foreach (ConstructorInfo ci in constructors)
                {
                    // Try to find a constructor with the following signature:
                    // .ctor(iCalObject parent)
                    ParameterInfo[] parms = ci.GetParameters();
                    if (parms.Length == 1 &&
                        parms[0].ParameterType == typeof(iCalObject))
                    {
                        obj = (iCalObject)Activator.CreateInstance(type, parent);
                    }
                }
            }
            // No complex constructor was found, use the default constructor!
            if (obj == null)
                obj = (iCalObject)Activator.CreateInstance(type);

            // Add properties
            foreach (DictionaryEntry de in Properties)
                ((Property)(de.Value)).Copy(obj);

            // Add parameters
            foreach (DictionaryEntry de in Parameters)
                ((Parameter)(de.Value)).Copy(obj);

            // Add each child
            foreach (iCalObject child in Children)
                child.Copy(obj);

            //
            // Get a list of serialized items,
            // iterate through each, make a copy
            // of each item, and assign it to our
            // copied object.
            //
            List<object> items = SerializedItems;
            foreach (object item in items)
            {
                FieldInfo field = null;
                PropertyInfo prop = null;

                if (item is FieldInfo)
                    field = (FieldInfo)item;
                else
                    prop = (PropertyInfo)item;

                // Get the item's value
                object itemValue = (field == null) ? prop.GetValue(this, null) : field.GetValue(this);

                // Make a copy of the item, if it's copyable.
                if (itemValue is iCalObject)
                    itemValue = ((iCalObject)itemValue).Copy(obj);
                else { } // FIXME: make an exact copy, if possible.

                // Set the item's value in our copied object
                if (field == null)
                    prop.SetValue(obj, itemValue, null);
                else field.SetValue(obj, itemValue);
            }

            return obj;
        }
Ejemplo n.º 31
0
 public Property(iCalObject parent, string name, string value) : base(parent, name)
 {
     Value = value;
     AddToParent();
 }
Ejemplo n.º 32
0
 public UniqueComponent(iCalObject parent, string name) : base(parent, name)
 {
 }
Ejemplo n.º 33
0
 public Property(iCalObject parent) : base(parent) { }
Ejemplo n.º 34
0
 public iCalObject(iCalObject parent, string name)
     : this(parent)
 {
     Name = name;
 }
Ejemplo n.º 35
0
 public Property(iCalObject parent, string name, string value) : base(parent, name)
 {
     Value = value;
     AddToParent();
 }
Ejemplo n.º 36
0
        virtual public iCalObject Copy(iCalObject parent)
        {
            iCalObject obj  = null;
            Type       type = GetType();

            ConstructorInfo[] constructors = type.GetConstructors();
            foreach (ConstructorInfo ci in constructors)
            {
                // Try to find a constructor with the following signature:
                // .ctor(iCalObject parent, string name)
                ParameterInfo[] parms = ci.GetParameters();
                if (parms.Length == 2 &&
                    parms[0].ParameterType == typeof(iCalObject) &&
                    parms[1].ParameterType == typeof(string))
                {
                    obj = (iCalObject)Activator.CreateInstance(type, parent, Name);
                }
            }
            if (obj == null)
            {
                foreach (ConstructorInfo ci in constructors)
                {
                    // Try to find a constructor with the following signature:
                    // .ctor(iCalObject parent)
                    ParameterInfo[] parms = ci.GetParameters();
                    if (parms.Length == 1 &&
                        parms[0].ParameterType == typeof(iCalObject))
                    {
                        obj = (iCalObject)Activator.CreateInstance(type, parent);
                    }
                }
            }
            // No complex constructor was found, use the default constructor!
            if (obj == null)
            {
                obj = (iCalObject)Activator.CreateInstance(type);
            }

            // Add properties
            foreach (DictionaryEntry de in Properties)
            {
                ((Property)(de.Value)).Copy(obj);
            }

            // Add parameters
            foreach (DictionaryEntry de in Parameters)
            {
                ((Parameter)(de.Value)).Copy(obj);
            }

            // Add each child
            foreach (iCalObject child in Children)
            {
                child.Copy(obj);
            }

            //
            // Get a list of serialized items,
            // iterate through each, make a copy
            // of each item, and assign it to our
            // copied object.
            //
            List <object> items = SerializedItems;

            foreach (object item in items)
            {
                FieldInfo    field = null;
                PropertyInfo prop  = null;

                if (item is FieldInfo)
                {
                    field = (FieldInfo)item;
                }
                else
                {
                    prop = (PropertyInfo)item;
                }

                // Get the item's value
                object itemValue = (field == null) ? prop.GetValue(this, null) : field.GetValue(this);

                // Make a copy of the item, if it's copyable.
                if (itemValue is iCalObject)
                {
                    itemValue = ((iCalObject)itemValue).Copy(obj);
                }
                else
                {
                }        // FIXME: make an exact copy, if possible.

                // Set the item's value in our copied object
                if (field == null)
                {
                    prop.SetValue(obj, itemValue, null);
                }
                else
                {
                    field.SetValue(obj, itemValue);
                }
            }

            return(obj);
        }
Ejemplo n.º 37
0
 public ContentLine(iCalObject parent) : base(parent)
 {
 }
Ejemplo n.º 38
0
 virtual public void AddChild(iCalObject child)
 {
     Children.Add(child);
 }
Ejemplo n.º 39
0
 public Property(iCalObject parent) : base(parent)
 {
 }
Ejemplo n.º 40
0
 public ComponentBase(iCalObject parent) : base(parent)
 {
 }
Ejemplo n.º 41
0
 public Property(iCalObject parent, string name) : base(parent, name)
 {
     AddToParent();
 }
Ejemplo n.º 42
0
 public Parameter(iCalObject parent, string name) : base(parent, name)
 {
     AddToParent();
 }
Ejemplo n.º 43
0
 public Property(iCalObject parent, string name) : base(parent, name)
 {
     AddToParent();
 }