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


C# ElementViewModel.Property方法代码示例

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


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

示例1: Act

        protected override void Act()
        {
            logFilter = LoggingSection.GetDescendentsOfType<PriorityFilterData>().FirstOrDefault();
            int maximumPriority = (int) logFilter.Property("MaximumPriority").Value;

            logFilter.Property("MinimumPriority").Value = maximumPriority + 1;
            logFilter.Validate();
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:8,代码来源:when_logging_filter_priorities_invalid.cs

示例2: Arrange

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

            var aliasesCollection = (ElementCollectionViewModel)base.UnitySectionViewModel.ChildElement("TypeAliases");
            StringAlias = aliasesCollection.AddNewCollectionElement(typeof(AliasElement));
            StringAlias.Property("Alias").Value = "s";
            StringAlias.Property("TypeName").Value = "System.String, mscorlib";

            Int32Alias = aliasesCollection.AddNewCollectionElement(typeof(AliasElement));
            Int32Alias.Property("Alias").Value = "i";
            Int32Alias.Property("TypeName").Value = "System.Int32, mscorlib";

            base.RegistrationElement.Property("TypeName").Value = "s";
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:15,代码来源:given_registration_of_alias.cs

示例3: 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

示例4: SetProperties

        protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
        {
            base.SetProperties(createdElement, selectedType);

            if (createdElement.ConfigurationType == typeof(KeyedHashAlgorithmProviderData))
            {
                createdElement.Property("Key").Value = keySettings;
            }
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:9,代码来源:HashAlgorithmProviderAddCommand.cs

示例5: Arrange

        protected override void Arrange()
        {
            base.Arrange();
            validationModel = Container.Resolve<ValidationModel>();
            traceListener = LoggingSettingsViewModel.DescendentElements(x => x.ConfigurationType == typeof(FormattedEventLogTraceListenerData)).First();

            var bindableProperty = traceListener.Property("TraceOutputOptions").BindableProperty;
            bindableProperty.BindableValue = "Invalid";

            result = bindableProperty.Property.ValidationResults.First();
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:11,代码来源:when_navigating_validation_error.cs

示例6: Arrange

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

            elementViewModel = CachingViewModel.GetDescendentsOfType<CacheManagerData>().Single();
            HostAdapter.TasksChanged += (sender, args) => validationError = args.Tasks.First();

            try
            {
                elementViewModel.Property("ExpirationPollFrequencyInSeconds").BindableProperty.BindableValue = "abc";
            }
            catch { }
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:13,代码来源:when_navigating_validation_error.cs

示例7: Act

 protected override void Act()
 {
     addedElement = collection.AddNewCollectionElement(typeof(TestElement));
     addedElement.Property("KeyValue").BindableProperty.BindableValue = "5";
     addedElement.Property("OtherKeyValue").BindableProperty.BindableValue = "StringKey";
 }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:6,代码来源:when_validating_a_property.cs

示例8: Arrange

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

            step = Container.Resolve<PickExceptionStep>();

            existingPolicy = GetDescendentsOfType<ExceptionPolicyData>().First();
            existingException = existingPolicy.GetDescendentsOfType<ExceptionTypeData>().Last();

            var handlerCollection = existingException.GetDescendentsOfType<NamedElementCollection<ExceptionHandlerData>>()
                .OfType<ElementCollectionViewModel>().First();
            existingHandlerName = handlerCollection.AddNewCollectionElement(typeof (LoggingExceptionHandlerData)).Name;


            step.Policy.Value = existingPolicy.Name;
            step.ExceptionType.Value = existingException.Property("TypeName").Value;
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:17,代码来源:when_exception_step_executes.cs

示例9: 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

示例10: SetProperties

 /// <summary>
 /// Sets properties on the newly minted <see cref="ElementViewModel"/>.
 /// </summary>
 /// <param name="createdElement">The element created.</param>
 /// <param name="selectedType">The element type created.</param>
 /// <remarks>
 /// By default, this sets the <see cref="ElementViewModel.NameProperty"/>'s value, if present.
 /// The command also updates the <see cref="Property.Value"/> of the property specified by <see cref="TypePickingCommandAttribute.Property"/> to
 /// the assembly qualified name of the selected type.
 /// </remarks>
 protected virtual void SetProperties(ElementViewModel createdElement, Type selectedType)
 {
     if (createdElement.NameProperty != null)
     {
         createdElement.NameProperty.Value = ElementCollectionModel.FindUniqueNewName(selectedType.Name);
     }
     createdElement.Property(propertyToSet).Value = selectedType.AssemblyQualifiedName;
 }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:18,代码来源:TypePickingCollectionElementAddCommand.cs

示例11: SetProperties

        protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
        {
            base.SetProperties(createdElement, selectedType);

            createdElement.Property("Key").Value = keySettings;
        }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:6,代码来源:SymmetricAlgorithmProviderAddCommand.cs

示例12: SetProperties

 protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
 {
     createdElement.Property("Name").Value = selectedType.FullName;
     createdElement.Property("AssemblyName").Value = selectedType.Assembly.GetName().FullName;
 }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:5,代码来源:ValidationTypeReferenceAddCommand.cs

示例13: Arrange

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

            property.Value = "TestElement";

            var testElementCollection = Section.GetDescendentsOfType<NamedElementCollection<TestNamedElement>>()
                .Where(e => e.Name == "ReferencedItems").OfType<ElementCollectionViewModel>().Single();
            referencedElement = testElementCollection.AddNewCollectionElement(typeof(TestNamedElement));
            referencedElement.Property("Name").Value = property.Value;
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:11,代码来源:when_validating_a_property.cs

示例14: EnsurePolicy

            private void EnsurePolicy()
            {
                policyModel = exceptionSettingsSection.DescendentConfigurationsOfType<ExceptionPolicyData>()
                                    .Where(x => (string)x.Property("Name").Value == wizardData.Policy).FirstOrDefault();

                if (policyModel == null)
                {
                    var policies = GetCollectionOfType<NamedElementCollection<ExceptionPolicyData>>(exceptionSettingsSection);
                    policyModel = policies.AddNewCollectionElement(typeof(ExceptionPolicyData));
                    policyModel.Property("Name").Value = wizardData.Policy;
                }
            }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:12,代码来源:PickExceptionType.cs

示例15: EnsureExceptionType

            private void EnsureExceptionType()
            {
                var exceptionTypes = GetCollectionOfType<NamedElementCollection<ExceptionTypeData>>(policyModel);

                exceptionType = exceptionTypes.DescendentConfigurationsOfType<ExceptionTypeData>()
                    .Where(x => (string)x.Property("TypeName").Value == wizardData.ExceptionType)
                    .FirstOrDefault();

                if (exceptionType == null)
                {
                    exceptionType = exceptionTypes.AddNewCollectionElement(typeof(ExceptionTypeData));
                    exceptionType.Property("Name").Value = TypeNameParserHelper.ParseTypeName(wizardData.ExceptionType);
                    exceptionType.Property("TypeName").Value = wizardData.ExceptionType;
                }
            }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:15,代码来源:PickExceptionType.cs


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