protected override void Arrange()
        {
            base.Arrange();

            ((RegisterElement)base.RegistrationElement.ConfigurationElement).Lifetime = new LifetimeElement()
            {
                TypeName = "PerThreadLifetimeManager"
            };
            LifetimeElementProperty.RecreateLifetimeElementViewModel();
        }
        protected override void Arrange()
        {
            base.Arrange();

            ((RegisterElement)RegistrationElement.ConfigurationElement).Lifetime = new LifetimeElement()
            {
                TypeName = "CustomLifetime, assembly"
            };
            LifetimeElementProperty.RecreateLifetimeElementViewModel();
        }
예제 #3
0
        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));
        }
        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();

            LifetimeElementProperty = base.RegistrationElement.Properties.OfType <LifetimeElementProperty>().Single();
        }
        protected override void Arrange()
        {
            base.Arrange();

            LifetimeElementProperty = base.RegistrationElement.Properties.OfType<LifetimeElementProperty>().Single();
        }