CalDavSynchronizer.Ui.Options.ViewModels.OptionsCollectionViewModel.OptionsCollectionViewModel C# (CSharp) Method

OptionsCollectionViewModel() public method

public OptionsCollectionViewModel ( GeneralOptions generalOptions, IOutlookAccountPasswordProvider outlookAccountPasswordProvider, IReadOnlyList availableEventCategories, string>.Func profileDataDirectoryFactory, IUiService uiService, IOptionTasks optionTasks ) : System
generalOptions CalDavSynchronizer.Contracts.GeneralOptions
outlookAccountPasswordProvider IOutlookAccountPasswordProvider
availableEventCategories IReadOnlyList
profileDataDirectoryFactory string>.Func
uiService IUiService
optionTasks IOptionTasks
return System
    public OptionsCollectionViewModel (
      GeneralOptions generalOptions,
      IOutlookAccountPasswordProvider outlookAccountPasswordProvider, 
      IReadOnlyList<string> availableEventCategories, 
      Func<Guid, string> profileDataDirectoryFactory,
      IUiService uiService,
      IOptionTasks optionTasks)
    {
      _optionTasks = optionTasks;
      _profileDataDirectoryFactory = profileDataDirectoryFactory;
      _uiService = uiService;
      if (generalOptions == null)
        throw new ArgumentNullException (nameof (generalOptions));
      if (profileDataDirectoryFactory == null)
        throw new ArgumentNullException (nameof (profileDataDirectoryFactory));
      if (optionTasks == null) throw new ArgumentNullException(nameof(optionTasks));

      _generalOptions = generalOptions;


      _optionsViewModelFactory = new OptionsViewModelFactory (
        this,
        outlookAccountPasswordProvider,
        availableEventCategories,
        optionTasks);
      AddCommand = new DelegateCommand (_ => Add());
      AddMultipleCommand = new DelegateCommand (_ => AddMultiple());
      CloseCommand = new DelegateCommand (shouldSaveNewOptions => Close((bool)shouldSaveNewOptions));
      DeleteSelectedCommand = new DelegateCommandHandlingRequerySuggested (_ => DeleteSelected (), _ => CanDeleteSelected);
      CopySelectedCommand = new DelegateCommandHandlingRequerySuggested (_ => CopySelected (), _ => CanCopySelected);
      MoveSelectedUpCommand = new DelegateCommandHandlingRequerySuggested (_ => MoveSelectedUp (), _ => CanMoveSelectedUp);
      MoveSelectedDownCommand = new DelegateCommandHandlingRequerySuggested (_ => MoveSelectedDown (), _ => CanMoveSelectedDown);
      OpenProfileDataDirectoryCommand = new DelegateCommandHandlingRequerySuggested (_ => OpenProfileDataDirectory (), _ => CanOpenProfileDataDirectory);
      ExpandAllCommand = new DelegateCommandHandlingRequerySuggested (_ => ExpandAll (), _ => _options.Count > 0);
      CollapseAllCommand = new DelegateCommandHandlingRequerySuggested (_ => CollapseAll (), _ => _options.Count > 0);
      ExportAllCommand = new DelegateCommandHandlingRequerySuggested (_ => ExportAll (), _ => _options.Count > 0);
      ImportCommand = new DelegateCommandHandlingRequerySuggested (_ => Import (), _ => true);
    }