예제 #1
0
 static void Main(string[] args)
 {
     ClassSample c = new ClassSample();
     foreach(string s in c) {
         Console.WriteLine(s);
     }
 }
예제 #2
0
        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");
        }
예제 #3
0
 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();
 }
예제 #4
0
 static void Main(string[] args)
 {
     ClassSample cs = new ClassSample();
     cs.x = 4;
     Console.WriteLine(cs);
 }