コード例 #1
0
        public void TestEvaluation()
        {
            int     n     = 32;
            decimal dec   = 123.456m;
            var     alist = new ArrayList();

            alist.Add(1);
            alist.Add("two");
            alist.Add(3);

            A c = new C();
            A b = new B();
            A a = new A();

            var withDisplayString = new WithDisplayString();
            var withProxy         = new WithProxy();
            var withToString      = new WithToString();

            var numbersArrays = new int [2][];
            var numbersMulti  = new int [3, 4, 5];

            var dict      = new Dictionary <int, string[]> ();
            var dictArray = new Dictionary <int, string[]> [2, 3];
            var thing     = new Thing <string> ();
            var done      = new Thing <string> .Done <int> ();

            Console.WriteLine(n);              /*break*/
        }
コード例 #2
0
        public static int TestMeaning()
        {
            var a = new WithDisplayString();
            var c = new DebuggerDisplayMethodTest();

            Console.WriteLine(a);
            Console.WriteLine(c);
            return(42);
        }
コード例 #3
0
        public void Test(string stringParam, int intParam = 22, int intParam2 = 66)
        {
            int     intZero = 0, intOne = 1;
            int     n          = 32;
            decimal dec        = 123.456m;
            var     stringList = new List <string> ();

            stringList.Add("aaa");
            stringList.Add("bbb");
            stringList.Add("ccc");

            var alist = new ArrayList();

            alist.Add(1);
            alist.Add("two");
            alist.Add(3);
            string modifyInLamda = "";

            var debugDisplayMethodTest = new DebuggerDisplayMethodTest();

            A c = new C();
            A b = new B();
            A a = new A();

            var withDisplayString = new WithDisplayString();
            var withProxy         = new WithProxy();
            var withToString      = new WithToString();

            var numbersArrays = new int [2][];
            var numbersMulti  = new int [3, 4, 5];

            var ops1 = new BinaryOperatorOverrides(1);
            var ops2 = new BinaryOperatorOverrides(2);
            var ops3 = new BinaryOperatorOverrides(2);

            var dict = new Dictionary <int, string[]> ();

            dict.Add(5, new string[] { "a", "b" });
            var dictArray = new Dictionary <int, string[]> [2, 3];
            var thing     = new Thing <string> ();
            var done      = new Thing <string> .Done <int> ();

            done.Property = 54;

            SimpleStruct simpleStruct = new SimpleStruct();

            simpleStruct.IntField    = 45;
            simpleStruct.StringField = "str";
            SimpleStruct?nulledSimpleStruct;
            var          action = new Action(() => {
                modifyInLamda = "modified";
            });

            action();

            dynamic dynObj = new ExpandoObject();

            dynObj.someInt    = 53;
            dynObj.someString = "Hello dynamic objects!";

            var objWithMethodA = new ClassWithMethodA();

            bool?nullableBool = null;

            nullableBool = true;

            var richObject = new RichClass();

            byte[] nulledByteArray = null;

            Console.WriteLine(n);              /*break*/
        }
コード例 #4
0
        public void Test(string stringParam, int intParam = 22, int intParam2 = 66)
        {
            int     intZero = 0, intOne = 1;
            int     n          = 32;
            decimal dec        = 123.456m;
            var     stringList = new List <string> ();

            stringList.Add("aaa");
            stringList.Add("bbb");
            stringList.Add("ccc");

            var alist = new ArrayList();

            alist.Add(1);
            alist.Add("two");
            alist.Add(3);
            string modifyInLamda = "";

            var debugDisplayMethodTest = new DebuggerDisplayMethodTest();

            A c = new C();
            A b = new B();
            A a = new A();

            var withDisplayString = new WithDisplayString();
            var withProxy         = new WithProxy();
            var withToString      = new WithToString();

            var numbersArrays = new int [2][];

            numbersArrays [0]     = new int [10];
            numbersArrays [0] [7] = 24;
            var numbersMulti = new int [3, 4, 5];

            var ops1 = new BinaryOperatorOverrides(1);
            var ops2 = new BinaryOperatorOverrides(2);
            var ops3 = new BinaryOperatorOverrides(2);

            var dict = new Dictionary <int, string[]> ();

            dict.Add(5, new string[] { "a", "b" });
            var dictArray = new Dictionary <int, string[]> [2, 3];
            var thing     = new Thing <string> ();
            var done      = new Thing <string> .Done <int> ();

            done.Property = 54;

            SimpleStruct simpleStruct = new SimpleStruct();

            simpleStruct.IntField    = 45;
            simpleStruct.StringField = "str";
            SimpleStruct?nulledSimpleStruct;
            var          action = new Action(() => {
                modifyInLamda = "modified";
            });

            action();

            dynamic dynObj = new ExpandoObject();

            dynObj.someInt    = 53;
            dynObj.someString = "Hello dynamic objects!";

            var objWithMethodA = new ClassWithMethodA();

            bool?nullableBool = null;

            nullableBool = true;

            var richObject = new RichClass();

            byte[] nulledByteArray = null;

            var arrayWithLowerBounds = Array.CreateInstance(typeof(int), new int[] { 3, 4, 5 }, new int[] { 5, 4, 3 });
            int m = 100;

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    for (int k = 0; k < 5; k++)
                    {
                        numbersMulti.SetValue(m, i, j, k);
                        arrayWithLowerBounds.SetValue(m++, i + 5, j + 4, k + 3);
                    }
                }
            }

            var testEvaluationChild = new TestEvaluationChild();

            Console.WriteLine(n);              /*break*/
        }