private void Application_Activated(object sender, EventArgs e) { long startTicks = Log.APPLICATION_START("Enter", Common.LOG_CATEGORY); Log.APPLICATION_START("Exit", Common.LOG_CATEGORY, startTicks); }
private void ThisAddIn_Startup(object sender, System.EventArgs e) { Int64 startTicks = Log.APPLICATION_START("Enter", Common.LOG_CATEGORY); try { Globals.Ribbons.Ribbon.chkDisplayEvents.Checked = Common.DisplayEvents; Globals.Ribbons.Ribbon.chkEnableAppEvents.Checked = Common.HasAppEvents; if (Common.HasAppEvents) { Common.AppEvents = new Events.VisioAppEvents(); Common.AppEvents.VisioApplication = Globals.ThisAddIn.Application; } Common.VisioHelper.VisioApplication = Globals.ThisAddIn.Application; //// Need to do a bit more work to use CustomTask Panes in Visio. (Handled by Designer normally) //CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this); // For the WPF stuff we do InitializeWPFApplication(); } catch (Exception ex) { Log.Error(ex, Common.LOG_CATEGORY); throw (ex); } Log.APPLICATION_START("Exit", Common.LOG_CATEGORY, startTicks); }
public App() { // HACK(crhodes) // If don't delay a bit here, the SignalR logging infrastructure does not initialize quickly enough // and the first few log messages are missed. // NB. All are properly recored in the log file. Int64 startTicks = Log.APPLICATION_START("App()", Common.LOG_CATEGORY); Thread.Sleep(250); Log.APPLICATION_START(String.Format("Exit"), Common.LOG_CATEGORY, startTicks); }
private void Application_Startup(object sender, StartupEventArgs e) { long startTicks = Log.APPLICATION_START("Enter", Common.LOG_CATEGORY); try { VerifyApplicationPrerequisites(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); MessageBox.Show(ex.InnerException.ToString()); } Log.APPLICATION_START("Exit", Common.LOG_CATEGORY, startTicks); }
private void Application_Startup(object sender, StartupEventArgs e) { long startTicks = Log.APPLICATION_START("Enter", Common.LOG_CATEGORY); try { VerifyApplicationPrerequisites(); var defaultThemes = Theme.Themes; ApplicationThemeHelper.ApplicationThemeName = "MetropolisDark"; } catch (Exception ex) { MessageBox.Show(ex.ToString()); MessageBox.Show(ex.InnerException.ToString()); } Log.APPLICATION_START("Exit", Common.LOG_CATEGORY, startTicks); }
// HACK(crhodes) // Have move away from TaskPanes //public static Microsoft.Office.Tools.CustomTaskPane TaskPaneExcelUtil; //private static System.Windows.Application _XamlApp; private void ThisAddIn_Startup(object sender, System.EventArgs e) { long startTicks = Log.APPLICATION_START("Enter", Common.PROJECT_NAME); try { Common.DeveloperMode = true; Common.WriteToDebugWindow("ThisAddIn_Startup()"); Common.DeveloperMode = false; Globals.Ribbons.Ribbon.chkDisplayEvents.Checked = Common.DisplayEvents; Globals.Ribbons.Ribbon.chkEnableAppEvents.Checked = Common.HasAppEvents; if (Common.HasAppEvents) { Common.AppEvents = new Events.ExcelAppEvents(); Common.AppEvents.ExcelApplication = Globals.ThisAddIn.Application; } XlHlp.ExcelApplication = Globals.ThisAddIn.Application; // For the WPF stuff we do InitializeWPFApplication(); } catch (Exception ex) { Log.Error(ex, Common.PROJECT_NAME); Common.DeveloperMode = true; Common.WriteToDebugWindow(ex.ToString()); Common.DeveloperMode = false; throw (ex); } Log.APPLICATION_START("Exit", Common.PROJECT_NAME, startTicks); }
private void Application_Startup(object sender, StartupEventArgs e) { long startTicks = Log.APPLICATION_START("Enter", LOG_APPNAME); try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Common.CurrentUser = new WindowsPrincipal(WindowsIdentity.GetCurrent()); if (Data.Config.ADBypass) { Common.IsAdministrator = true; Common.IsBetaUser = true; } else { if (!Data.Config.AD_Users_AllowAll) { bool isAuthorizedUser = VNC.ActiveDirectory.Helper.CheckGroupMembership( //"maward", Common.CurrentUser.Identity.Name, Data.Config.ADGroup_Users, Data.Config.AD_Domain); if (!isAuthorizedUser) { MessageBox.Show(string.Format("You must be a member of {0}\\{1} to run this application.", Data.Config.AD_Domain, Data.Config.ADGroup_Users)); return; } } Common.IsAdministrator = VNC.ActiveDirectory.Helper.CheckDirectGroupMembership( Common.CurrentUser.Identity.Name, Data.Config.ADGroup_Administrators, Data.Config.AD_Domain); Common.IsBetaUser = VNC.ActiveDirectory.Helper.CheckDirectGroupMembership( Common.CurrentUser.Identity.Name, Data.Config.ADGroup_BetaUsers, Data.Config.AD_Domain); Common.IsDeveloper = Common.CurrentUser.Identity.Name.Contains("crhodes") ? true : false; // Next lines are for testing UI only. Comment out for normal operation. //Common.IsAdministrator = false; //Common.IsBetaUser = false; //Common.IsDeveloper = false; } // Cannot do here as the Common.ApplicationDataSet has not been loaded. Need to move here or do later. // For now this is in DXRibbonWindowMain(); //var eventMessage = "Started"; //SQLInformation.Helper.IndicateApplicationUsage(LOG_APPNAME, DateTime.Now, currentUser.Identity.Name, eventMessage); // Launch the main window. // TODO(crhodes) // Would be cool to start this with a Window specified in the App.Config file //User_Interface.Windows.SplashScreen _window1 = new User_Interface.Windows.SplashScreen(); User_Interface.Windows.DXRibbonWindowMain _window1 = new User_Interface.Windows.DXRibbonWindowMain(); //User_Interface.Windows.About _window1 = new User_Interface.Windows.About(); //String windowArgs = string.Empty; // Check for arguments; if there are some build the path to the package out of the args. //if (args.Args.Length > 0 && args.Args[0] != null) //{ // for (int i = 0; i < args.Args.Length; ++i) // { // windowArgs = args.Args[i]; // switch (i) // { // case 0: // Patient Id // //patientId = windowArgs; // break; // } // } //} _window1.Show(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); MessageBox.Show(ex.InnerException.ToString()); } Log.APPLICATION_START("Exit", LOG_APPNAME, startTicks); }