Exemplo n.º 1
0
        static void Main(string[] args)
        {
            teste intern = new testeserialization.teste()
            {
                fieldString = "testestring",
                propertyInt = 12
            };

            teste teste = new testeserialization.teste()
            {
                fieldString = "internal",
                propertyInt = 13,
                teste2      = intern
            };

            testeenum testeenum = new testeserialization.testeenum()
            {
                enumteste = enumteste.opt2
            };

            //SerializatorMachine.Serialize(intern, "teste.xml");
            SerializatorMachine SerializatorMachine = new SerializatorMachine();

            SerializatorMachine.Serialize(testeenum, "teste.xml", Encoding.Default);
            object ob = SerializatorMachine.Desserialize <testeenum>("teste.xml");

            tests t = new tests();

            t.teste1();
            t.teste2();
            t.teste3();
            t.teste4();
            t.teste5();
            t.teste6();
            t.teste7();
            t.teste8();
            t.teste9();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            teste intern = new testeserialization.teste()
            {
                fieldString = "testestring",
                propertyInt = 12
            };

            teste teste = new testeserialization.teste()
            {
                fieldString = "internal",
                propertyInt = 13,
                teste2 = intern
            };

            testeenum testeenum = new testeserialization.testeenum()
            {
                enumteste = enumteste.opt2
            };

            //SerializatorMachine.Serialize(intern, "teste.xml");
            SerializatorMachine SerializatorMachine = new SerializatorMachine();
            SerializatorMachine.Serialize(testeenum, "teste.xml", Encoding.Default);
            object ob = SerializatorMachine.Desserialize<testeenum>("teste.xml");

            tests t = new tests();
            t.teste1();
            t.teste2();
            t.teste3();
            t.teste4();
            t.teste5();
            t.teste6();
            t.teste7();
            t.teste8();
            t.teste9();

        }