protected internal BaseScriptGenerator(IBackupRemoverViewModel model, IProfile profile) { _model = model; _profilesProvider = Create.New <IProfilesProvider>(); _serviceScriptGenerator = Create.WithCurrentProfile <IServiceScriptGenerator>(); _iisScriptGenerator = new IisScriptGenerator(); _filesScriptGenerator = new FilesScriptGenerator(); }
// copied from ProfilesPresenter public void CreateDummyProfile(IProfilesProvider profilesProvider) { var fakeLocalProfile = profilesProvider.CreateLocal(); fakeLocalProfile.ProfileName = Settings.ProfileNotCreated; fakeLocalProfile.Prefix = "Please submit the actual values instead"; profilesProvider.Add(fakeLocalProfile); profilesProvider.SelectProfile(fakeLocalProfile.ProfileName); }
public MainViewModel() { // Hook up Commands to associated methods OpenDownloadPageCommand = new DelegateCommand(o => Locator.UpdateService.OpenUpdatePage()); OpenHelpPageCommand = new DelegateCommand(o => Locator.HelpProvider.OpenHelpPage()); SwitchThemeCommand = new DelegateCommand(o => SwitchTheme()); NavigateToProfilesPageCommand = new DelegateCommand(o => NavigateToProfilesPage(o?.ToString() ?? Locator.FormattersViewModel.SelectedFormatter?.Name)); NavigateToFormatterPageCommand = new DelegateCommand(o => NavigateToFormatterPage(o?.ToString())); NavigateToExternalSourcesPageCommand = new DelegateCommand(o => NavigateToExternalSourcesPage()); _ProfilesProvider = Locator.ProfilesProvider; }
internal BaseBackupRestorePresenter(IBaseBackupRestoreView view) { _profileProvider = Create.New <IProfilesProvider>(); var profile = _profileProvider.SelectedProfile; _view = view; _view.FolderBrowserClicked += (sender, e) => e.Value1.Text = ShowFolderSelector(profile, e.Value2); _view.AppendEnvironmentToCaption(profile.WindowCaptionSuffix); _scriptWrapper = Create.WithParam(_view, d => d.ToString()); _remoteScriptCopier = Create.WithCurrentProfile <IRemoteScriptCopier>(_view); _siteProvider = Create.WithCurrentProfile <ISiteProvider>(_view); }
internal ScriptablePresenter(IMainView view) { // TODO: Review below _view = view; _profilesProvider = Create.New <IProfilesProvider>(); _settingsProvider = Create.New <ISettingsProvider>(); _containersProvider = Create.New <IContainersProvider>(); _view.ScriptFinishRequested += ScriptFinishRequested; _outputFormatter = new ConsoleOutputFormatter(); _genericTextFormatter = new GenericTextFormatter(); _progressFormatter = new ProgressFormatter(); _errorFormatter = new ErrorFormatter(); }
internal SqlSettingsPresenter(ISqlSettingsView sqlSettingsView) { _view = sqlSettingsView; _sqlService = Create.New <ISqlServerRecordProvider>(); _profilesProvider = Create.New <IProfilesProvider>(); _view.FormLoad += FormLoad; _view.TestClicked += TestClicked; _view.SelectedRecordChanged += SelectedRecordChanged; _view.SqlRecordAdded += SqlRecordAdded; _view.SqlRecordRenamed += SqlRecordRenamed; _view.SqlRecordDeleted += SqlRecordDeleted; _view.ClosingForm += ClosingForm; _scriptWrapper = Create.WithParam(_view, d => d); }
public ExternalSourcesViewModel(SettingViewModel setting, IProfilesProvider profilesProvider) { _setting = setting; _profilesProvider = profilesProvider; ExternalSourcesProfiles = new Dictionary <Guid, List <Profile> >(); if (_setting.ExternalSources == null) { _setting.ExternalSources = new List <ExternalSource>(); } _ExternalSources = new BindingList <ExternalSource>(); NavigateToProfilesPageCommand = new DelegateCommand(async o => await NavigateToProfilesPage(null)); SaveSourcesCommand = new DelegateCommand(async o => await SaveSources()); AddNewExternalSourceCommand = new DelegateCommand(o => AddNewExternalSource()); DeleteSourceCommand = new DelegateCommand(o => DeleteSource(o), c => { return(c is Guid id && ExternalSources.Any(x => x.Id == id)); }); }
public void ReloadFromSettings() { SimpleLogger.Log(SimpleLogLevel.Info, "ProfileProvider.ReloadFromSettings "); _profiles = Repository.Instance.Settings.ProfilesSettings; _activeProfile = null; }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="config"></param> public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { _providerName = name; _applicationName = config["applicationName"]; _enablePasswordRetrieval = bool.Parse(config["enablePasswordRetrieval"]); _enablePasswordReset = bool.Parse(config["enablePasswordReset"]); _requiresQuestionAndAnswer = bool.Parse(config["requiresQuestionAndAnswer"]); _requiresUniqueEmail = bool.Parse(config["requiresUniqueEmail"]); _maxInvalidPasswordAttempts = int.Parse(config["maxInvalidPasswordAttempts"]); _minRequiredPasswordLength = int.Parse(config["minRequiredPasswordLength"]); _minRequiredNonalphanumericCharacters = int.Parse(config["minRequiredNonalphanumericCharacters"]); _passwordAttemptWindow = int.Parse(config["passwordAttemptWindow"]); _profilesProvider = new ProvidersFactory().BuildProfilesProvider(); base.Initialize(name, config); }