示例#1
0
    private IOptionsViewModel Create (CalDavSynchronizer.Contracts.Options options, GeneralOptions generalOptions)
    {
            Func<ISettingsFaultFinder, ICurrentOptions, IServerSettingsViewModel> serverSettingsVM;
            if (IsGoogleProfile(options))
            {
                serverSettingsVM = CreateGoogleServerSettingsViewModel;
            }
            else if (IsSwisscomProfile(options))
            {
                serverSettingsVM = CreateSwisscomServerSettingsViewModel;
            }
            else
            {
                serverSettingsVM = new Func<ISettingsFaultFinder, ICurrentOptions, IServerSettingsViewModel>(CreateServerSettingsViewModel);
            }

            var optionsViewModel = new GenericOptionsViewModel (
          _optionsViewModelParent,
          generalOptions,
          _outlookAccountPasswordProvider,
          serverSettingsVM,
          CreateMappingConfigurationViewModelFactory, _optionTasks);

      optionsViewModel.SetOptions (options);
      return optionsViewModel;
    }
        private IOptionsViewModel Create(CalDavSynchronizer.Contracts.Options options, GeneralOptions generalOptions)
        {
            var optionsViewModel = new GenericOptionsViewModel(
                _session,
                _optionsViewModelParent,
                generalOptions,
                _outlookAccountPasswordProvider,
                IsGoogleProfile(options)
              ? CreateGoogleServerSettingsViewModel
              : new Func <ISettingsFaultFinder, ICurrentOptions, IServerSettingsViewModel> (CreateServerSettingsViewModel),
                CreateMappingConfigurationViewModelFactory);

            optionsViewModel.SetOptions(options);
            return(optionsViewModel);
        }