using System; using System.ComponentModel; namespace SysBaseLibs { /// /// rsIdName 包含 ID和name 的对象 /// songyf 200606 v1.0.0 /// public class rsIdName:INpId { // Methods public rsIdName(string pcID, string pcName) { this._ID = pcID; this._Name = pcName; } public override bool Equals(object poSource) { bool flag1 = false; if (poSource is rsIdName) { return (UtilStr.UAndT(((rsIdName) poSource).Id) == UtilStr.UAndT(this.Id)); } if (poSource is string) { flag1 = UtilStr.UAndT(poSource.ToString()) == UtilStr.UAndT(this.Id); } return flag1; } public static rsIdName FromFullString(string pcString) { rsIdName name1 = new rsIdName("", ""); Array array1 = UtilStr.StrToArrayEx(pcString, ":"); if (array1.Length > 0) { name1.Id = array1.GetValue(0).ToString(); } if (array1.Length > 1) { name1.Name = array1.GetValue(1).ToString(); } return name1; } public override int GetHashCode() { return this.Id.GetHashCode(); } public override string ToString() { return this._Name; } // Properties [Browsable(false)] public string FullString { get { return (this.Id + ":" + this.Name); } } [Browsable(false)] public string Id { get { return this._ID; } set { this._ID = value; } } [Browsable(false)] public string Name { get { return this._Name; } set { this._Name = value; } } // Fields private string _ID; private string _Name; } }