Пример #1
0
        internal static bool TestCase()
        {
            PublicInstanceField value = new PublicInstanceField {
                Public = 1, Private = 2, Protected = 3, Internal = 4, Property = 5
            };

            string xml = AutoCSer.XmlSerializer.Serialize(value);
            PublicInstanceField newValue = AutoCSer.XmlDeSerializer.DeSerialize <PublicInstanceField>(xml);

            return(newValue != null && newValue.Public == 1 && newValue.Private == 0 && newValue.Protected == 0 && newValue.Internal == 0 && newValue.Property == 0);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine(@"http://www.AutoCSer.com/Serialize/Xml.html
");
            Console.WriteLine(PublicInstanceField.TestCase());
            Console.WriteLine(AnonymousType.TestCase());
            Console.WriteLine(MemberMap.TestCase());
            Console.WriteLine(MemberMapValue.TestCase());
            Console.WriteLine(IgnoreMember.TestCase());
            Console.WriteLine(BaseType.TestCase());
            Console.WriteLine(CustomClass.TestCase());
            Console.WriteLine(CustomStruct.TestCase());
            Console.WriteLine(NoConstructor.TestCase());
            Console.WriteLine("Over");
            Console.ReadKey();
        }