本文整理汇总了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();
}
示例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";
}
示例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();
}
示例4: SetProperties
protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
{
base.SetProperties(createdElement, selectedType);
if (createdElement.ConfigurationType == typeof(KeyedHashAlgorithmProviderData))
{
createdElement.Property("Key").Value = keySettings;
}
}
示例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();
}
示例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 { }
}
示例7: Act
protected override void Act()
{
addedElement = collection.AddNewCollectionElement(typeof(TestElement));
addedElement.Property("KeyValue").BindableProperty.BindableValue = "5";
addedElement.Property("OtherKeyValue").BindableProperty.BindableValue = "StringKey";
}
示例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;
}
示例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");
}
示例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;
}
示例11: SetProperties
protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
{
base.SetProperties(createdElement, selectedType);
createdElement.Property("Key").Value = keySettings;
}
示例12: SetProperties
protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
{
createdElement.Property("Name").Value = selectedType.FullName;
createdElement.Property("AssemblyName").Value = selectedType.Assembly.GetName().FullName;
}
示例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;
}
示例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;
}
}
示例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;
}
}