本文整理汇总了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();
}
示例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();
}
示例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
}
示例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);
}
示例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");
}
示例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);
}
}