예제 #1
0
        private void SerializeDataContractJsonClicked(object sender, RoutedEventArgs e)
        {
            IList <RootObject> list = new List <RootObject>();

            list.Add(GetObject("Jan", "Munich"));
            list.Add(GetObject("Peter", "Munster"));
            list.Add(GetObject("Karl", "Köln"));
            list.Add(GetObject("Hugo", "Paris"));
            list.Add(GetObject("Luis", "London"));

            var start = DateTime.Now;

            var data = SerializationService.SerializeJson(list);

            var end = DateTime.Now;

            Output.Text = string.Format("{0} ticks ({1} sec)", end.Ticks - start.Ticks, (end - start).TotalSeconds);
        }