protected override void Act()
        {
            var referencedSection = new TestReferencedSection();

            configSource.AddSection("referencedSection", referencedSection);
            newSection = configSource.Sections.Where(x => x.SectionName == "referencedSection").Single();

            var referencedItems = newSection
               .GetDescendentsOfType<NamedElementCollection<ReferencedItemType>>()
               .OfType<ElementCollectionViewModel>().First();

            var newItem = referencedItems.AddNewCollectionElement(typeof(ReferencedItemType));
            newItem.Property("Name").Value = "ReferringTo";
        }
Пример #2
0
        protected override void Act()
        {
            var referencedSection = new TestReferencedSection();

            configSource.AddSection("referencedSection", referencedSection);
            newSection = configSource.Sections.Where(x => x.SectionName == "referencedSection").Single();

            var referencedItems = newSection
                                  .GetDescendentsOfType <NamedElementCollection <ReferencedItemType> >()
                                  .OfType <ElementCollectionViewModel>().First();

            var newItem = referencedItems.AddNewCollectionElement(typeof(ReferencedItemType));

            newItem.Property("Name").Value = "ReferringTo";
        }