public ServerSettingsViewModel (ISettingsFaultFinder settingsFaultFinder, ICurrentOptions currentOptions, IOutlookAccountPasswordProvider outlookAccountPasswordProvider)
    {
      if (settingsFaultFinder == null)
        throw new ArgumentNullException (nameof (settingsFaultFinder));
      if (currentOptions == null)
        throw new ArgumentNullException (nameof (currentOptions));

      _settingsFaultFinder = settingsFaultFinder;
      _currentOptions = currentOptions;
      _outlookAccountPasswordProvider = outlookAccountPasswordProvider;

      _testConnectionCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        TestConnectionAsync();
      });
      _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        GetAccountSettings();
      });
      _createDavResourceCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        CreateDavResource();
      });
    }
        public ServerSettingsViewModel(ISettingsFaultFinder settingsFaultFinder, ICurrentOptions currentOptions, IOutlookAccountPasswordProvider outlookAccountPasswordProvider)
        {
            if (settingsFaultFinder == null)
            {
                throw new ArgumentNullException(nameof(settingsFaultFinder));
            }
            if (currentOptions == null)
            {
                throw new ArgumentNullException(nameof(currentOptions));
            }

            _settingsFaultFinder            = settingsFaultFinder;
            _currentOptions                 = currentOptions;
            _outlookAccountPasswordProvider = outlookAccountPasswordProvider;

            _testConnectionCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                TestConnectionAsync();
            });
            _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                GetAccountSettings();
            });
            _createDavResourceCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                CreateDavResource();
            });
        }
Example #3
0
        public GoogleServerSettingsViewModel(OptionsModel model, IOptionTasks optionTasks, IViewOptions viewOptions)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }
            if (optionTasks == null)
            {
                throw new ArgumentNullException(nameof(optionTasks));
            }
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            _model                  = model;
            _optionTasks            = optionTasks;
            ViewOptions             = viewOptions;
            _doAutoDiscoveryCommand = new DelegateCommandWithoutCanExecuteDelegation(_ => DoAutoDiscovery());
            _testConnectionCommand  = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                TestConnectionAsync(CalenderUrl);
            });


            RegisterPropertyChangePropagation(_model, nameof(_model.CalenderUrl), nameof(CalenderUrl));
            RegisterPropertyChangePropagation(_model, nameof(_model.EmailAddress), nameof(EmailAddress));
            RegisterPropertyChangePropagation(_model, nameof(_model.UseGoogleNativeApi), nameof(UseGoogleNativeApi));
            RegisterPropertyChangePropagation(_model, nameof(_model.UseGoogleNativeApiAvailable), nameof(UseGoogleNativeApiAvailable));
        }
        public EasyProjectMultipleOptionsTemplateViewModel(
            IOptionsViewModelParent parent,
            IServerSettingsTemplateViewModel serverSettingsViewModel,
            IOptionTasks optionTasks,
            OptionsModel prototypeModel,
            IViewOptions viewOptions)
        {
            _parent = parent;
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (optionTasks == null)
            {
                throw new ArgumentNullException(nameof(optionTasks));
            }
            if (prototypeModel == null)
            {
                throw new ArgumentNullException(nameof(prototypeModel));
            }
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            _prototypeModel = prototypeModel;
            ViewOptions     = viewOptions;


            _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                DiscoverResourcesAsync();
            });

            _mergeResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                MergeResourcesAsync();
            });

            SelectFolderCommand = new DelegateCommand(_ => SelectFolder());

            _networkSettingsViewModel = new NetworkSettingsViewModel(_prototypeModel);
            Items = new[] { _networkSettingsViewModel };

            _serverSettingsViewModel = serverSettingsViewModel;
            _optionTasks             = optionTasks;

            var folder = _optionTasks.GetDefaultCalendarFolderOrNull();

            if (folder != null)
            {
                _selectedFolder    = folder;
                SelectedFolderName = folder.Name;
            }

            RegisterPropertyChangePropagation(_prototypeModel, nameof(_prototypeModel.Name), nameof(Name));
        }
        public MultipleOptionsTemplateViewModel(
            IOptionsViewModelParent parent,
            IServerSettingsTemplateViewModel serverSettingsViewModel,
            IOptionTasks optionTasks,
            OptionsModel prototypeModel,
            IViewOptions viewOptions)

        {
            _parent = parent;
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            if (optionTasks == null)
            {
                throw new ArgumentNullException(nameof(optionTasks));
            }
            if (prototypeModel == null)
            {
                throw new ArgumentNullException(nameof(prototypeModel));
            }
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            ViewOptions = viewOptions;

            _prototypeModel = prototypeModel;

            _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                DiscoverResourcesAsync();
            });

            _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                GetAccountSettings();
            });

            _networkSettingsViewModel = new NetworkSettingsViewModel(_prototypeModel);

            Items = new[] { _networkSettingsViewModel };

            _serverSettingsViewModel = serverSettingsViewModel;
            _optionTasks             = optionTasks;

            RegisterPropertyChangePropagation(_prototypeModel, nameof(_prototypeModel.Name), nameof(Name));
        }
    public GoogleServerSettingsViewModel (ISettingsFaultFinder settingsFaultFinder, ICurrentOptions currentOptions)
    {
      if (settingsFaultFinder == null)
        throw new ArgumentNullException (nameof (settingsFaultFinder));
      if (currentOptions == null)
        throw new ArgumentNullException (nameof (currentOptions));

      _settingsFaultFinder = settingsFaultFinder;
      _currentOptions = currentOptions;
      _currentOptions.OutlookFolderTypeChanged += CurrentOptions_OutlookFolderTypeChanged;
      _doAutoDiscoveryCommand = new DelegateCommandWithoutCanExecuteDelegation (_ => DoAutoDiscovery());
      _testConnectionCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        TestConnectionAsync (CalenderUrl);
      });
    }
        public MultipleOptionsTemplateViewModel(
            NameSpace session,
            IOptionsViewModelParent parent,
            GeneralOptions generalOptions,
            IServerSettingsTemplateViewModel serverSettingsViewModel,
            ProfileType profileType)

        {
            _parent  = parent;
            _session = session;
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (generalOptions == null)
            {
                throw new ArgumentNullException(nameof(generalOptions));
            }

            _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                DiscoverResourcesAsync();
            });

            _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                GetAccountSettings();
            });

            _networkSettingsViewModel = new NetworkSettingsViewModel();

            SubOptions = new[] { _networkSettingsViewModel };

            _serverSettingsViewModel = serverSettingsViewModel;
            _profileType             = profileType;
            _generalOptions          = generalOptions;
        }
        public ServerSettingsViewModel(ISettingsFaultFinder settingsFaultFinder, ICurrentOptions currentOptions)
        {
            if (settingsFaultFinder == null)
            {
                throw new ArgumentNullException(nameof(settingsFaultFinder));
            }
            if (currentOptions == null)
            {
                throw new ArgumentNullException(nameof(currentOptions));
            }

            _settingsFaultFinder   = settingsFaultFinder;
            _currentOptions        = currentOptions;
            _testConnectionCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                TestConnectionAsync();
            });
        }
