Removing Input tab as we don't need to specific features anymore.
2 using System.Collections.Generic;
5 using System.Threading.Tasks;
9 using System.Collections.Generic;
10 using System.Runtime.Serialization;
11 using System.ComponentModel;
13 namespace SharpLib.Ear
17 /// EAR object provides serialization support.
18 /// It assumes most derived class is decorated with AttributeObject.
21 [KnownType("DerivedTypes")]
22 public abstract class Object: IComparable, INotifyPropertyChanged
24 private bool iConstructed = false;
32 /// Needed as our constructor is not called following internalization.
34 public void Construct()
46 protected virtual void DoConstruct()
52 /// Static object name.
56 //Get the name of this object attribute
57 get { return Utils.Reflection.GetAttribute<AttributeObject>(GetType()).Name; }
62 /// Static object description.
64 public string Description
66 //Get the description of this object attribute
67 get { return Utils.Reflection.GetAttribute<AttributeObject>(GetType()).Description; }
72 /// Dynamic object description.
74 /// <returns></returns>
75 public virtual string Brief()
81 /// Needed to make sure our sorting makes sense
83 /// <param name="obj"></param>
84 /// <returns></returns>
85 public int CompareTo(object obj)
88 return Utils.Reflection.GetAttribute<AttributeObject>(GetType()).Name.CompareTo(obj.GetType());
92 /// Tells whether the current object configuration is valid.
94 /// <returns></returns>
95 public virtual bool IsValid()
101 /// So that data contract knows all our types.
103 /// <returns></returns>
104 private static IEnumerable<Type> DerivedTypes()
106 return SharpLib.Utils.Reflection.GetDerivedTypes<Object>();
112 public event PropertyChangedEventHandler PropertyChanged;
115 /// Invoke our event.
117 /// <param name="name"></param>
118 protected void OnPropertyChanged(string name)
120 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));