CreateSerializer() публичный статический Метод

public static CreateSerializer ( ) : NetSerializer.Serializer
Результат NetSerializer.Serializer
Пример #1
0
        static void Main(string[] args)
        {
            if (ParseArgs(args) == false)
            {
                return;
            }

            if (ShareSerializer)
            {
                s_sharedSerializer = Tester.CreateSerializer();
            }

            List <Thread> threads = new List <Thread>();

            for (int i = 0; i < NumThreads; ++i)
            {
                var thread = new Thread(Test);
                threads.Add(thread);
            }

            foreach (var thread in threads)
            {
                thread.Start();
            }

            foreach (var thread in threads)
            {
                thread.Join();
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            bool show_help = false;

            var p = new Mono.Options.OptionSet()
            {
                { "q|quick", "quick run", _ => QuickRun = true },
                { "p|protobuf", "run protobuf tests", _ => RunProtoBufTests = true },
                { "v|verify", "verify results", _ => EnableResultCheck = true },
                { "threads=", "number of threads", (int v) => NumThreads = v },
                { "share", "share serializer between threads", _ => ShareSerializer = true },
                { "h|help", "show help", _ => show_help = true },
            };

            List <string> extra;

            try
            {
                extra = p.Parse(args);
            }
            catch (Mono.Options.OptionException e)
            {
                Console.WriteLine(e.Message);
                return;
            }

            if (show_help || extra.Count > 0)
            {
                p.WriteOptionDescriptions(Console.Out);
                return;
            }

            if (ShareSerializer)
            {
                s_sharedSerializer = Tester.CreateSerializer();
            }

            List <Thread> threads = new List <Thread>();

            for (int i = 0; i < NumThreads; ++i)
            {
                var thread = new Thread(Test);
                threads.Add(thread);
            }

            foreach (var thread in threads)
            {
                thread.Start();
            }

            foreach (var thread in threads)
            {
                thread.Join();
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            if (ParseArgs(args) == false)
            {
                return;
            }

            if (ShareSerializer)
            {
                s_sharedSerializer = Tester.CreateSerializer();
            }

            List <Thread> threads = new List <Thread>();

            for (int i = 0; i < NumThreads; ++i)
            {
                var thread = new Thread(Test);
                threads.Add(thread);
            }

            foreach (var thread in threads)
            {
                thread.Start();
            }

            foreach (var thread in threads)
            {
                thread.Join();
            }

            Console.WriteLine();
            Console.WriteLine("Serialized objects of types:");
            foreach (var type in Tester.SerializedTypes.OrderBy(x => x.FullName))
            {
                Console.WriteLine(type.FullName);
            }

            Console.WriteLine();
            Console.WriteLine("Deserialized objects with type ids:");
            foreach (var id in Tester.DeserializedTypeIds.OrderBy(x => x))
            {
                Console.WriteLine(id);
            }

            Console.ReadKey();
        }