public virtual bool Open() { if (File.Exists(FileName)) { Configuration cfg = new Configuration(); Serialization srl = new Serialization(SerializeFormat); object arq = srl.Deserialize(FileName, this.GetType()); ObjectAttribute objThis = new ObjectAttribute(this); ObjectAttribute objArq = new ObjectAttribute(arq); ObjectAttribute objCfg = new ObjectAttribute(cfg); string[] Atr = objThis.GetAttributes(); for (int i = 0; i < Atr.Length; i++) { //if (!objCfg.AttibuteExists(Atr[i])) //{ objThis.SetAttibute(Atr[i], objArq.GetAttribute(Atr[i])); //} } return(true); } return(false); }
public void CopyTo(object Target) { ObjectAttribute ob_a = new ObjectAttribute(Target); string[] atrs = this.GetAttributes(); for (int i = 0; i < atrs.Length; i++) { object Value = this.GetAttribute(atrs[i]); ob_a.SetAttibute(atrs[i], Value); } }
public void AdjustTimeZone(object object_class) { lib.Class.ObjectAttribute obj = new ObjectAttribute(object_class); string[] atrbs = obj.GetAttributes(); for (int i = 0; i < atrbs.Length; i++) { object val = obj.GetAttribute(atrbs[i]); if (val is DateTime) { obj.SetAttibute(atrbs[i], Convert.ToDateTime(val).AddHours(lib.Class.Utils.TimeZone)); } } }