private void HandleMainWindowActions(IMainFormView form) { //TODO: export Listing of maps to CollectionTextPresenter(and refactor it as needed) form.SidePanelView.ListAllMaps += delegate { var fileLocation = UserDialogs.SaveFile("Where list of all maps should be saved?", "Txt(.txt)|*.txt|Html(.html)|*.html"); if (fileLocation == string.Empty) { return; } var listGenerator = new ListGenerator(); var CollectionListSaveType = Path.GetExtension(fileLocation).ToLower() == ".txt" ? CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Txt : CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Html; var contents = listGenerator.GetAllMapsList(LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }; form.SidePanelView.ListMissingMaps += delegate { var fileLocation = UserDialogs.SaveFile("Where list of all maps should be saved?", "Txt(.txt)|*.txt|Html(.html)|*.html"); if (fileLocation == string.Empty) { return; } var listGenerator = new ListGenerator(); var CollectionListSaveType = Path.GetExtension(fileLocation).ToLower() == ".txt" ? CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Txt : CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Html; var contents = listGenerator.GetMissingMapsList(LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }; }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, IToolbarCommand[] commands) { mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.podcastPlayer = podcastPlayer; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.commands = commands; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } EventAggregator.Instance.Subscribe <EpisodeSelectedMessage>(m => mainFormView.ShowEpisodeView()); EventAggregator.Instance.Subscribe <PodcastSelectedMessage>(m => mainFormView.ShowPodcastView()); }
public MainFormPresenter(IMainFormView view) { this.view = view; this.model = Global.Services.GetService <IMainFormModel>(); this.model.SaveChangesComplete += Model_SaveChangesComplete; }
public static void SetupPresenters(IMainFormView mainFormView) { var messageService = DependencyResolver.Resolve <IMessageService>(); var loggingService = DependencyResolver.Resolve <ILoggingService>(); var _ = new ApplicationPresenter(mainFormView, messageService, loggingService); }
public MainFormPresenter(IMainFormView mainFormView) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; toolbarView.PlayClicked += OnButtonPlayClick; toolbarView.StopClicked += OnButtonStopClick; toolbarView.PauseClicked += OnButtonPauseClick; toolbarView.RemovePodcastClicked += OnButtonRemovePodcastClick; toolbarView.AddPodcastClicked += OnButtonAddSubscriptionClick; toolbarView.FavouriteChanged += OnButtonFavouriteCheckStateChanged; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; subscriptionManager = new SubscriptionManager("subscriptions.xml"); podcastLoader = new PodcastLoader(); podcastPlayer = new PodcastPlayer(); podcasts = subscriptionManager.LoadPodcasts(); if (!SystemInformation.HighContrast) { mainFormView.BackColor = Color.White; } }
public MainFormPresenter(IMainFormView view, IMainFormModel mainFormModel, IInfoTextModel infoTextModel, IWebCollectionProvider webCollectionProvider) { _view = view; _mainFormModel = mainFormModel; //Combined listing (Collections+Beatmaps) BeatmapListingModel = new BeatmapListingModel(null); BeatmapListingModel.BeatmapsDropped += BeatmapListing_BeatmapsDropped; BeatmapListingModel.SelectedBeatmapChanged += BeatmapListingViewOnSelectedBeatmapChanged; CollectionListingModel = new CollectionListingModel(Initalizer.LoadedCollections, _mainFormModel.GetCollectionEditor()); CollectionListingModel.CollectionEditing += CollectionListing_CollectionEditing; CollectionListingModel.SelectedCollectionsChanged += CollectionListing_SelectedCollectionsChanged; new CombinedListingPresenter(_view.CombinedListingView, CollectionListingModel, BeatmapListingModel, webCollectionProvider, mainFormModel.GetUserDialogs()); //Beatmap preview stuff (images, beatmap info like ar,cs,stars...) _combinedBeatmapPreviewModel = new CombinedBeatmapPreviewModel(); var presenter = new CombinedBeatmapPreviewPresenter(_view.CombinedBeatmapPreviewView, _combinedBeatmapPreviewModel); presenter.MusicControlModel.NextMapRequest += (s, a) => { _view.CombinedListingView.beatmapListingView.SelectNextOrFirst(); }; _collectionTextModel = new CollectionTextModel(); new CollectionTextPresenter(_view.CollectionTextView, _collectionTextModel); //General information (Collections loaded, update check etc.) InfoTextModel = infoTextModel; new InfoTextPresenter(_view.InfoTextView, InfoTextModel); }
public MainFormPresenter(IMainFormView mainFormView, IDataListView employeesDataListView, IDataListView tasksDataListView, IDataListView assignedTasksDataListView, ISystemInformationService systemInformationService, IMenuCommand[] commands) { this.mainFormView = mainFormView; this.commands = commands; menuView = mainFormView.MenuView; menuView.SetCommands(commands); employeesDataListView = mainFormView.EmployeesDataListView; employeesDataListView.SetTitle(MenuOption.Employees.GetAttribute <MenuOptionAttribute>().Name); employeesDataListView.SetTag(MenuOption.Employees); employeesDataListView.OnDataGridViewCellClick += OnDataGridViewCellClick; tasksDataListView = mainFormView.TasksDataListView; tasksDataListView.SetTitle(MenuOption.Tasks.GetAttribute <MenuOptionAttribute>().Name); tasksDataListView.SetTag(MenuOption.Tasks); tasksDataListView.OnDataGridViewCellClick += OnDataGridViewCellClick; assignedTasksDataListView = mainFormView.AssignedTasksDataListView; assignedTasksDataListView.SetTitle(MenuOption.AssignedTasks.GetAttribute <MenuOptionAttribute>().Name); assignedTasksDataListView.SetTag(MenuOption.AssignedTasks); assignedTasksDataListView.OnDataGridViewCellClick += OnDataGridViewCellClick; mainFormView.KeyUp += MainFormViewOnKeyUp; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } }
public MainFormPresenter(IMainFormView mainFormView) { _peopleListView = mainFormView.PeopleListView; _personInfoView = mainFormView.PersonInfoView; _mainFormView = mainFormView; _mainFormView.Load += MainFormViewOnLoad; _mainFormView.FormClosed += MainFormViewOnFormClosed; _peopleListView.SelectionChanged += OnSelectedNameChanged; }
public GuiActionsHandler(OsuFileIo osuFileIo, ICollectionEditor collectionEditor, IUserDialogs userDialogs, IMainFormView mainFormView, MainFormPresenter mainFormPresenter, ILoginFormView loginForm) { _mainFormView = mainFormView; SidePanelActionsHandler = new SidePanelActionsHandler(osuFileIo, collectionEditor, userDialogs, mainFormView, this, mainFormPresenter, loginForm); _beatmapListingActionsHandler = new BeatmapListingActionsHandler(collectionEditor, userDialogs, loginForm, osuFileIo); _beatmapListingActionsHandler.Bind(mainFormPresenter.BeatmapListingModel); Initalizer.CollectionsManager.LoadedCollections.CollectionChanged += LoadedCollectionsOnCollectionChanged; }
internal void Initialize(IMainFormView view) { View = view; Renderer = new PicRenderer(); // Replace it by DI AssemblyParser = new CecilAssemblyParser(); WireEvents(); }
public LoadEmployeesCommand( IMainFormView mainFormView, IService <Employee> service) { this.mainFormView = mainFormView; this.service = service; Icon = Properties.Resources.icons8_permanent_job_48; ToolTip = MenuOption.Employees.GetAttribute <MenuOptionAttribute>().Name; ShortcutKey = Keys.Alt | Keys.E; IsEnabled = true; }
public Form1Presenter(IMainFormView mainFormView, IPersonRepository personRepository) { this.mainFormView = mainFormView; this.personRepository = personRepository; mainFormView.dataGridView_DataBindingComplete += dataGridView_DataBindingComplete; mainFormView.dataGridView_CellLeave += dataGridView_CellLeave; mainFormView.SetDataSource(this.personRepository.GetPeople()); }
public ApplicationPresenter(IMainFormView mainFormView, IMessageService messageService, ILoggingService loggingService) { loggingService.Log("Initializing presenters"); _benchmarkPresenter = new BenchmarkPresenter(mainFormView.BenchmarkView, messageService, loggingService); _drawingPresenter = new DrawingPresenter(mainFormView.DrawingView, messageService, loggingService); _uploadImagePresenter = new UploadImagePresenter(mainFormView.UploadImageView, messageService, loggingService); _slidingWindowPresenter = new SlidingWindowPresenter(mainFormView.SlidingWindowView, messageService, loggingService); }
public MainFormPresenter(ApplicationController applicationController, IMainFormView mainForm, Settings settings, VKGroupHelperWorker vk) { _view = mainForm; _settings = settings; _vk = vk; _applicationController = applicationController; _view.Login += () => Login(); _view.Close += () => Close(); _view.VKUpload += () => VKUpload(); }
public MainFormPresenter(ILogger logger, IMainFormView mainFormView, IGalleryService galleryService, IEnumerable <Rectangle> allScreensBoundaries) { this.logger = logger; this.mainFormView = mainFormView; Rand = new Random(); BoundingRectangle = FindBoundingBox(allScreensBoundaries); this.galleryService = galleryService; animator = new AnimationHandler(); }
public LoadTasksCommand( IMainFormView mainFormView, IService <Task> service) { this.mainFormView = mainFormView; this.service = service; Icon = Properties.Resources.icons8_list_48; ToolTip = MenuOption.Tasks.GetAttribute <MenuOptionAttribute>().Name; ShortcutKey = Keys.Alt | Keys.T; IsEnabled = true; }
public ProcessController(IMainFormView view) { Application.ApplicationExit += ApplicationOnApplicationExit; _taskbarList = (ITaskbarList)new CoTaskbarList(); _taskbarList.HrInit(); _view = view; _startProcessingEvent = new AutoResetEvent(false); _startProcessThread = new Thread(StartProcessWorker); _startProcessThread.Start(); }
public SidePanelActionsHandler(OsuFileIo osuFileIo, ICollectionEditor collectionEditor, IUserDialogs userDialogs, IMainFormView mainForm, IBeatmapListingBindingProvider beatmapListingBindingProvider, MainFormPresenter mainFormPresenter, ILoginFormView loginForm) { _osuFileIo = osuFileIo; _collectionEditor = collectionEditor; _userDialogs = userDialogs; _mainForm = mainForm; _beatmapListingBindingProvider = beatmapListingBindingProvider; _mainFormPresenter = mainFormPresenter; _loginForm = loginForm; _collectionGenerator = new CollectionsApiGenerator(Initalizer.OsuFileIo.LoadedMaps); BindMainFormActions(); }
public MainFormPresenter(IMainFormView mainFormView, ITfsHttpClient tfsHttpClient) { this._mainFormView = mainFormView; _consoleView = mainFormView.ConsoleView; _toolbarView = mainFormView.ToolbarView; _tfsRequestPanelView = mainFormView.TfsRequestPanelView; mainFormView.Load += MainFormView_Load; mainFormView.FormClosed += MainFormView_FormClosed; _toolbarView.StartClicked += ToolbarView_StartClicked; _toolbarView.TrashClicked += ToolbarView_TrashClicked; _tfsHttpClient = tfsHttpClient; }
public MainFormPresenter( IMainFormView view, IDialogService dialogService, JsonFilesImporter jsonFilesImporter, SqlImporter sqlImporter) { _dialogService = dialogService; _jsonFilesImporter = jsonFilesImporter; _sqlImporter = sqlImporter; View = view; View.OpenJsonFolderClick += OpenJsonFolder; View.AddFilesAsAccountsInfoList += AddFilesAsAccountsInfoList; View.AddFilesAsTanksInfoList += AddFilesAsTanksInfoList; View.StartJsonConvert += StartJsonConvert; View.FetchSqlAccounts += FetchSqlAccounts; View.StartSqlImport += StartSqlImport; }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, IToolbarCommand[] commands) { this.podcastPlayer = podcastPlayer; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.commands = commands; subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; mainFormView.ToolbarView.SetCommands(commands); timer = new Timer(); timer.Interval = 100; timer.Tick += TimerOnTick; timer.Start(); episodeView.Title = ""; episodeView.Description = ""; episodeView.PubDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = System.Drawing.Color.White; } subscriptionManager.LoadPodcasts(); episodeView.PositionChanged += (s, a) => podcastPlayer.PositionInSeconds = episodeView.PositionInSeconds; episodeView.NoteCreated += EpisodeViewOnNoteCreated; }
public MainFormPresenter(IMainFormView mainFormView, ISubscriptionManager subscriptionManager, IPodcastLoader podcastLoader, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, INewSubscriptionService newSubscriptionService) { _subscriptionView = mainFormView.SubscriptionView; _episodeView = mainFormView.EpisodeView; _podcastView = mainFormView.PodcastView; _timer = new Timer(); _timer.Interval = 100; _timer.Tick += TimerOnTick; _timer.Start(); _mainFormView = mainFormView; mainFormView.Load += OnMainFormLoad; mainFormView.FormClosed += OnMainFormClosed; mainFormView.KeyUp += MainFormViewOnKeyUp; _subscriptionView.AddPodcastClicked += OnButtonAddClick; _subscriptionView.RemovePodcastClicked += OnButtonRemoveClick; _subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; _episodeView.PlayClicked += OnButtonPlayClick; _episodeView.StopClicked += OnButtonStopClick; _subscriptionManager = subscriptionManager; _podcastLoader = podcastLoader; _podcastPlayer = podcastPlayer; _podcasts = _subscriptionManager.LoadPodcasts(); _settingsService = settingsService; _newSubscriptionService = newSubscriptionService; _messageBoxDisplayService = messageBoxDisplayService; if (systemInformationService.IsHighContrastColorScheme) { mainFormView.BackColor = Color.White; } _episodeView.PositionChanged += (s, a) => _podcastPlayer.PositionInSeconds = _episodeView.PositionInSeconds; }
public MainFormPresenter(IMainFormView textMainForm) { //Загружаем все вопросы из файла в лист ISerializer serializer = new XMLSerializer(); AllList.SetSerializer(serializer); AllList.LoadQuestion(); _textMainForm = textMainForm; // Презентер подписывается на уведомления о событиях Представления _textMainForm.ClicButtonNewGame += new EventHandler <EventArgs>(LoadOneQuestionInLabel); _textMainForm.ClicButtonAnswers += new EventHandler <EventArgs>(CheckAnswerAndNext); _textMainForm.NextQuest += new EventHandler <EventArgs>(NextQuestion); _textMainForm.ClicButton50on50 += EventClicButton50on50; _textMainForm.ClicButtonCallFriend += EventClicButtonCallFriend; _textMainForm.ClicButtonHelpRoom += EventClicButtonHelpRoom; // UpdateView(); }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, INewSubscriptionService newSubscriptionService) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; toolbarView.PlayClicked += OnButtonPlayClick; toolbarView.StopClicked += OnButtonStopClick; toolbarView.PauseClicked += OnButtonPauseClick; toolbarView.RemovePodcastClicked += OnButtonRemovePodcastClick; toolbarView.AddPodcastClicked += OnButtonAddSubscriptionClick; toolbarView.FavouriteChanged += OnButtonFavouriteCheckStateChanged; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.podcastPlayer = podcastPlayer; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.newSubscriptionService = newSubscriptionService; podcasts = subscriptionManager.LoadPodcasts(); if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } }
public LoadAssignedTasksCommand( IMainFormView mainFormView, IDialogFormView dialogFormView, IDialogView <AssignedTask> assignedTaskDialogView, IService <Task> taskService, IService <Employee> employeeService, IService <AssignedTask> assignedTaskService) { this.mainFormView = mainFormView; this.dialogFormView = dialogFormView; this.assignedTaskDialogView = assignedTaskDialogView; this.taskService = taskService; this.employeeService = employeeService; this.assignedTaskService = assignedTaskService; Icon = Properties.Resources.icons8_planner_48; ToolTip = MenuOption.AssignedTasks.GetAttribute <MenuOptionAttribute>().Name; ShortcutKey = Keys.Alt | Keys.A; IsEnabled = true; }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, IToolbarCommand[] commands) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; toolbarView.SetCommands(commands); this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.podcastPlayer = podcastPlayer; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.commands = commands; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } }
public RemoveCommand( IMainFormView mainFormView, IService <Task> taskService, IService <Employee> employeeService, IService <AssignedTask> assignedTaskService) { this.mainFormView = mainFormView; this.taskService = taskService; this.employeeService = employeeService; this.assignedTaskService = assignedTaskService; Icon = Properties.Resources.icons8_trash_can_48; ToolTip = MenuOption.Remove.GetAttribute <MenuOptionAttribute>().Name; ShortcutKey = Keys.Alt | Keys.X; IsEnabled = false; Tag = null; EventAggregator.Instance.Subscribe <TaskMessage>(e => IsEnabled = true); EventAggregator.Instance.Subscribe <TaskMessage>(e => Tag = e.Entity); EventAggregator.Instance.Subscribe <EmployeeMessage>(e => IsEnabled = true); EventAggregator.Instance.Subscribe <EmployeeMessage>(e => Tag = e.Entity); EventAggregator.Instance.Subscribe <AssignedTaskMessage>(e => IsEnabled = true); EventAggregator.Instance.Subscribe <AssignedTaskMessage>(e => Tag = e.Entity); }
public GuiActionsHandler(OsuFileIo osuFileIo, ICollectionEditor collectionEditor, IUserDialogs userDialogs, IMainFormView mainFormView, MainFormPresenter mainFormPresenter, ILoginFormView loginForm) { _sidePanelActionsHandler = new SidePanelActionsHandler(osuFileIo, collectionEditor, userDialogs, mainFormView, this, mainFormPresenter, loginForm); _beatmapListingActionsHandler = new BeatmapListingActionsHandler(collectionEditor, userDialogs, loginForm, osuFileIo); _beatmapListingActionsHandler.Bind(mainFormPresenter.BeatmapListingModel); }
public MainFormLogger(IMainFormView mainFormView) { this.mainFormView = mainFormView; }
// Constructor public MainFormPresenter(IMainFormView mainForm) { }
public WindowController(IMainFormView view) { _view = view; }
public DragDropController(IMainFormView view) { _view = view; }
public MainFormPresenter(IMainFormView view) { CurrentView = view; if (view != null && view.Model == null) CurrentView.Model = new MainModel(); }
public MainFormController(IMainFormView mainFormView, IDependencyResolver dependencyResolver) { View = mainFormView; DependencyResolver = dependencyResolver; View.Controller = this; }
public MainFormViewHost(IMainFormView view) { _view = view; }
public MainFormPresenter(IMainFormView view, IJediSettings settings) { this.view = view; this.settings = settings; mouselessModeKey = settings.MouselessModeKey; }
public MainFormPresenter(IMainFormView view) { this._view = view; this._view.ButtonOkClicked += ViewOnButtonOkClicked; }
public ProfileController(IMainFormView view) { _view = view; }
public MouseDisabler(IMainFormView dockRootForm) { this.dockRootForm = dockRootForm; timer.Elapsed += timer_Elapsed; }
public MainFormViewPresenter(IMainFormView view) { this._view = view; this._model = new MainFormModel(); this.Parse(Resources.SampleInput, Resources.SampleNotify == "true", Resources.SampleAttribute); }
public StorageController(IMainFormView view) { _view = view; }