public static void ShowConfig() { dlgLogin login = new dlgLogin(_Config.MISPassword); login.ValidateEntry(); if (login.IsValid) { new Argix.Support.dlgConfig(_Config).ShowDialog(); } }
internal static void ShowTrace() { dlgLogin login = new dlgLogin(_Config.MISPassword); login.ValidateEntry(); if (login.IsValid) { _Trace.Show(); } }
internal static void ShowDiagnostics() { dlgLogin login = new dlgLogin("argix" + DateTime.Today.DayOfYear); login.StartPosition = FormStartPosition.CenterScreen; login.ValidateEntry(); if (login.IsValid) { dlgData dlg = new dlgData(Assembly.GetExecutingAssembly(), App.Product); dlg.ShowDialog(); } }
private void OnMenuClick(object sender, System.EventArgs e) { //Event handler for menu selection try { ToolStripDropDownItem menu = (ToolStripDropDownItem)sender; switch (menu.Text) { case MNU_FILE_NEW_PALLET: this.mPallet = null; this.userProcess = "NewPallet"; break; case MNU_FILE_REMOVECARTON: this.userProcess = "RemoveCarton"; break; case MNU_FILE_EXIT: this.Close(); Application.Exit(); break; case MNU_VIEW_TOOLBAR: this.tlbMain.Visible = (this.mnuViewToolbar.Checked = (!this.mnuViewToolbar.Checked)); break; case MNU_VIEW_STATUSBAR: this.stbMain.Visible = (this.mnuViewStatusBar.Checked = (!this.mnuViewStatusBar.Checked)); break; case MNU_TOOLS_CONFIG: App.ShowConfig(); break; case MNU_TOOLS_DIAGNOSTICS: App.ShowDiagnostics(); break; case MNU_TOOLS_TRACE: App.ShowTrace(); break; case MNU_TOOLS_USEWEBSVC: dlgLogin login = new dlgLogin(App.Config.MISPassword); login.ValidateEntry(); if (login.IsValid) { this.Cursor = Cursors.WaitCursor; this.mMessageMgr.AddMessage("Resetting the application configuration..."); Application.DoEvents(); App.UseWebSvc = this.mnuToolsUseWebSvc.Checked = (!this.mnuToolsUseWebSvc.Checked); configApplication(); // this.mnuViewRefresh.PerformClick(); this.setUserServices(); //MK not sure if this is needed, have one in finally } break; case MNU_HELP_ABOUT: new dlgAbout(App.Product + " Application", App.Version, App.Copyright, App.Configuration).ShowDialog(this); break; } } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { setUserServices(); this.Cursor = Cursors.Default; } }
void Presenter_AuthRequest(object sender, AuthEventArgs e) { // present login using (dlgLogin login = new dlgLogin(e.UserName)) { login.StartPosition = FormStartPosition.CenterParent; if (login.ShowDialog(this) == DialogResult.OK) { e.UserName = login.Username; e.Password = login.Password; e.Handled = true; } else { Log.InfoFormat("Login canceled. Closing parent form"); this.ParentForm.Close(); } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #if (DEBUG) var connectionString = PersistanceManager.GetConnectionStringByName("ServisDBLocal"); #else var connectionString = PersistanceManager.GetConnectionStringByName("ServisDB"); #endif PersistanceManager.SetConnection(connectionString); #if (DEBUG) Application.Run(new FormGlavna()); #else dlgLogin dlg = new dlgLogin(); if (dlg.ShowDialog() == DialogResult.OK) { Application.Run(new FormGlavna()); } #endif }