public SettingsMgrPresenter(ISettingsMgr mgr, ISettingsView view) { View = view; Mgr = mgr; if (Mgr != null && View != null) UpdateValuesInView(); }
public SettingsPresenter(ISettingsView view, ISettingsManager settingsManager) { View = view; _settingsManager = settingsManager; RegisterEvents(); }
public SettingsPresenter( ISettingsModel model, ISettingsView view) : base(model, view) { Initialize(); }
/// <summary> /// Конструктор /// </summary> /// <param name="orderListView">Список заказов</param> /// <param name="settingsView">Настройки приложения</param> public MainView(IOrderListView orderListView, ISettingsView settingsView) { InitializeComponent(); this.MinimumSize = new Size(1024, 768); this.Text = string.Empty; CreateController(); _orderListView = orderListView; _settingsView = settingsView; this.WindowState = FormWindowState.Maximized; tabControl.Appearance = TabAppearance.FlatButtons; tabControl.ItemSize = new Size(0, 1); tabControl.SizeMode = TabSizeMode.Fixed; tabControl.Dock = DockStyle.Fill; tabControl.TabPages.Clear(); for (var i = 0; i < this.ribbonControl.Pages.Count; i++) { tabControl.TabPages.Add(""); tabControl.TabPages[i].Dock = DockStyle.Fill; } tabControl.TabPages[0].Controls.Add(orderListView as Control); tabControl.TabPages[2].Controls.Add(settingsView as Control); orderListView.Controller.LoadView(); BarCreator.CreateBars(rpOrders, orderListView.Controller.GetCommands(), item_ItemClick); }
/// <summary> /// Constructor that stores a reference to the parent settings object to be used when loading and saving the settings. /// </summary> /// <param name="parent"></param> public KeyCommandSettingsControl(ISettingsView parent) : base(parent) { InitializeComponent(); this.commands = new Dictionary <ListViewItem, KeyCommandEntry>(); }
public SettingsViewController(ISettingsView iSettingsView, IAccountAlarmView iAccountAlarmView) { this.iSettingsView = iSettingsView; this.iAccountAlarmView = iAccountAlarmView; initialize(); }
public SettingsViewPresenter(ISettingsView view, ProxyInformation proxyInformation) { this.view = view; this.proxyInformation = proxyInformation; view.Presenter = this; }
public void Init() { _fakeView = Substitute.For <ISettingsView>(); _fakeModel = Substitute.For <ISettingsModel>(); _fakeUserPreference = Substitute.For <IUserPreference>(); _uut = new SettingsPresenter(_fakeView, _fakeModel, _fakeUserPreference); }
/// <summary> /// Initializes a new instance of the <see cref="SettingsViewPresentationModel"/> class. /// </summary> /// <param name="view">The <see cref="ISettingsView"/> view instance.</param> /// <param name="eventAggregator">The <seealso cref="IEventAggregator"/> service used to publish and subscribe to events.</param> /// <param name="projectService">The <see cref="IProjectService"/> service instance used to save the current project.</param> /// <param name="regionManager">The <see cref="IRegionManager"/>.</param> public SettingsViewPresentationModel(ISettingsView view, IEventAggregator eventAggregator, IProjectService projectService, IRegionManager regionManager) { this.eventAggregator = eventAggregator; this.projectService = projectService; this.regionManager = regionManager; this.timer = new DispatcherTimer(); this.timer.Tick += (sender, e) => this.SaveProject(); this.deleteThumbnailCommand = new DelegateCommand <object>(this.DeleteThumbnail, this.CanDeleteThumbnail); this.pickThumbnailCommand = new DelegateCommand <object>(this.PickThumbnail); this.SmpteTimeCodeValues = new List <string> { "SMPTE Non-Drop", "SMPTE Drop", "SMPTE 30", "SMPTE EBU", "SMPTE Film Sync", "SMPTE Film Sync IVTC", "Seconds" }; this.EditModeValues = new List <string> { "Gap Mode", "Ripple Mode" }; this.eventAggregator.GetEvent <EditModeChangedEvent>().Subscribe(this.SetEditingMode, true); this.eventAggregator.GetEvent <ThumbnailEvent>().Subscribe(this.SetThumbnail, true); this.PropertyChanged += this.SettingsViewPresentationModel_PropertyChanged; this.IsAspectRatio169Selected = true; this.LoadSettings(); this.View = view; this.View.Model = this; }
public SoundSettingsControl(ISettingsView parent) : base(parent) { InitializeComponent(); this.uiNewFollowerSoundTriggerControl.Initialize(parent); this.uiNewSubscriberSoundTriggerControl.Initialize(parent); this.uiReSubscriberSoundTriggerControl.Initialize(parent); }
public void Init() { mocks = new MockRepository(); config = mocks.StrictMock<IUserConfiguration>(); factory = mocks.Stub<IViewFactory>(); view = MockRepository.GenerateStub<ISettingsView>(); ClientServiceLocator.Register(config); }
public void Init() { mocks = new MockRepository(); config = mocks.StrictMock <IUserConfiguration>(); factory = mocks.Stub <IViewFactory>(); view = MockRepository.GenerateStub <ISettingsView>(); ClientServiceLocator.Register(config); }
public SettingsPresenter(ISettingsView view, ISettingsSerializer settingsSerializer) { _settingsSerializer = settingsSerializer; _view = view; _view.CurrentSettings = _settingsSerializer.Deserialize(); _view.SettingsChanged += HandleSettingsChanged; }
public SettingsController(ISettingsRepository repository, ISettingsView view) { this.repository = repository; this.view = view; view.SettingChanged += ViewOnSettingChanged; view.OKClicked += ViewOnOKClicked; }
public SettingsPresenter(ISettingsView view, ISettingsSerializer settingsSerializer) { _settingsSerializer = settingsSerializer; _view = view; _view.CurrentSettings = _settingsSerializer.Deserialize(); _view.SettingsChanged += HandleSettingsChanged; }
/// <summary> /// Constructor that initializes the view and sets up this settings control to talk back to the parent view. /// </summary> /// <param name="parent">Parent view that will house this settings control.</param> public TwitchChannelSettings(ISettingsView parent) : base(parent) { InitializeComponent(); this.userProfiles = new List <UserProfile>(); this.uiAuthenticationStatusLabel.Text = ""; this.uiChannelsListView.Focus(); }
private void OnDataChanged(object sender, System.EventArgs e) { ISettingsView view = base._view as ISettingsView; ISettingsModel model = base._model as ISettingsModel; PresenterBase.SetModelPropertiesFromView <ISettingsModel, ISettingsView>( ref model, view ); }
public ISettingsMgrPresenter Create(ISettingsMgr mgr, ISettingsView view) { ISettingsMgrPresenter presenter = null; if (mgr!=null && view!=null) { presenter = new SettingsMgrPresenter(mgr, view); } return presenter; }
public SmokoPresenter(ISettingsView view, ICommunication communication) { _view = view; _view.ViewLoaded += ViewLoaded; _view.InviteRequested += InviteRequested; _communication = communication; _communication.DataReceived += DataReceived; }
public SettingsViewModel(IUnityContainer container, ISettingsView view, ISettingsModel model) : base(container) { this.Initialize(); this.Model = model; _view = view; this._view.DataContext = this; this._view.ShowDialog(); }
/// <summary> /// Constructor that initializes the view and sets up this settings control to talk back to the parent view. /// </summary> /// <param name="parent">Parent view that will house this settings control.</param> public SubscriberSettingsControl(ISettingsView parent) : base(parent) { InitializeComponent(); this.uiEnableAdsCheckBox.CheckedChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiBreakLengthComboBox.SelectedIndexChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiBreakTypeComboBox.SelectedIndexChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiAutoComboBox.SelectedIndexChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiWarningTimeNumericUpDown.ValueChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; }
protected override void WireViewEvents() { if (!IsViewEventsWired) { ISettingsView view = base._view as ISettingsView; view.DataChanged += OnDataChanged; view.CommandApplySettings += OnCommandApplySettings; view.CommandCancelSettings += OnCommandCancelSettings; IsViewEventsWired = true; } }
protected override void UnWireViewEvents() { if (IsViewEventsWired) { ISettingsView view = base._view as ISettingsView; view.DataChanged -= OnDataChanged; view.CommandApplySettings -= OnCommandApplySettings; view.CommandCancelSettings -= OnCommandCancelSettings; IsViewEventsWired = false; } }
public SettingsViewModel(IUnityContainer container, ISettingsView view, ISettingsModel model) : base(container) { this.Initialize(); this.Model = model; _view = view; this._view.DataContext = this; this._view.ShowDialog(); }
protected override void Context() { _subPresenterManager = SubPresenterHelper.Create <ISettingsItemPresenter>(); _userSettings = _subPresenterManager.CreateFake(SettingsItems.UserGeneralSettings); _appSettings = _subPresenterManager.CreateFake(SettingsItems.ApplicationSettings); _userDisplayUnitSettings = _subPresenterManager.CreateFake(SettingsItems.UserDisplayUnitsSettings); _dialogCreator = A.Fake <IDialogCreator>(); _workspace = A.Fake <ICoreWorkspace>(); _view = A.Fake <ISettingsView>(); sut = new SettingsPresenter(_view, _subPresenterManager, _dialogCreator, _workspace); }
public void ShowView() { _view = ObjectRegistry.Create<ISettingsView>(); _viewModel = ObjectRegistry.Create<SettingsViewModel>(); _viewModel.Presenter = this; var settings = _settingsService.Load(); _viewModel.FromSettings(settings); _view.ShowView(_viewModel); }
public IrcFontsAndColorsSettingsControl(ISettingsView parent) : base(parent) { InitializeComponent(); this.uiTextColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; this.uiBackColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; this.uiModColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; this.uiStatusColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; this.uiErrorColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; this.uiTimestampColorButton.Click += (sender, e) => { this.PromptForColor(sender as Button); }; }
public void ShowSettings(IWin32Window owner) { ISettingsView view = base._view as ISettingsView; IWin32Window parent = owner; if (SyncContext != null) { SyncContext.Post(delegate { view.LoadSettingValues(); view.ShowView(parent); }, null); } }
public SettingsPresenter(ISettingsView view, ISettingsService settings) { this.view = view; this.settings = settings; this.view.SpellEditorPath = settings.SpellEditorPath; this.view.FontSizeName = GetFontSizeName(settings.FontSize); this.view.BrowseEditor += View_BrowseEditor; this.view.Exit += View_Exit; this.view.IncreaseFontSize += View_IncreaseFontSize; this.view.DecreaseFontSize += View_DecreaseFontSize; }
public SettingsPresenter(ISettingsView view, IConfigurationService<SourceControlConfiguration> configService, IFolderBrowserFactory folderBrowserFactory) { _configurationService = configService; _folderBrowserFactory = folderBrowserFactory; _view = view; _view.BrowseDefaultRepositoryLocation += OnBrowseDefaultRepositoryLocation; _view.Cancel += OnCancel; _view.EditIgnoreFile += OnEditIgnoreFile; _view.EditAttributesFile += OnEditAttributesFile; _view.Save += OnSave; }
protected override void Initialize() { ConfigurationManager.RefreshSection("configuration"); FileUtil.ResetConfigMechanism(); GetConfigSettings(); ISettingsView view = base._view as ISettingsView; ISettingsModel model = base._model as ISettingsModel; PresenterBase.SetViewPropertiesFromModel <ISettingsView, ISettingsModel>( ref view, model ); }
private void OnCommandCancelSettings(object sender, System.EventArgs e) { ISettingsView view = base._view as ISettingsView; IMainPresenter presenter = SimpleResolver.Instance.Get <IMainPresenter>(); if (SyncContext != null) { SyncContext.Post(delegate { view.HideView(); presenter.UpdateProgressInfo("Settings Update Cancelled"); }, null); } }
public SettingsPresenter(ISettingsView view, IConfigurationService <SourceControlConfiguration> configService, IFolderBrowserFactory folderBrowserFactory) { _configurationService = configService; _folderBrowserFactory = folderBrowserFactory; _view = view; _view.BrowseDefaultRepositoryLocation += OnBrowseDefaultRepositoryLocation; _view.Cancel += OnCancel; _view.EditIgnoreFile += OnEditIgnoreFile; _view.EditAttributesFile += OnEditAttributesFile; _view.Save += OnSave; }
public SettingsPresenter(IKernel kernel, ISettingsView view, ISettingsService service, Settings settings) { _kernel = kernel; _view = view; _service = service; _settings = settings; _view.GoToScenario += _GoToScenario; _view.ImportSettings += _ImportSettings; _view.ExportSettings += _ExportSettings; _view.ApplySettings += _ApplySettings; _view.SettingsChanged += _SettingsChanged; _view.SettingsUpdated += _SettingsUpdated; }
/// <summary> /// Initializes a new instance of the <see cref="SettingsViewPresentationModel"/> class. /// </summary> /// <param name="view">The <see cref="ISettingsView"/> view instance.</param> /// <param name="eventAggregator">The <seealso cref="IEventAggregator"/> service used to publish and subscribe to events.</param> /// <param name="projectService">The <see cref="IProjectService"/> service instance used to save the current project.</param> /// <param name="regionManager">The <see cref="IRegionManager"/>.</param> /// <param name="userSettingsService">The <see cref="IUserSettingsService"/>.</param> /// <param name="persistenceService"></param> /// <param name="configurationService"></param> public SettingsViewPresentationModel(ISettingsView view, IEventAggregator eventAggregator, IProjectService projectService, IRegionManager regionManager, IUserSettingsService userSettingsService, IPersistenceService persistenceService, IConfigurationService configurationService) { this.eventAggregator = eventAggregator; this.projectService = projectService; this.regionManager = regionManager; this.userSettingsService = userSettingsService; this.persistenceService = persistenceService; this.configurationService = configurationService; this.selectedAutoSaveTimeInterval = 180; this.timer = new DispatcherTimer(); this.timer.Tick += (sender, e) => this.SaveProject(); this.deleteThumbnailCommand = new DelegateCommand <object>(this.DeleteThumbnail, this.CanDeleteThumbnail); this.pickThumbnailCommand = new DelegateCommand <object>(this.PickThumbnail); this.IncreaseStorageQuotaCommand = new DelegateCommand <object>(this.IncreaseStorageQuota); this.ClearStorageCommand = new DelegateCommand <object>(this.ClearStorage); this.ApplyKeyboardMappingCommand = new DelegateCommand <object>(this.ApplyKeyboardMapping); this.KeyboardActionCommand = new DelegateCommand <Tuple <KeyboardAction, object> >(this.ExecuteKeyboardAction); this.ResetWindowsCommand = new DelegateCommand <object>(this.RaiseResetWindows); this.RefreshStorageSize(); this.SmpteTimeCodeValues = new List <string> { "SMPTE Non-Drop", "SMPTE Drop", "SMPTE 30", "SMPTE EBU", "SMPTE Film Sync", "SMPTE Film Sync IVTC", "Seconds" }; this.EditModeValues = new List <string> { "Gap Mode", "Ripple Mode" }; this.KeyboardMappings = this.configurationService.GetKeyboardMappings(); this.eventAggregator.GetEvent <EditModeChangedEvent>().Subscribe(this.SetEditingMode, true); this.eventAggregator.GetEvent <ThumbnailEvent>().Subscribe(this.SetThumbnail, ThreadOption.PublisherThread, true, this.FilterAddThumbnailEvent); this.eventAggregator.GetEvent <ResetWindowsEvent>().Subscribe(this.ResetWindow); this.PropertyChanged += this.SettingsViewPresentationModel_PropertyChanged; this.IsAspectRatio169Selected = true; this.treatGapAsError = this.configurationService.GetTreatGapAsError(); this.LoadSettings(); this.View = view; this.View.IsActiveChanged += (sender, e) => this.RefreshStorageSize(); this.UserSettings = this.userSettingsService.GetSettings(); this.View.Model = this; }
private void settingsToolStripMenuItem_Click(object sender, System.EventArgs e) { ISettingsView sView = FrmSettings.Instance; new SettingsPresenter(_sModel, sView); if (sView.Visible != true) { sView.Show(); } else { sView.BringToFront(); } }
public void Initialize(ISettingsView parent) { this.ParentView = parent; this.uiPlaySoundFileRadioButton.CheckedChanged += (sender, e) => { this.ToggleRadioButtonControls(); }; this.uiPlaySoundDirectoryRadioButton.CheckedChanged += (sender, e) => { this.ToggleRadioButtonControls(); }; this.uiNoSoundRadioButton.CheckedChanged += (sender, e) => { this.ToggleRadioButtonControls(); }; this.uiSoundDirectoryTextBox.TextChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiSoundFileTextBox.TextChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.uiVolumeTrackBar.ValueChanged += (sender, e) => { this.ParentView.ChangeDetected(); }; this.ToggleRadioButtonControls(); }
public void ChangeSettings(ISettingsView settingsView) { SettingsViewPresenter settingsViewPresenter = new SettingsViewPresenter(settingsView, Program.GetProxyInfo()); settingsViewPresenter.Port = listener.Port; settingsViewPresenter.IgnoredUsedPort = listener.Port; settingsViewPresenter.Show(); if ((!settingsViewPresenter.Canceled) && (SettingsHaveChanged(settingsViewPresenter))) { Program.SaveSettings(settingsViewPresenter.ProxyInformation, settingsViewPresenter.Port); ApplyNewSettings(settingsViewPresenter.ProxyInformation, settingsViewPresenter.Port); } }
public MainWindow(IDatabaseView databaseView, IUpdaterView updaterView, ISettingsView settingsView, AppSettings options) { InitializeComponent(); this.databaseView = databaseView; DatabaseViewControl.Content = databaseView; this.updaterView = updaterView; UpdaterViewControl.Content = updaterView; this.settingsView = settingsView; SettingsViewControl.Content = settingsView; this.settings = options; }
public ToolbarController(IRegionManager regionManager, ISchedulerProvider schedulerProvider, IPersonalizationSettings settings, ISettingsView settingsView, IConnectivitySettingsView connectivitySettingsView, IAccountSettingsView accountSettingsView, IDemoView demoView) { _regionManager = regionManager; _schedulerProvider = schedulerProvider; _settings = settings; _settingsView = settingsView; _connectivitySettingsView = connectivitySettingsView; _accountSettingsView = accountSettingsView; _demoView = demoView; _taskTaskbarIcon = new TaskbarIcon(); }
public SettingsPresenter(ISettingsView view) { this.view = view; try { xmlService = new XmlService(); webClientService = new WebClientService(); openWeatherService = new OpenWeatherService(); dbContext = new MeteoContext(); locationRepository = new EfRepository<Location>(dbContext); weatherForecastRepository = new EfRepository<WeatherForecast>(dbContext); meteoService = new MeteoService(locationRepository, weatherForecastRepository); } catch (Exception ex) { throw; } }
public SourceControlPanel(IBranchesView branchesView, IChangesView changesView, IUnsyncedCommitsView commitsView, ISettingsView settingsView, IFailedMessageView failedActionView) :this() { SecondaryPanelVisible = false; ((Control)branchesView).Dock = DockStyle.Fill; ((Control)changesView).Dock = DockStyle.Fill; ((Control)commitsView).Dock = DockStyle.Fill; ((Control)settingsView).Dock = DockStyle.Fill; ((Control)failedActionView).Dock = DockStyle.Fill; this.BranchesTab.Controls.Add((Control)branchesView); this.ChangesTab.Controls.Add((Control)changesView); this.UnsyncedCommitsTab.Controls.Add((Control)commitsView); this.SettingsTab.Controls.Add((Control)settingsView); this.MainContainer.Panel1.Controls.Add((Control)failedActionView); SetText(); }
internal void _View_ResetItems(ISettingsView sender, ResetItemsEventArgs ea) { if (sender != null) ResetItems(ea.ItemNames); }
public SettingsPresenter(ISettingsModel model, ISettingsView view) : base(model, view) { Initialize(); }
internal void _View_ApplyChanges(ISettingsView sender, ApplyChangesEventArgs ea) { if (sender != null) ApplyChanges(sender.Values); }
public ParentPresenter(IDataModel dataModel, IParentView parentView, ILoginUserView loginUserView, ICreateUserView createUserView, IWallView wallView, ISettingsView settingView, IAboutView aboutView) { serverRequest = new MyServerRequest(); this.dataModel = dataModel; this.parentView = parentView; this.parentView.InvertVisibility += this.OnInvertVisibility; this.parentView.SettingsClicked += this.OnSettingsClicked; this.parentView.AboutClicked += this.OnAboutClicked; this.parentView.ExitClicked += this.OnExitClicked; this.loginUserView = loginUserView; this.loginUserView.LoginUserClicked += this.OnLoginUserClicked; this.loginUserView.LoginUserOfflineClicked += this.OnLoginUserOfflineClicked; this.loginUserView.GoToCreateUserClicked += this.OnGoToCreateUserClicked; this.loginUserView.LoginUsernameChanged += this.OnLoginUsernameChanged; this.createUserView = createUserView; this.createUserView.CreateUserClicked += this.OnCreateUserClicked; this.createUserView.GoToLoginUserClicked += this.OnGoToLoginUserClicked; this.wallView = wallView; this.wallView.NewWallClicked += this.OnNewWallClicked; this.wallView.NewMessageClicked += this.OnNewMessageClicked; this.wallView.NewWallSelected += this.OnNewWallSelected; this.wallView.RefreshWallsClicked += this.OnRefreshWallsClicked; this.wallView.WallsAutoRefresh += this.OnRefreshWallsClicked; this.settingView = settingView; this.settingView.ShowNotificationChanged += this.OnShowNotificationChanged; this.settingView.RefreshMinutesChanged += this.OnRefreshMinutesChanged; this.settingView.RefreshSecondsChanged += this.OnRefreshSecondsChanged; this.settingView.GoToPreviousView += this.OnGoToPreviousView; this.aboutView = aboutView; this.aboutView.GoToPreviousView += this.OnGoToPreviousView; this.aboutView.AuthorWebLinkClicked += this.OnAuthorWebLinkClicked; this.aboutView.CodeWebLinkClicked += this.OnCodeWebLinkClicked; //load model data dataModel.LoadDataModel(); //set settings on loginView if (dataModel.Settings.RememberUser) { loginUserView.RememberUser = true; if (!string.IsNullOrEmpty(dataModel.User.username)) { loginUserView.Username = dataModel.User.username; loginUserView.LoginOfflineVisible = true; loginUserView.SetPasswordFocus(); } else { loginUserView.SetUsernameFocus(); } } else { loginUserView.RememberUser = false; loginUserView.SetUsernameFocus(); } //load loginUSerView parentView.CurrentChildView = this.loginUserView; }
public SettingsPresenter(ISettingsView aView, IApplicationSettings settings) { _view = aView; _settings = settings; }
public SettingsPresenter(ISettingsView view, SettingsDto settingsToLoad) { this.view = view; this.settingsToLoad = settingsToLoad; }
public void SetUp() { repository = MockRepository.GenerateMock<ISettingsRepository>(); view = MockRepository.GenerateMock<ISettingsView>(); controller = new SettingsController(repository, view); }
internal ISettingsMgrPresenter CreateSettingsMgrPresenter(ISettingsMgr mgr, ISettingsView view) { ISettingsMgrPresenter presenter = null; using (SettingsMgrPresenterFactory fac = new SettingsMgrPresenterFactory()) { presenter = fac.Create(mgr, view); } return presenter; }
public SettingsPresenter CreateSettingsPresenter(ISettingsView settingsView) { return new SettingsPresenter(settingsView, _storageManager, _repositoryFactory, _configurationManager, _navigator, _localizationManager); }
public SettingsPresenter(ISettingsView view) { View = view; }