/// <summary> /// Initializes the application. Override this method to perform custom initialization. /// </summary> /// <remarks> /// Initializes the application, including the session manager, application tools and root window. /// The GUI toolkit and application view have already been initialized prior to this method being /// called. /// </remarks> /// <param name="args">Arguments passed in from the command line.</param> /// <returns>True if initialization was successful, false if the application should terminate immediately.</returns> protected virtual bool Initialize(string[] args) { // initialize the application UI culture from local setting CurrentUICulture = InstalledLocales.Instance.Selected.GetCultureInfo(); // initialize session if (!InitializeSessionManager()) { return(false); } UserUpgradeProgressDialog.RunUpgradeAndShowProgress(); // load tools _toolSet = new ToolSet(new ApplicationToolExtensionPoint(), new ApplicationToolContext(this)); try { // create a root window _windows.AddNew("Root"); } catch (Exception e) { ExceptionHandler.ReportUnhandled(e); return(false); } return(true); }
/// <summary> /// Initializes the application. Override this method to perform custom initialization. /// </summary> /// <remarks> /// Initializes the application, including the session manager, application tools and root window. /// The GUI toolkit and application view have already been initialized prior to this method being /// called. /// </remarks> /// <param name="args">Arguments passed in from the command line.</param> /// <returns>True if initialization was successful, false if the application should terminate immediately.</returns> protected virtual bool Initialize(string[] args) { #if CHECKDOG if (checkDog(1) == 0) { Platform.Log(LogLevel.Error, "无法检测到软件加密狗!!"); return(false); } #endif // initialize the application UI culture from local setting CurrentUICulture = InstalledLocales.Instance.Selected.GetCultureInfo(); // initialize session if (!InitializeSessionManager()) { return(false); } UserUpgradeProgressDialog.RunUpgradeAndShowProgress(); // load tools _toolSet = new ToolSet(new ApplicationToolExtensionPoint(), new ApplicationToolContext(this)); try { // create a root window // _windows.AddNew("Root"); _windows.AddNew("xxx"); } catch (Exception e) { ExceptionHandler.ReportUnhandled(e); return(false); } return(true); }