public override iCalObject Copy(iCalObject parent) { Parameter p = (Parameter)base.Copy(parent); foreach (string s in Values) p.Values.Add(s); return p; }
public override iCalObject Copy(iCalObject parent) { Property p = (Property)base.Copy(parent); p.Name = Name; p.Value = Value; return p; }
public override void RemoveChild(iCalObject child) { if (child is Alarm) { Alarms.Remove((Alarm)child); } base.RemoveChild(child); }
public override void AddChild(iCalObject child) { if (child is Alarm) { Alarms.Add((Alarm)child); } base.AddChild(child); }
public override iCalObject Copy(iCalObject parent) { Parameter p = (Parameter)base.Copy(parent); foreach (string s in Values) { p.Values.Add(s); } return(p); }
public iCalObject(iCalObject parent) { this.Parent = parent; if (parent != null) { if (!(this is Property) && !(this is Parameter)) parent.AddChild(this); } }
public iCalObject(iCalObject parent) { Parent = parent; if (parent != null) { if (!(this is Property) && !(this is Parameter)) { parent.AddChild(this); } } }
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); } }
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; } }
public Parameter(iCalObject parent) : base(parent) { }
public Property(iCalObject parent, string name, string value) : this(parent, name) { Value = value; }
public iCalObjectSerializer(DDay.iCal.Objects.iCalObject iCalObject) { this.m_object = iCalObject; }
public RecurringComponent(iCalObject parent) : base(parent) { Initialize(); }
public ContentLine(iCalObject parent) : base(parent) { }
public override iCalObject Copy(iCalObject parent) { iCalDataType icdt = (iCalDataType)Activator.CreateInstance(GetType()); icdt.CopyFrom(this); icdt.Parent = parent; return icdt; }
/// <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); }
/// <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); }
public UniqueComponent(iCalObject parent) : base(parent) { }
public RecurringComponent(iCalObject parent, string name) : base(parent, name) { DateTimes = new ArrayList(); Alarms = new List <Alarm>(); }
public RecurringComponent(iCalObject parent, string name) : base(parent, name) { Periods = new List <Period>(); Alarms = new List <Alarm>(); }
public CustomComponentBase(iCalObject parent) : base(parent) { }
public Parameter(iCalObject parent, string name) : base(parent, name) { AddToParent(); }
public iCalObject(iCalObject parent, string name) : this(parent) { Name = name; }
public RecurringComponent(iCalObject parent) : base(parent) { DateTimes = new ArrayList(); }
public ComponentBase(iCalObject parent, string name) : base(parent, name) { }
public RecurringComponent(iCalObject parent, string name) : base(parent, name) { Initialize(); }
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; }
public Property(iCalObject parent, string name, string value) : base(parent, name) { Value = value; AddToParent(); }
public UniqueComponent(iCalObject parent, string name) : base(parent, name) { }
public Property(iCalObject parent) : base(parent) { }
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); }
virtual public void AddChild(iCalObject child) { Children.Add(child); }
public ComponentBase(iCalObject parent) : base(parent) { }
public Property(iCalObject parent, string name) : base(parent, name) { AddToParent(); }