/// <summary> /// Returns the description for the specified property. /// </summary> public static TsDaPropertyDescription Find(TsDaPropertyID id) { FieldInfo[] fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public); foreach (FieldInfo field in fields) { TsDaPropertyDescription property = (TsDaPropertyDescription)field.GetValue(typeof(TsDaPropertyDescription)); if (property.ID == id) { return(property); } } return(null); }
/////////////////////////////////////////////////////////////////////// #region Object Member Overrides /// <summary> /// Returns true if the target object is equal to the object. /// </summary> public override bool Equals(object target) { if (target != null && target.GetType() == typeof(TsDaPropertyID)) { TsDaPropertyID propertyID = (TsDaPropertyID)target; // compare by integer if both specify valid integers. if (propertyID.Code != 0 && Code != 0) { return(propertyID.Code == Code); } // compare by name if both specify valid names. if (propertyID.Name != null && Name != null) { return(propertyID.Name == Name); } } return(false); }
/// <summary> /// Initializes the object with the specified values. /// </summary> public TsDaPropertyDescription(TsDaPropertyID id, Type type, string name) { ID = id; Type = type; Name = name; }