static void Main(string[] args) { ClassSample c = new ClassSample(); foreach(string s in c) { Console.WriteLine(s); } }
public void TestMethod1() { var cls = new ClassSample(); var target = typeof(ClassSample).GetMethod(nameof(ClassSample.GetMethod5)); var injection = ((Func <string>)GetMethod5_ClassSample).Method; cls.GetMethod5().Is("ClassSample.GetMethod5"); using (Injection.Set(target, injection)) { cls.GetMethod5().Is("Injection.GetMethod5"); } cls.GetMethod5().Is("ClassSample.GetMethod5"); }
static void Main(string[] args) { TypesSample.Demo(); TypeCastingSample.Demo(); ReferenceParametersSample.Demo(); ClassSample.Demo(); StaticClassSample.Demo(); ArgumentsSample.Demo(); SimpleInheritance.Demo(); InheritanceSample.Demo(); SealedSample.Demo(); AbstractSample.Demo(); InterfaceInheritanceSample.Demo(); InterfaceInheritanceDISample.Demo(); ListSample.Demo(); DictionarySample.Demo(); }
static void Main(string[] args) { ClassSample cs = new ClassSample(); cs.x = 4; Console.WriteLine(cs); }