Exemplo n.º 1
0
        public void TestStructWithClassCloning()
        {
            var obj = new TestNestedStruct_IS_CLASS
            {
                StructProp = new TestNestedClass_IS_STRUCT
                {
                    ClassProp = new TestNestedStruct_IS_CLASS
                    {
                        StructProp = new TestNestedClass_IS_STRUCT()
                    }
                }
            };

            var cloner = new IlCloner();

            var clonerStruct = cloner.CreateClonerDelegate(obj.StructProp);
            var clonedStruct = clonerStruct(obj.StructProp);
        }
Exemplo n.º 2
0
        public void TestClassWithStructCloning()
        {
            var obj = new TestNestedStruct_IS_CLASS
            {
                StructProp = new TestNestedClass_IS_STRUCT
                {
                    ClassProp = new TestNestedStruct_IS_CLASS
                    {
                        StructProp = new TestNestedClass_IS_STRUCT()
                    }
                }
            };

            var cloner = new IlCloner();

            var clonerClass = cloner.CreateClonerDelegate(obj);
            var clonedClass = clonerClass(obj);
        }