本文整理汇总了C#中ElementViewModel类的典型用法代码示例。如果您正苦于以下问题:C# ElementViewModel类的具体用法?C# ElementViewModel怎么用?C# ElementViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementViewModel类属于命名空间,在下文中一共展示了ElementViewModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverriddenElementViewModel
public OverriddenElementViewModel(ElementLookup lookup, EnvironmentMergeSection environmentSection, ElementViewModel subject)
{
this.lookup = lookup;
this.environmentSection = environmentSection;
this.elementReference = new ReferenceContainer(this);
this.subject = subject;
}
示例2: SaveMergedEnvironmentConfigurationCommand
public SaveMergedEnvironmentConfigurationCommand(IUIServiceWpf uiService, ConfigurationSourceModel configurationSource, IApplicationModel application, ElementViewModel overridesViewModel)
: base(uiService)
{
this.configurationSource = configurationSource;
this.application = application;
this.overridesViewModel = (EnvironmentSourceViewModel)overridesViewModel;
}
示例3: Act
protected override void Act()
{
var parameterValueProperty = base.ParameterElement.Property("Value");
parameterValueProperty.Value = typeof(DependencyElement);
var valueElementProperty = (ValueElementProperty)ParameterElement.Property("Value");
dependencyParameterViewModel = valueElementProperty.ValueElementViewModel;
}
示例4: Act
protected override void Act()
{
var parameterValueProperty = base.ParameterElement.Property("Value");
parameterValueProperty.Value = typeof(OptionalElement);
var valueElementProperty = (ValueElementProperty)ParameterElement.Property("Value");
optionalParameterViewModel = valueElementProperty.ValueElementViewModel;
}
示例5: RangeValidatorCultureProperty
public RangeValidatorCultureProperty(IServiceProvider serviceProvider, ElementViewModel parent, PropertyDescriptor declaringProperty)
: base(serviceProvider, parent, declaringProperty,
new Attribute[]{
new TypeConverterAttribute(typeof(CultureInfoConverter)),
new DesigntimeDefaultAttribute(cultureInfoConverter.ConvertToInvariantString(CultureInfo.CurrentCulture))
})
{
}
示例6: ElementValidationResult
public ElementValidationResult(ElementViewModel element, string errorMessage, bool isWarning)
: base(errorMessage, isWarning)
{
Guard.ArgumentNotNull(element, "element");
this.element = element;
this.element.PropertyChanged += ElementPropertyChangedHandler;
}
示例7: SetProperties
protected override void SetProperties(ElementViewModel createdElement, Type selectedType)
{
base.SetProperties(createdElement, selectedType);
if (createdElement.ConfigurationType == typeof(KeyedHashAlgorithmProviderData))
{
createdElement.Property("Key").Value = keySettings;
}
}
示例8: GetExtendedProperties
/// <summary>
/// Returns the set of <see cref="Property"/> elements to add to the <see cref="ElementViewModel"/>.
/// </summary>
/// <param name="subject">The <see cref="ElementViewModel"/> to provide properties for.</param>
/// <returns>
/// Returns the set of additional <see cref="Property"/> items to add to the <paramref name="subject"/>.
/// </returns>
public IEnumerable<Property> GetExtendedProperties(ElementViewModel subject)
{
var attributesPropertyDescriptor = TypeDescriptor.GetProperties(subject.ConfigurationType).OfType<PropertyDescriptor>().FirstOrDefault(x => x.Name == "Attributes");
yield return subject.ContainingSection.CreateProperty<CustomAttributesProperty>(
new DependencyOverride<ElementViewModel>(subject),
new DependencyOverride<PropertyDescriptor>(attributesPropertyDescriptor));
}
示例9: Arrange
protected override void Arrange()
{
base.Arrange();
LoggingSectionViewModel = SectionViewModel.CreateSection(Container, LoggingSettings.SectionName, base.LoggingSection);
EmailTraceListener = LoggingSectionViewModel.GetDescendentsOfType<EmailTraceListenerData>().First();
}
示例10: Arrange
protected override void Arrange()
{
base.Arrange();
var namespacesCollection = (ElementCollectionViewModel)UnitySectionViewModel.ChildElement("Namespaces");
NamespaceElement = namespacesCollection.AddNewCollectionElement(typeof(NamespaceElement));
}
示例11: Arrange
protected override void Arrange()
{
base.Arrange();
var assembliesCollection = (ElementCollectionViewModel)UnitySectionViewModel.ChildElement("Assemblies");
AssemblyElement = assembliesCollection.AddNewCollectionElement(typeof(AssemblyElement));
}
示例12: Arrange
protected override void Arrange()
{
base.Arrange();
step = Container.Resolve<SelectDatabaseStep>();
connectionStringSettings = ConnectionStringSection.DescendentConfigurationsOfType<ConnectionStringSettings>().First();
}
示例13: Arrange
protected override void Arrange()
{
base.Arrange();
var loggingSection = SectionViewModel.CreateSection(Container, LoggingSettings.SectionName, base.LoggingSection);
TraceSource = loggingSection.GetDescendentsOfType<TraceSourceData>().First();
}
示例14: Arrange
protected override void Arrange()
{
base.Arrange();
ElementCollectionViewModel injectionMembersCollection = (ElementCollectionViewModel)RegistrationElement.ChildElement("InjectionMembers");
PropertyElement = injectionMembersCollection.AddNewCollectionElement(typeof(PropertyElement));
}
示例15: 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();
}