public override void OnApplyTemplate() { BindableProperty property = DataContext as BindableProperty; if (property == null) return; CustomEditorBinder.BindProperty(this, property); ElementProperty elementProperty = property.Property as ElementProperty; if (elementProperty != null) { viewModel = elementProperty.DeclaringElement.ChildElement(elementProperty.DeclaringProperty.Name) as ElementCollectionViewModel; } if (viewModel != null) { var properties = TypeDescriptor.GetProperties(viewModel.CollectionElementType).OfType<PropertyDescriptor>().Where(x => x.Attributes.OfType<ConfigurationPropertyAttribute>().Any()).ToArray(); foreach (var childProperty in properties.Where(x => x.IsBrowsable)) { Collection.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(75, GridUnitType.Star) }); } Collection.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(25) }); Redraw(); viewModel.ChildElementsCollectionChange += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(ChildElements_CollectionChanged); } }
public CustomTraceListenerDataViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { var customTracelistenerProperties = TypeDescriptor.GetProperties(typeof(CustomTraceListenerData)).OfType <PropertyDescriptor>(); formatterPropertyDescriptor = customTracelistenerProperties.Where(x => x.Name == "Formatter").First(); }
public AddCacheManagerCommand(ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(new ConfigurationElementType(typeof(CacheManagerData)), collection, uiService) { Guard.ArgumentNotNull(collection, "collection"); this.cachingSection = collection.ContainingSection as CacheManagerSectionViewModel; }
public AddRegistrationPropertyCommand(CommandAttribute commandAttribute, ElementCollectionViewModel collection, IApplicationModel applicationModel, DefaultCollectionElementAddCommand defaultAddPropertyCommand, IUIServiceWpf uiService) : base(commandAttribute, collection, defaultAddPropertyCommand, uiService) { this.collection = collection as InjectionMemberCollectionViewModel; this.applicationModel = applicationModel; }
public SystemDiagnosticsTraceListenerDataViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { var systemDiagnosticsProperties = TypeDescriptor.GetProperties(typeof(SystemDiagnosticsTraceListenerData)).OfType <PropertyDescriptor>(); initDataPropertyDescriptor = systemDiagnosticsProperties.Where(x => x.Name == "InitData").First(); }
public CustomTraceListenerDataViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) :base(containingCollection, thisElement) { var customTracelistenerProperties = TypeDescriptor.GetProperties(typeof(CustomTraceListenerData)).OfType<PropertyDescriptor>(); formatterPropertyDescriptor = customTracelistenerProperties.Where(x => x.Name == "Formatter").First(); }
protected override void Act() { collection = Section.GetDescendentsOfType <NamedElementCollection <TestNamedElement> >() .Where(e => e.Name == property.DisplayName).OfType <ElementCollectionViewModel>().First(); collection.AddNewCollectionElement(typeof(TestNamedElement)); }
/// <summary> /// Initializes a new instance of the <see cref="AddSatelliteProviderCommand"/> class. /// </summary> /// <remarks> /// This class is intended to be initialized by the <see cref="SectionViewModel.CreateElementCollectionAddCommands"/>. /// </remarks> /// <param name="commandAttribute">The <see cref="AddSateliteProviderCommandAttribute"/> that specifes metadata for this <see cref="AddSatelliteProviderCommand"/> to be initialized with.</param> /// <param name="collection"></param> /// <param name="commandService"></param> /// <param name="configurationElementType"></param> /// <param name="lookup"></param> /// <param name="uiService"></param> public AddSatelliteProviderCommand(AddSateliteProviderCommandAttribute commandAttribute, MenuCommandService commandService, ConfigurationElementType configurationElementType, ElementCollectionViewModel collection, ElementLookup lookup, IUIServiceWpf uiService) : base(commandAttribute, configurationElementType, collection, uiService) { this.commandService = commandService; this.commandAttribute = commandAttribute; this.lookup = lookup; }
public TraceListenerReferenceViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement, new Attribute[] { new EnvironmentalOverridesAttribute(true) { CustomOverridesPropertyType = typeof(TraceListenerReferenceEnvironmentOverriddenElementProperty) } }) { this.containingCollection = containingCollection; }
public ManageableConfigurationSourceViewModel( ElementCollectionViewModel containingCollection, ConfigurationElement thisElement, AssemblyLocator assemblyLocator) : base(containingCollection, thisElement) { this.assemblyLocator = assemblyLocator; }
public void then_configuration_elements_collection_has_element_type() { ElementCollectionViewModel connectionStringsCollection = (ElementCollectionViewModel) connectionStringsModel.DescendentElements(x => x.ConfigurationType == typeof(ConnectionStringSettingsCollection)).First(); Assert.IsNotNull(connectionStringsCollection); Assert.AreEqual(typeof(ConnectionStringSettings), connectionStringsCollection.CollectionElementType); }
protected override void Arrange() { base.Arrange(); ElementCollectionViewModel injectionMembersCollection = (ElementCollectionViewModel)RegistrationElement.ChildElement("InjectionMembers"); PropertyElement = injectionMembersCollection.AddNewCollectionElement(typeof(PropertyElement)); }
protected override void Arrange() { base.Arrange(); ElementCollectionViewModel parametersCollection = (ElementCollectionViewModel)base.ConstructorElement.ChildElement("Parameters"); ParameterElement = (ParameterElementViewModel)parametersCollection.AddNewCollectionElement(typeof(ParameterElement)); ParameterElement.Initialize(new InitializeContext()); }
protected override void Arrange() { base.Arrange(); collection = Section.GetDescendentsOfType <TestElementConfigurationCollection>().OfType <ElementCollectionViewModel>().Single(); var newElement = collection.AddNewCollectionElement(typeof(TestElement)); newElement.Property("KeyValue").BindableProperty.BindableValue = "5"; newElement.Property("OtherKeyValue").BindableProperty.BindableValue = "StringKey"; }
void OverridenTraceListenerCollectionEditor_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var property = (EnvironmentOverriddenProperty)((BindableProperty)e.NewValue).Property; var originalProperty = (ElementProperty)property.OriginalProperty; collection = (ElementCollectionViewModel)originalProperty.DeclaringElement.ChildElements .Single(x => x.DeclaringProperty == property.DeclaringProperty); BindItems(collection); ((INotifyCollectionChanged)collection.ChildElements).CollectionChanged += CollectionChanged; }
protected override void Act() { collection = Section.GetDescendentsOfType <NamedElementCollection <TestNamedElement> >() .Where(e => e.Name == property.DisplayName).OfType <ElementCollectionViewModel>().First(); var newItem = collection.AddNewCollectionElement(typeof(TestNamedElement)); Assert.IsTrue(collection.ValidationResults.Any(e => e.Message == CollectionCountOneValidator.Message)); newItem.Delete(); collection.Validate(); }
protected TemplatedInjectionMemberCommandContainerBase(CommandAttribute commandAttribute, ElementCollectionViewModel collection, DefaultCollectionElementAddCommand defaultAddCommand, IUIServiceWpf uiService) : base(commandAttribute, uiService) { this.collection = collection as InjectionMemberCollectionViewModel; this.registerElement = collection.ParentElement as RegisterElementViewModel; this.defaultAddCommand = defaultAddCommand; this.registerElementRegistrationTypeChangedHandler = new EventHandler<EventArgs>(registerElement_RegistrationTypeChanged); this.registerElement.RegistrationTypeChanged += registerElementRegistrationTypeChangedHandler; }
protected override void Arrange() { base.Arrange(); validationModel = Container.Resolve <ValidationModel>(); cacheManagerCollection = CachingSettingsViewModel.GetDescendentsOfType <NameTypeConfigurationElementCollection <CacheManagerDataBase, CustomCacheManagerData> >().OfType <ElementCollectionViewModel>().Single(); var newItem = cacheManagerCollection.AddNewCollectionElement(typeof(CacheManagerData)); newItem.Property("Name").BindableProperty.BindableValue = ""; originalCount = validationModel.ValidationResults.Count(); }
protected override void Arrange() { base.Arrange(); validationModel = Container.Resolve <ValidationModel>(); cacheManagerCollection = LoggingSettingsViewModel.GetDescendentsOfType <TraceListenerDataCollection>().OfType <ElementCollectionViewModel>().Single(); var newItem = cacheManagerCollection.AddNewCollectionElement(typeof(FlatFileTraceListenerData)); newItem.Property("Name").BindableProperty.BindableValue = ""; originalCount = validationModel.ValidationResults.Count(); }
public ParameterElementViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { var valueProperty = TypeDescriptor.GetProperties(typeof(ParameterElement)) .Cast<PropertyDescriptor>() .Where(x => x.Name == "Value") .First(); parameterValueProperty = ContainingSection.CreateProperty<ValueElementProperty>( new DependencyOverride<ElementViewModel>(this), new DependencyOverride<PropertyDescriptor>(valueProperty)); }
protected override void Arrange() { base.Arrange(); var section = new ElementForValidation(); var sectionModel = SectionViewModel.CreateSection(Container, "mock section", section); collectionElement = sectionModel.DescendentConfigurationsOfType <NamedElementCollection <TestNamedElement> >() .Where(x => x.Name == "ReferencedItems").OfType <ElementCollectionViewModel>().First(); }
public PropertyElementViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { var valueProperty = TypeDescriptor.GetProperties(typeof(PropertyElement)) .Cast <PropertyDescriptor>() .Where(x => x.Name == "Value") .First(); propertyValueProperty = ContainingSection.CreateProperty <ValueElementProperty>( new DependencyOverride <ElementViewModel>(this), new DependencyOverride <PropertyDescriptor>(valueProperty)); }
public SelectValidatedTypeReferenceMembersCommand(TypeMemberChooser typeMemberChooser, ElementViewModel context, CommandAttribute attribute, IUIServiceWpf uiService) : base(attribute, uiService) { if (context.ConfigurationType != typeof(ValidationRulesetData)) throw new InvalidOperationException(); this.validatedTypeReferenceElement = context.AncestorElements().Where(x => x.ConfigurationType == typeof(ValidatedTypeReference)).First(); this.fieldCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedFieldReferenceCollection)).First(); this.propertyCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedPropertyReferenceCollection)).First(); this.methodsCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedMethodReferenceCollection)).First(); this.typeMemberChooser = typeMemberChooser; }
protected override void InnerExecute(object parameter) { base.InnerExecute(parameter); ElementCollectionViewModel parametersCollection = (ElementCollectionViewModel)base.AddedElementViewModel.ChildElement("Parameters"); foreach (var parameterInfo in Constructor.GetParameters()) { var parameterElement = parametersCollection.AddNewCollectionElement(typeof(ParameterElement)); parameterElement.Property("Name").Value = parameterInfo.Name; parameterElement.Property("TypeName").Value = parameterInfo.ParameterType.AssemblyQualifiedName; } }
public void then_adding_new_tracelistener_reference_allows_to_be_overwritten() { ElementCollectionViewModel tracelistenerReferenceCollection = (ElementCollectionViewModel)categoryElement.ChildElement("TraceListeners"); var addedTracelistenerReference = tracelistenerReferenceCollection.AddNewCollectionElement(typeof(TraceListenerReferenceData)); addedTracelistenerReference.Property("Name").Value = "unreferenced element"; var overridesProprtyForReferenceData = GetOverridesProperty(addedTracelistenerReference); Assert.IsTrue((bool)overridesProprtyForReferenceData.Value); }
protected override void Arrange() { base.Arrange(); base.Arrange(); var section = new ElementForValidation(); var sectionModel = SectionViewModel.CreateSection(Container, "mock section", section); collectionElement = sectionModel.DescendentConfigurationsOfType<NamedElementCollection<TestNamedElement>>() .Where(x => x.Name == "ValidatedCollection").OfType<ElementCollectionViewModel>().First(); collectionElement.AddNewCollectionElement(typeof (TestNamedElement)); }
protected override void Arrange() { base.Arrange(); var section = new Mocks.MockSectionWithMultipleChildCollections(); var sectionViewModel = SectionViewModel.CreateSection(Container, "mockSection", section); polymorphicCollection = sectionViewModel.ChildElements .OfType <ElementCollectionViewModel>() .Where( c => typeof(NameTypeConfigurationElementCollection <TestHandlerData, CustomTestHandlerData>).IsAssignableFrom (c.ConfigurationType)).First(); }
public TypePickingCollectionElementAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel) : base(commandAttribute, configurationElementType, elementCollectionModel, uiService) { Guard.ArgumentNotNull(commandAttribute, "commandAttribute"); this.discoveryService = discoveryService; this.propertyToSet = commandAttribute.Property; if (propertyToSet == null) { throw new ArgumentException( "Target ConfigurationElement must have an accessible property named TypeName or a specified property of type string."); } }
protected override void Arrange() { base.Arrange(); var section = new Mocks.MockSectionWithMultipleChildCollections(); var sectionViewModel = SectionViewModel.CreateSection(Container, "mockSection", section); polymorphicCollection = sectionViewModel.ChildElements .OfType<ElementCollectionViewModel>() .Where( c => typeof(NameTypeConfigurationElementCollection<TestHandlerData, CustomTestHandlerData>).IsAssignableFrom (c.ConfigurationType)).First(); }
public SelectValidatedTypeReferenceMembersCommand(TypeMemberChooser typeMemberChooser, ElementViewModel context, CommandAttribute attribute, IUIServiceWpf uiService) : base(attribute, uiService) { if (context.ConfigurationType != typeof(ValidationRulesetData)) { throw new InvalidOperationException(); } this.validatedTypeReferenceElement = context.AncestorElements().Where(x => x.ConfigurationType == typeof(ValidatedTypeReference)).First(); this.fieldCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedFieldReferenceCollection)).First(); this.propertyCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedPropertyReferenceCollection)).First(); this.methodsCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedMethodReferenceCollection)).First(); this.typeMemberChooser = typeMemberChooser; }
protected override void Arrange() { RegistrationTypeChanged = false; base.Arrange(); ElementCollectionViewModel registrationsCollection = (ElementCollectionViewModel)base.ContainerElement.ChildElement("Registrations"); RegistrationElement = (RegisterElementViewModel)registrationsCollection.AddNewCollectionElement(typeof(RegisterElement)); RegistrationElement.RegistrationTypeChanged += (sender, args) => RegistrationTypeChanged = true; RegistrationElement.Initialize(new InitializeContext()); }
protected override void Arrange() { base.Arrange(); var deepestRule = ValidationViewModel.DescendentConfigurationsOfType <AndCompositeValidatorData>() .Where(x => string.Equals(x.NameProperty.Value, DeepestRuleValidatorName)).First(); ruleCollection = (ElementCollectionViewModel)deepestRule.ParentElement; walker = new ElementListLayoutWalker(Layout.Contained); var currentDeepestLayout = walker.LayoutElements().OfType <TwoColumnsLayout>().Where(l => l.Left == deepestRule).First(); layoutHeader = FindHorizontalList(currentDeepestLayout.ColumnName); propertyChangedListener = new PropertyChangedListener(layoutHeader); }
/// <summary> /// Initializes a new instance of the <see cref="WellKnownRetryStrategyElementCollectionCommand"/> class. /// </summary> /// <param name="collection">The collection that will be affected by the add command.</param> /// <param name="uiService">The <see cref="IUIServiceWpf"/> for displaying messages.</param> public WellKnownRetryStrategyElementCollectionCommand(ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(collection, uiService) { this.section = collection.ContainingSection; var knownTypes = new[] { typeof(IncrementalData), typeof(FixedIntervalData), typeof(ExponentialBackoffData), typeof(CustomRetryStrategyData) }; this.childCommands = knownTypes .SelectMany(x => this.section.CreateCollectionElementAddCommand(x, collection)) .OrderBy(x => x.Title) .ToArray(); }
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); }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { BindableProperty bindableProperty = (BindableProperty)context.PropertyDescriptor; ElementProperty property = (ElementProperty)bindableProperty.Property; ElementCollectionViewModel collection = (ElementCollectionViewModel)property.DeclaringElement.ChildElement(property.DeclaringProperty.Name); IUIServiceWpf uiService = (IUIServiceWpf)context.GetService(typeof(IUIServiceWpf)); PopupCollectionEditorWindow w = new PopupCollectionEditorWindow() { ContainedContent = new HeaderedListLayout(collection, collection.AddCommands) }; uiService.ShowDialog(w); return(value); }
protected override void Arrange() { base.Arrange(); var viewModel = SectionViewModel.CreateSection(Container, ExceptionHandlingSettings.SectionName, Section); handlerCollection = viewModel.DescendentElements( e => e.ConfigurationType == typeof(NameTypeConfigurationElementCollection <ExceptionHandlerData, CustomHandlerData>)).Cast <ElementCollectionViewModel>().First(); startingCount = handlerCollection.ChildElements.Count( x => typeof(WrapHandlerData).IsAssignableFrom(x.ConfigurationType)); this.Container.RegisterInstance(new Mock <IAssemblyDiscoveryService>().Object); }
/// <summary> /// Initializes a new instance of <see cref="CollectionElementViewModel"/>. /// </summary> /// <param name="containingCollection">The collection containing this element.</param> /// <param name="thisElement">The <see cref="ConfigurationElement"/> modeled by the <see cref="CollectionElementViewModel"/>.</param> /// <param name="additionalAttributes">Additional <see cref="Attribute"/> items to apply when describing this <paramref name="thisElement"/>.</param> public CollectionElementViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement, IEnumerable<Attribute> additionalAttributes) :base(containingCollection, thisElement, additionalAttributes) { this.containingCollection = containingCollection; configurationCollectionAttribute = containingCollection.Attributes.OfType<ConfigurationCollectionAttribute>().First(); var overrides = new Dictionary<Type, object>() { {typeof (ElementCollectionViewModel), containingCollection}, {typeof (CollectionElementViewModel), this} }; MoveUp = ContainingSection.CreateCommand<MoveUpCommand>(overrides); MoveDown = ContainingSection.CreateCommand<MoveDownCommand>(overrides); }
/// <summary> /// Initializes a new instance of the <see cref="WellKnownRetryStrategyElementCollectionCommand"/> class. /// </summary> /// <param name="collection">The collection that will be affected by the add command.</param> /// <param name="uiService"><see cref="IUIServiceWpf"/> for displaying messages.</param> public WellKnownRetryStrategyElementCollectionCommand(ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(collection, uiService) { this.section = collection.ContainingSection; var knownTypes = new[] { typeof(IncrementalData), typeof(FixedIntervalData), typeof(ExponentialBackoffData), typeof(CustomRetryStrategyData) }; this.childCommands = knownTypes .SelectMany(x => this.section.CreateCollectionElementAddCommand(x, collection)) .OrderBy(x => x.Title) .ToArray(); }
public RegisterElementViewModel(IServiceProvider serviceProvider, ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { registrationTypeDependentPropertyChangedHandler = new PropertyChangedEventHandler(RegistrationTypeDependentPropertyChanged); var lifetimeElementPropertyDescriptor = TypeDescriptor.GetProperties(thisElement). OfType <PropertyDescriptor>(). Where(x => x.Name == "Lifetime"). First(); lifetimeElementProperty = (LifetimeElementProperty)ContainingSection.CreateProperty( typeof(LifetimeElementProperty), new DependencyOverride <IServiceProvider>(serviceProvider), new DependencyOverride <ElementViewModel>(this), new DependencyOverride <PropertyDescriptor>(lifetimeElementPropertyDescriptor)); }
protected override void Arrange() { base.Arrange(); base.Arrange(); var section = new ElementForValidation(); var sectionModel = SectionViewModel.CreateSection(Container, "mock section", section); collectionElement = sectionModel.DescendentConfigurationsOfType <NamedElementCollection <TestNamedElement> >() .Where(x => x.Name == "ValidatedCollection").OfType <ElementCollectionViewModel>().First(); // two elements is valid collectionElement.AddNewCollectionElement(typeof(TestNamedElement)); collectionElement.AddNewCollectionElement(typeof(TestNamedElement)); }
///<summary> /// Initializes an instance of DefaultElementCollectionAddCommand. /// </summary> ///<param name="collection">The collection that will be affected by the add command.</param> ///<param name="uiService"><see cref="IUIServiceWpf"/> for displaying messages.</param> public DefaultElementCollectionAddCommand(ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(uiService) { this.collection = collection; this.section = collection.ContainingSection; if (this.collection.IsPolymorphicCollection) { childCommands = this.collection.PolymorphicCollectionElementTypes .SelectMany(x => section.CreateCollectionElementAddCommand(x, collection)) .OrderBy(x => x.Title) .ToArray(); } else { childCommands = section.CreateCollectionElementAddCommand(collection.CollectionElementType, collection).ToArray(); } }
public RegisterElementViewModel(IServiceProvider serviceProvider, ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { registrationTypeDependentPropertyChangedHandler = new PropertyChangedEventHandler(RegistrationTypeDependentPropertyChanged); var lifetimeElementPropertyDescriptor = TypeDescriptor.GetProperties(thisElement). OfType<PropertyDescriptor>(). Where(x => x.Name == "Lifetime"). First(); lifetimeElementProperty = (LifetimeElementProperty)ContainingSection.CreateProperty( typeof (LifetimeElementProperty), new DependencyOverride<IServiceProvider>(serviceProvider), new DependencyOverride<ElementViewModel>(this), new DependencyOverride<PropertyDescriptor>(lifetimeElementPropertyDescriptor)); }
protected override void Arrange() { base.Arrange(); var section = new MockSectionWithSingleChild(); section.Children.Add(CreateNewElement("One")); section.Children.Add(CreateNewElement("Two")); ViewModel = SectionViewModel.CreateSection(Container, "mock section", section); childrenCollection = ViewModel.DescendentElements( e => e.ConfigurationType == typeof(NamedElementCollection <TestHandlerDataWithChildren>)).Cast <ElementCollectionViewModel>().First(); startingCount = childrenCollection.ChildElements.Count( x => typeof(TestHandlerDataWithChildren).IsAssignableFrom(x.ConfigurationType)); }
public AuthorizationRuleProviderDataViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) :base(containingCollection, thisElement) { }
protected override void Arrange() { base.Arrange(); aliasesCollection = (ElementCollectionViewModel)base.UnitySectionViewModel.ChildElement("TypeAliases"); Container.RegisterInstance(new Mock<IAssemblyDiscoveryService>().Object); }
public PolicyDataViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { }
public TemplatedInjectionMemberCommandBase(ConfigurationElementType configurationElementType, ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(configurationElementType, collection, uiService) { }
public MockInitializeCollectionElementViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) : base(containingCollection, thisElement) { }
protected override void Arrange() { base.Arrange(); var deepestRule = ValidationViewModel.DescendentConfigurationsOfType<AndCompositeValidatorData>() .Where(x => string.Equals(x.NameProperty.Value, DeepestRuleValidatorName)).First(); ruleCollection = (ElementCollectionViewModel) deepestRule.ParentElement; walker = new ElementListLayoutWalker(Layout.Contained); var currentDeepestLayout = walker.LayoutElements().OfType<TwoColumnsLayout>().Where(l => l.Left == deepestRule).First(); layoutHeader = FindHorizontalList(currentDeepestLayout.ColumnName); propertyChangedListener = new PropertyChangedListener(layoutHeader); }
private void BindItems(ElementCollectionViewModel collection) { this.Items.ItemsSource = collection.ChildElements.OfType<TraceListenerReferenceViewModel>().Select(x => new EnvironmentalTraceListenerReferenceDataViewModel(x, environment)); }
protected override void Arrange() { base.Arrange(); var viewModel = SectionViewModel.CreateSection(Container, ExceptionHandlingSettings.SectionName, Section); handlerCollection = viewModel.DescendentElements( e => e.ConfigurationType == typeof(NameTypeConfigurationElementCollection<ExceptionHandlerData, CustomHandlerData>)).Cast<ElementCollectionViewModel>().First(); startingCount = handlerCollection.ChildElements.Count( x => typeof(WrapHandlerData).IsAssignableFrom(x.ConfigurationType)); this.Container.RegisterInstance(new Mock<IAssemblyDiscoveryService>().Object); }
public AnotherCustomElementCollectionAddCommand(ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel, IUIServiceWpf uiService) : base(configurationElementType, elementCollectionModel, uiService) { }
public AddExceptionPolicyCommand(ElementCollectionViewModel collection, IUIServiceWpf uiService) : base(new ConfigurationElementType(typeof(ExceptionPolicyData)), collection, uiService) { }
public ValidatedMemberReferenceViewModel(ElementCollectionViewModel containingCollection, ConfigurationElement thisElement) :base(containingCollection, thisElement) { }
public ExceptionTypeAddCommand(TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel, IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService) : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel) { }