Наследование: Tools.TOKEN
Пример #1
0
        void Verify()
        {
            var serializer = new ConfigurationContainer().EnableXmlText()
                             .Create()
                             .ForTesting();

            var instance = new Subject {
                Item = 123
            };

            serializer.Cycle(instance)
            .ShouldBeEquivalentTo(instance);

            var second = new SubjectWithMembers {
                Item = 123, Message = "Message", Time = DateTimeOffset.Now
            };

            serializer.Cycle(second)
            .ShouldBeEquivalentTo(second);

            var group = new Group2 {
                Type = GroupType.Large
            };

            serializer.Cycle(group)
            .ShouldBeEquivalentTo(group);

            var group3 = new Group3 {
                CreationTime = DateTime.Now
            };

            serializer.Cycle(group3)
            .ShouldBeEquivalentTo(group3);
        }
Пример #2
0
    private void SerializeDateTime(string filename)
    {
        XmlSerializer ser     = new XmlSerializer(typeof(Group3));
        Group3        myGroup = new Group3();
        TextWriter    writer  = new StreamWriter(filename);

        ser.Serialize(writer, myGroup);
        writer.Close();
    }
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemsControlSampleViewModel"/> class.
        /// </summary>
        public ItemsControlSampleViewModel()
        {
            Title = "Items Control Sample";

            Group1.Add("Homer Simpson");
            Group1.Add("Marge Simpson");
            Group1.Add("Bart Simpson");
            Group1.Add("Lisa Simpson");
            Group1.Add("Maggie Simpson");

            Group2.Add("Mr Burns");
            Group2.Add("Mr Smithers");

            Group3.Add("Krusty");
            Group3.Add("Bubblebee Man");

            group4.Add("Itchy");
            group4.Add("Scratchy");
        }