当前位置: 首页>>代码示例>>C#>>正文


C# SectionViewModel.DescendentElements方法代码示例

本文整理汇总了C#中SectionViewModel.DescendentElements方法的典型用法代码示例。如果您正苦于以下问题:C# SectionViewModel.DescendentElements方法的具体用法?C# SectionViewModel.DescendentElements怎么用?C# SectionViewModel.DescendentElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SectionViewModel的用法示例。


在下文中一共展示了SectionViewModel.DescendentElements方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Arrange

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

            var resources = new ResourceHelper<ConfigFileLocator>();
            resources.DumpResourceFileToDisk("empty.config");

            var applicationViewModel = Container.Resolve<ApplicationViewModel>();
            ConfigurationSourceModel sourceModel = applicationViewModel.CurrentConfigurationSource;
            applicationViewModel.NewEnvironment();

            EhabModel = sourceModel.AddSection(ExceptionHandlingSettings.SectionName, Section);
            EnvironmentViewModel = applicationViewModel.Environments.First();
            EnvironmentSection = (EnvironmentalOverridesSection)EnvironmentViewModel.ConfigurationElement;

            ((EnvironmentSourceViewModel)EnvironmentViewModel).EnvironmentConfigurationFile = "empty.config";
            ((EnvironmentSourceViewModel)EnvironmentViewModel).EnvironmentDeltaFile = "empty.config";

            WrapHandler = EhabModel.DescendentElements().Where(x => x.ConfigurationType == typeof(WrapHandlerData)).First();

            MainExceptionMessage = WrapHandler.Property("ExceptionMessage");
            MainExceptionMessage.Value = "Main Value";

            OverridesProperty = WrapHandler.Properties.Where(x => x.PropertyName.StartsWith("Overrides")).First(); 
            OverriddenExceptionMessage = OverridesProperty.ChildProperties.Where(x => x.PropertyName == "ExceptionMessage").First();
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:26,代码来源:when_attaching_empty_overrides.cs

示例2: Arrange

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

            Viewmodel = SectionViewModel.CreateSection(Container, ExceptionHandlingSettings.SectionName, Section);
            Handler = (CollectionElementViewModel) Viewmodel.DescendentElements(x => typeof(ExceptionHandlerData).IsAssignableFrom(x.ConfigurationType)).First();
            
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:8,代码来源:given_delete_element_command.cs

示例3: Act

        protected override void Act()
        {
            var configurationSourceModel = Container.Resolve<ConfigurationSourceModel>();
            viewModel = configurationSourceModel.AddSection(ExceptionHandlingSettings.SectionName, Section);
            loggingModel = configurationSourceModel.AddSection(LoggingSettings.SectionName, LogginSettings);

            numberOfLogCategories = loggingModel.DescendentElements(x => x.ConfigurationType == typeof(TraceSourceData)).Count();
            numberOfLogCategories -= 3; //3 special sources
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:9,代码来源:when_editing_reference_property.cs

示例4: Arrange

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

            var source = new DesignDictionaryConfigurationSource();
            new TestConfigurationBuilder().AddExceptionSettings().Build(source);

            var sourceModel = Container.Resolve<ConfigurationSourceModel>();
            sourceModel.Load(source);
            exceptionSection =
                sourceModel.Sections.Where(x => x.ConfigurationType == typeof(ExceptionHandlingSettings)).Single();

            policy = exceptionSection.DescendentElements()
                .Where(x => x.ConfigurationType == typeof(ExceptionPolicyData))
                .First();

            this.Container.RegisterInstance(new Mock<IAssemblyDiscoveryService>().Object);
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:18,代码来源:when_creating_new_container.cs

示例5: Act

 protected override void Act()
 {
     var configurationSource = Container.Resolve<ConfigurationSourceModel>();
     validationModel = configurationSource.AddSection(ValidationSettings.SectionName, ValidationSection);
     stringTypeReference = validationModel.DescendentElements(x => x.ConfigurationType == typeof(ValidatedTypeReference)).First();
 }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:6,代码来源:when_creating_reference_for_default_validation_rule.cs

示例6: Act

 protected override void Act()
 {
     viewModel = SectionViewModel.CreateSection(Container, "mockSection", section);
     customProviderElement = viewModel.DescendentElements(x => x.ConfigurationType == typeof(CustomProviderConfigurationElement)).First();
     attributesProperty = customProviderElement.Property("Attributes");
 }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:6,代码来源:when_creating_custom_provider_element.cs

示例7: InitializeSection

        public static void InitializeSection(SectionViewModel section, InitializeContext context)
        {
            //first init section
            section.Initialize(context);

            // then initialize elements
            var elements = section.DescendentElements().OfType<ElementViewModel>();
            foreach (var element in elements)
            {
                element.Initialize(context);
            }

            //then init properties
            var sectionPropertiesThatNeedInitialization = section.Properties;
            var propertiesOfContainedElementsThatNeedInitialization =
                section.DescendentElements().SelectMany(x => x.Properties);

            foreach (var propertyThatNeedsInitialization in
                sectionPropertiesThatNeedInitialization.Concat(
                    propertiesOfContainedElementsThatNeedInitialization))
            {
                propertyThatNeedsInitialization.Initialize(context);
            }
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:24,代码来源:ConfigurationSourceModel.cs


注:本文中的SectionViewModel.DescendentElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。