示例#1
0
        public ExportInterceptingPropertyValueProviderAttribute(string propertyName, ExportInterceptingPropertyValueProviderFile file)
            : base(GetFile(file), typeof(IInterceptingPropertyValueProvider))
        {
            Requires.NotNullOrEmpty(propertyName, nameof(propertyName));

            PropertyName = propertyName;
        }
示例#2
0
        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,
            });
示例#3
0
        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);
            }
        }
示例#4
0
 /// <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;
 }
示例#5
0
 /// <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)
 {
 }