Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExcelSettingsLoader"/> class.
        /// </summary>
        /// <param name="headerProcessor">Class responsible for processing the spreadsheet header.</param>
        /// <param name="dataProcessor">Class responsible for processing the spreadsheet data.</param>
        /// <param name="excelFileLoader">Class responsible for loading the spreadsheet and converting is contents into a dataset.</param>
        /// <param name="preferencesLoader">Class responsbile for loading preferences from spreadsheet, if any.</param>
        /// <param name="preferencesManager">Preferences manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if any argument is null</exception>
        public ExcelSettingsLoader(
            [NotNull] ISpreadsheetHeaderProcessor headerProcessor,
            [NotNull] ISpreadsheetDataProcessor dataProcessor,
            [NotNull] IExcelFileLoader excelFileLoader,
            [NotNull] ISpreadsheetPreferencesLoader preferencesLoader,
            [NotNull] IPreferencesManager preferencesManager)
        {
            if (headerProcessor == null)
            {
                throw new ArgumentNullException(nameof(headerProcessor));
            }
            if (dataProcessor == null)
            {
                throw new ArgumentNullException(nameof(dataProcessor));
            }
            if (excelFileLoader == null)
            {
                throw new ArgumentNullException(nameof(excelFileLoader));
            }
            if (preferencesLoader == null)
            {
                throw new ArgumentNullException(nameof(preferencesLoader));
            }
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }

            _headerProcessor    = headerProcessor;
            _dataProcessor      = dataProcessor;
            _excelFileLoader    = excelFileLoader;
            _preferencesLoader  = preferencesLoader;
            _preferencesManager = preferencesManager;
        }
        public MainViewModel(IPreferencesManager preferencesManager, 
                             IWindowFactory windowFactory, 
                             IDelegateCommand selectedPreferenceCommand, 
                             IDelegateCommand savePreferenceCommand,
                             IDelegateCommand saveAllCommand,
                             IDelegateCommand openFileCommand,
                             IPreferenceTypeViewModel preferenceTypeViewModel)
            : base()
        {
            _PreferencesManager = preferencesManager;
            _WindowFactory = windowFactory;
            _PreferenceTypeViewModel = preferenceTypeViewModel;

            selectedPreferenceCommand.ExecuteAction = p => SetSelectedPreference(p);
            savePreferenceCommand.ExecuteAction = p => SavePreference(p);
            saveAllCommand.ExecuteAction = p => SaveAll();
            openFileCommand.ExecuteAction = p => OpenFile();

            SelectedPreferenceCommand = selectedPreferenceCommand;
            SavePreferenceCommand = savePreferenceCommand;
            SaveAllCommand = saveAllCommand;
            OpenFileCommand = openFileCommand;

            Preferences = new ObservableCollection<IPreferenceViewModel>();
        }
Exemple #3
0
 public LoginService(
     ISecureChannelService securityService,
     IPreferencesManager preferencesManager,
     ICryptoService cryptoService)
 {
     _securityService    = securityService;
     _preferencesManager = preferencesManager;
     _cryptoService      = cryptoService;
 }
Exemple #4
0
        public TemplatePreferencesLoader([NotNull] IPreferencesManager preferencesManager)
        {
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }

            _preferencesManager = preferencesManager;
        }
