public FormAddFishingRecord(PresenterMain inParentPresenter) { InitializeComponent(); _presenter = new AddFishingRecordPresenter(this, inParentPresenter); DateTime now = DateTime.Now; DateTime dateTime = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); StartDateTime = dateTime; EndDateTime = dateTime; }
private void FrmMain_Load(object sender, EventArgs e) { try { Presenter = new PresenterMain(this); Presenter.Iniciar(); //TODO: DESCOMENTAR ESSE BLOCO PARA PARA REALIZAR LOGIN E PRENCHER A SESSÃO DO USUARIO LOGADO if ((bool)Sessao.Usuario.AlterarSenha) { CloseUC(); userControl = new FrmSae.UCAlterarSenha(); panelCabecalho.Enabled = panelMenu.Enabled = false; OpenUc(); } CarregaPerfil(); } catch (Exception exM) { Alert(0, exM); } }
public FormStatistics(PresenterMain inParentPresenter) { InitializeComponent(); _presenter = new PresenterStatistics(this, inParentPresenter); }
public ViewMain() { InitializeComponent(); _presenter = new PresenterMain(this); }
private static void Main() { Validate.CheckIfFirstTimeRunning(); if (IsAnotherInstanceOfThisProgramRunning(Assembly.GetEntryAssembly()?.GetName().Name)) { MessageBox.Show( Resources.Program_Main_Only_one_instance_of_Clipboard_Helper_RegEx_can_be_running_at_the_same_time__This_instance_will_be_closed_, "Clipboard Helper RegEx", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; Application.ThreadException += ApplicationOnThreadException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //The program is initiated in this class. The different presenters handle all the user input from the views so the program //behaves correctly. //User controls var settingsArea = new TableLayoutPanel { Dock = DockStyle.Fill }; var settingsLeft = new GroupBox { Dock = DockStyle.Left }; var settingsRight = new GroupBox { Dock = DockStyle.Fill }; var settingsMenuLeft = new ViewUserSettingsLeftMenu { Dock = DockStyle.Fill }; var settingsRightAppearance = new ViewUserSettingsRightAppearance { Dock = DockStyle.Fill }; var settingsRightAutoShownTabs = new ViewUserSettingsRightAutoShownTabs { Dock = DockStyle.Fill }; var settingsRightManuallyShownTabs = new ViewUserSettingsRightManuallyShownTabs { Dock = DockStyle.Fill }; var settingsDownButtons = new ViewUserSettingsDownButtons { Dock = DockStyle.Bottom }; var settingsAdvanced = new ViewUserSettingsRightAdvanced { Dock = DockStyle.Fill }; var settingsHelp = new ViewUserSettingsRightHelp { Dock = DockStyle.Fill }; var mainSplCont = new ViewMainSplCont { Dock = DockStyle.Fill }; var mainSplContPanelUpTabs = new ViewMainSplContPanelUpTabs { Dock = DockStyle.Fill }; var mainSplContPanelDown = new ViewMainSplContPanelDown { Dock = DockStyle.Fill }; //Built-in Visual Studio settings ISettingsService settings = new SettingsService(); //Not built-in Visual Studio settings ISettingsServiceXmlSerialization settingsServiceXmlSerialization = new SettingsServiceXmlSerialization(); //Built-in Visual Studio resources IResourcesService resources = new ResourcesService(); //Other classes var validate = new Validate(settingsRightManuallyShownTabs, settingsRightAutoShownTabs, settingsServiceXmlSerialization); var pasting = new Pasting(); var fileData = new FileData(); //Views var viewAbout = new ViewAbout(); var viewMain = new ViewMain(mainSplCont, mainSplContPanelUpTabs, mainSplContPanelDown); var viewMin = new ViewMin(); var viewUserSettings = new ViewUserSettings(settingsArea, settingsDownButtons, settingsLeft, settingsRight, settingsMenuLeft); var viewDialog = new ViewDialog(); //Presenters var unused1 = new PresenterAbout(viewAbout, resources); var unused2 = new PresenterMain( viewMain, viewMin, viewUserSettings, viewAbout, settings, resources, mainSplContPanelUpTabs, settingsDownButtons, pasting); var unused3 = new PresenterMainSplCont(mainSplCont, viewMain); var unused4 = new PresenterMainSplContPanelUpTabs( mainSplContPanelUpTabs, viewMain, viewMin, settings, pasting, mainSplContPanelDown, settingsServiceXmlSerialization, settingsDownButtons); var unused5 = new PresenterMainSplContPanelDown(mainSplContPanelDown); var unused6 = new PresenterMin(viewMin, viewMain, resources); var unused7 = new PresenterUserSettings( viewUserSettings, resources); var unused8 = new PresenterUserSettingsLeftMenu( settingsMenuLeft, viewUserSettings, settingsRightAppearance, settingsRightAutoShownTabs, settingsRightManuallyShownTabs, settingsAdvanced, settingsHelp); var unused9 = new PresenterUserSettingsRightAppearance( settingsRightAppearance, settings, settingsDownButtons, viewMain, validate, viewDialog); var unused10 = new PresenterUserSettingsRightAutoShownTabs( settingsRightAutoShownTabs, viewDialog, viewUserSettings, settingsDownButtons, settingsServiceXmlSerialization, mainSplContPanelUpTabs); var unused11 = new PresenterUserSettingsRightManuallyShownTabs( settingsRightManuallyShownTabs, viewDialog, viewUserSettings, settingsDownButtons, settingsServiceXmlSerialization); var unused12 = new PresenterUserSettingsDownButtons( settingsDownButtons, viewUserSettings, settings); var unused13 = new PresenterUserSettingsRightAdvanced( settingsAdvanced, viewDialog, settings, settingsRightAutoShownTabs, settingsServiceXmlSerialization, settingsRightManuallyShownTabs, validate, fileData); var unused14 = new PresenterDialog(viewDialog); var unused15 = new PresenterUserSettingsRightHelp( settingsHelp); Application.Run(viewMain); //Disposing settingsRightAppearance.Dispose(); settingsRightAutoShownTabs.Dispose(); settingsRightManuallyShownTabs.Dispose(); settingsAdvanced.Dispose(); settingsHelp.Dispose(); viewAbout.Dispose(); viewMain.Dispose(); viewMin.Dispose(); viewUserSettings.Dispose(); viewDialog.Dispose(); unused2.Dispose(); unused4.Dispose(); unused5.Dispose(); unused6.Dispose(); unused13.Dispose(); }