public static void InsertINFO() { ISqlMapper mapper = EntityMapper; MyClass2 testVo = new MyClass2() { C_NAME = "JAMES", C_AGE = "100", C_PHONE = "010-0987-0123", C_SOCIAL_NUMBER = "001231-4567894" }; mapper.Insert("InsertINFO", testVo); }
static void Main(string[] args) { MyClass1 publisher = new MyClass1(); MyClass2 observingClass = new MyClass2(); Observer observer = new MyClass2.HandlerForMyClass1ClickEvent(); publisher.Click.addObserver(observer); publisher.Click.raiseEvent(publisher, new object[] { 1, 2, "sdf" }); }
public static void SelectINFO() { ISqlMapper mapper = EntityMapper; MyClass2 testVo = new MyClass2(); IList <MyClass2> resultList = mapper.QueryForList <MyClass2>("SelectINFO", testVo); for (int x = 0; x < resultList.Count; x++) { Console.WriteLine(resultList[x].C_NAME + resultList[x].C_AGE + resultList[x].C_PHONE + resultList[x].C_SOCIAL_NUMBER); } }
public object clone() { MyClass2 clon = new MyClass2(); clon.i = this.i; clon.str = this.str; //clon.id = this.id; // passive clonning clon.id = clon.GetHashCode(); // smart clonning return clon; #region another way MyClass2 clon2 = (MyClass2)this.MemberwiseClone(); clon2.id = clon2.GetHashCode(); return clon2; //or //return this.MemberwiseClone(); #endregion }
static void Main(string[] args) { MyInterface i = new MyClass2(); i.DoStuff(); }
public MyClass2Proxy() { parent = new MyClass2(); }
public MyClass2Proxy(MyClass2 myClass2) { parent = myClass2; }
static void Main(string[] args) { MyClass m1 = new MyClass(); MyClass2 m2 = new MyClass2(); MyClass3 m3 = new MyClass3(); Console.WriteLine(m1.GetHashCode() + " " + m1.id); Console.WriteLine(m2.GetHashCode() + " " + m2.id); Console.WriteLine(m3.GetHashCode() + " " + m3.id); Console.WriteLine("-----------------------"); m1 = (MyClass)m1.clone(); m2 = (MyClass2)m2.clone(); m3 = (MyClass3)m3.Clone(); Console.WriteLine("-----------------------"); Console.WriteLine(m1.GetHashCode() + " " + m1.id); Console.WriteLine(m2.GetHashCode() + " " + m2.id); Console.WriteLine(m3.GetHashCode() + " " + m3.id); }