Exemple #5
0
 public App(
     IKeyStorageContainer keyStorageContainer,
     IStorageContainer storageContainer,
     IPreferencesManager preferencesManager,
     IDeviceInformationService deviceInformationService)
 {
     Mvx.RegisterSingleton(keyStorageContainer);
     Mvx.RegisterSingleton(storageContainer);
     Mvx.RegisterSingleton(preferencesManager);
     Mvx.RegisterSingleton(deviceInformationService);
 }
 public RazorTemplate(
     [NotNull] ITokenUsageTracker tokenUsageTracker,
     [NotNull] IPreferencesManager preferencesManager)
 {
     if (tokenUsageTracker == null)
     {
         throw new ArgumentNullException(nameof(tokenUsageTracker));
     }
     if (preferencesManager == null)
     {
         throw new ArgumentNullException(nameof(preferencesManager));
     }
     _tokenUsageTracker  = tokenUsageTracker;
     _preferencesManager = preferencesManager;
 }
        public static IPreferencesManager ApplyPreference([NotNull] this IPreferencesManager preferencesManager, string preferenceName, string preferenceValue)
        {
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }
            var errors = preferencesManager.ApplyPreferences(new[] { new KeyValuePair <string, string>(preferenceName, preferenceValue) }).ToArray();

            if (errors.Any())
            {
                throw new TestSetupException("One or more errors occurred during test setup while applying preferences", errors);
            }

            return(preferencesManager);
        }
        public FileOutputWriter(
            [NotNull] IStreamComparer streamComparer,
            [NotNull] IPreferencesManager preferencesManager)
        {
            if (streamComparer == null)
            {
                throw new ArgumentNullException(nameof(streamComparer));
            }
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }

            _streamComparer     = streamComparer;
            _preferencesManager = preferencesManager;
        }
        public PostProcessorPipeline(
            [NotNull] IPreferencesManager preferencesManager,
            [NotNull] XmlPrettyPrintPostProcessor prettyPrintProcessor)
        {
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }
            if (prettyPrintProcessor == null)
            {
                throw new ArgumentNullException(nameof(prettyPrintProcessor));
            }

            _preferencesManager   = preferencesManager;
            _prettyPrintProcessor = prettyPrintProcessor;
        }
        public XmlPrettyPrintPostProcessor(
            [NotNull] IXmlStreamFormatter prettyPrintFormatter,
            [NotNull] IPreferencesManager preferencesManager)
        {
            if (prettyPrintFormatter == null)
            {
                throw new ArgumentNullException(nameof(prettyPrintFormatter));
            }
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }

            _prettyPrintFormatter = prettyPrintFormatter;
            _preferencesManager   = preferencesManager;
        }
        public ConfigurationGenerator(
            [NotNull] IPreferencesManager preferencesManager,
            [NotNull] TemplateFactory templateFactory,
            [NotNull] ConfigurationCollectionLoaderFactory configurationCollectionLoaderFactory,
            [NotNull] IConfigurationFactory configurationFactory,
            [NotNull] ConfigurationCollectionFilter configurationCollectionFilter,
            [NotNull] IPostProcessorPipeline postProcessorPipeline,
            [NotNull] FileOutputWriter fileOutputWriter)
        {
            if (templateFactory == null)
            {
                throw new ArgumentNullException(nameof(templateFactory));
            }
            if (configurationCollectionLoaderFactory == null)
            {
                throw new ArgumentNullException(nameof(configurationCollectionLoaderFactory));
            }
            if (configurationFactory == null)
            {
                throw new ArgumentNullException(nameof(configurationFactory));
            }
            if (configurationCollectionFilter == null)
            {
                throw new ArgumentNullException(nameof(configurationCollectionFilter));
            }
            if (postProcessorPipeline == null)
            {
                throw new ArgumentNullException(nameof(postProcessorPipeline));
            }
            if (fileOutputWriter == null)
            {
                throw new ArgumentNullException(nameof(fileOutputWriter));
            }
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }

            _templateFactory = templateFactory;
            _configurationCollectionLoaderFactory = configurationCollectionLoaderFactory;
            _configurationFactory          = configurationFactory;
            _configurationCollectionFilter = configurationCollectionFilter;
            _postProcessorPipeline         = postProcessorPipeline;
            _fileOutputWriter   = fileOutputWriter;
            _preferencesManager = preferencesManager;
        }
        public GenerationService(
            [NotNull] IConfigurationGenerator generator,
            [NotNull] IPreferencesManager preferencesManager,
            [NotNull] ITokenUsageTracker tokenUsageTracker)
        {
            if (generator == null)
            {
                throw new ArgumentNullException(nameof(generator));
            }
            if (preferencesManager == null)
            {
                throw new ArgumentNullException(nameof(preferencesManager));
            }
            if (tokenUsageTracker == null)
            {
                throw new ArgumentNullException(nameof(tokenUsageTracker));
            }

            _generator          = generator;
            _preferencesManager = preferencesManager;
            _tokenUsageTracker  = tokenUsageTracker;
        }
 public ApiController([NotNull] IPreferencesManager preferences)
 {
     _Preferences = preferences ?? throw new ArgumentNullException(nameof(preferences));
 }