Example #9
0
        public ServerSettingsViewModel(OptionsModel model, IOptionTasks optionTasks, IViewOptions viewOptions)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }
            if (optionTasks == null)
            {
                throw new ArgumentNullException(nameof(optionTasks));
            }
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            _model = model;

            _optionTasks = optionTasks;
            ViewOptions  = viewOptions;

            _testConnectionCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                TestConnectionAsync();
            });
            _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                _model.AutoFillAccountSettings();
            });
            _createDavResourceCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                CreateDavResource();
            });

            RegisterPropertyChangePropagation(_model, nameof(_model.CalenderUrl), nameof(CalenderUrl));
            RegisterPropertyChangePropagation(_model, nameof(_model.UserName), nameof(UserName));
            RegisterPropertyChangePropagation(_model, nameof(_model.Password), nameof(Password));
            RegisterPropertyChangePropagation(_model, nameof(_model.EmailAddress), nameof(EmailAddress));
            RegisterPropertyChangePropagation(_model, nameof(_model.UseAccountPassword), nameof(UseAccountPassword));
            RegisterPropertyChangePropagation(_model, nameof(_model.UseWebDavCollectionSync), nameof(UseWebDavCollectionSync));
        }
Example #10
0
        public GoogleServerSettingsViewModel(ISettingsFaultFinder settingsFaultFinder, ICurrentOptions currentOptions)
        {
            if (settingsFaultFinder == null)
            {
                throw new ArgumentNullException(nameof(settingsFaultFinder));
            }
            if (currentOptions == null)
            {
                throw new ArgumentNullException(nameof(currentOptions));
            }

            _settingsFaultFinder = settingsFaultFinder;
            _currentOptions      = currentOptions;
            _currentOptions.OutlookFolderTypeChanged += CurrentOptions_OutlookFolderTypeChanged;
            _doAutoDiscoveryCommand = new DelegateCommandWithoutCanExecuteDelegation(_ => DoAutoDiscovery());
            _testConnectionCommand  = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                TestConnectionAsync(CalenderUrl);
            });
        }
    public MultipleOptionsTemplateViewModel (
        IOptionsViewModelParent parent,
        GeneralOptions generalOptions,
        IServerSettingsTemplateViewModel serverSettingsViewModel,
        ProfileType profileType,
        IOptionTasks optionTasks)

    {
      _parent = parent;
      if (parent == null)
        throw new ArgumentNullException (nameof (parent));
      if (generalOptions == null)
        throw new ArgumentNullException (nameof (generalOptions));
      if (optionTasks == null) throw new ArgumentNullException(nameof(optionTasks));

      _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        DiscoverResourcesAsync();
      });

      _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        GetAccountSettings();
      });

      _networkSettingsViewModel = new NetworkSettingsViewModel();

      Items = new[] { _networkSettingsViewModel };

      _serverSettingsViewModel = serverSettingsViewModel;
      _profileType = profileType;
      _optionTasks = optionTasks;
      _generalOptions = generalOptions;
    }