public ExportInterceptingPropertyValueProviderAttribute(string propertyName, ExportInterceptingPropertyValueProviderFile file) : base(GetFile(file), typeof(IInterceptingPropertyValueProvider)) { Requires.NotNullOrEmpty(propertyName, nameof(propertyName)); PropertyName = propertyName; }
private static string GetFile(ExportInterceptingPropertyValueProviderFile file) { return(file switch { ExportInterceptingPropertyValueProviderFile.ProjectFile => ContractNames.ProjectPropertyProviders.ProjectFile, ExportInterceptingPropertyValueProviderFile.UserFile => ContractNames.ProjectPropertyProviders.UserFile, ExportInterceptingPropertyValueProviderFile.UserFileWithXamlDefaults => ContractNames.ProjectPropertyProviders.UserFileWithXamlDefaults, _ => string.Empty, });
private static string GetFile(ExportInterceptingPropertyValueProviderFile file) { switch (file) { case ExportInterceptingPropertyValueProviderFile.ProjectFile: return(ContractNames.ProjectPropertyProviders.ProjectFile); case ExportInterceptingPropertyValueProviderFile.UserFile: return(ContractNames.ProjectPropertyProviders.UserFile); case ExportInterceptingPropertyValueProviderFile.UserFileWithXamlDefaults: return(ContractNames.ProjectPropertyProviders.UserFileWithXamlDefaults); default: return(string.Empty); } }
/// <summary> /// Initializes a new instance of the <see cref="ExportInterceptingPropertyValueProviderAttribute"/> /// class for multiple intercepted properties. /// </summary> public ExportInterceptingPropertyValueProviderAttribute(string[] propertyNames, ExportInterceptingPropertyValueProviderFile file) : base(GetFile(file), typeof(IInterceptingPropertyValueProvider)) { PropertyNames = propertyNames; }
/// <summary> /// Initializes a new instance of the <see cref="ExportInterceptingPropertyValueProviderAttribute"/> /// class for a single intercepted property. /// </summary> public ExportInterceptingPropertyValueProviderAttribute(string propertyName, ExportInterceptingPropertyValueProviderFile file) : this(new[] { propertyName }, file) { }