protected override void Act()
        {
            var children = ruleCollection.ChildElements.OfType <CollectionElementViewModel>().ToArray();

            foreach (var child in children)
            {
                ruleCollection.Delete(child);
            }
        }
Ejemplo n.º 2
0
        public void then_reference_uses_updated_path_to_reconnect()
        {
            var anyHandler = ehabModel.DescendentElements().Where(x => typeof(ExceptionHandlerData).IsAssignableFrom(x.ConfigurationType)).First();
            ElementReference reference = lookup.CreateReference(anyHandler.Path);

            anyHandler.Property("Name").Value = "new name"; //path changes;
            ElementCollectionViewModel containingCollection = (ElementCollectionViewModel)anyHandler.ParentElement;
            containingCollection.Delete((CollectionElementViewModel)anyHandler);

            Assert.IsNull(reference.Element);

            var NewHandler = containingCollection.AddNewCollectionElement(anyHandler.ConfigurationType);
            NewHandler.Property("Name").Value = "new name";

            Assert.AreEqual(NewHandler, reference.Element);
        }