/* Private members */ /// <summary>Initializes the base program structure.</summary> /// <remarks>Nothing is done if initialization has already occured. The core value is checked for this, /// if it's null then initialization hasn't occured yet.</remarks> private static void Init(ExecutionContext newExecutionContext) { if ((executionContext != null) && (executionContext.Initialized)) { throw new Exception("The Base environment was already initialized."); } executionContext = newExecutionContext; executionContext.InitApplication(); /* Initialize Command manager */ commandManager = new CommandManager(); /* Initialize handlers */ handlers = new EventHandlers(); /* Initialize misc */ clipboards = new Clipboards(); globalAccelerators = new GlobalAccelerators(); dragDrop = new DragDrop(); config = new Config(); dialogs = new Dialogs(); spellLanguages = new SpellLanguages(); backup = new Backup(); /* Initialize the GUI */ ui = new MainUi(handlers); clipboards.WatchPrimaryChanges = true; Catalog.Init(ExecutionContext.TranslationDomain, ExecutionContext.LocaleDir); EmitInitFinishedEvent(); }
/* Private members */ /// <summary>Initializes the base program structure.</summary> private static void Init() { Catalog.Init(ExecutionContext.TranslationDomain, ExecutionContext.LocaleDir); /* Initialize Command manager */ commandManager = new CommandManager(); /* Initialize handlers */ handlers = new EventHandlers(); /* Initialize misc */ clipboards = new Clipboards(); globalAccelerators = new GlobalAccelerators(); dragDrop = new DragDrop(); config = new Config(); dialogs = new Dialogs(); spellLanguages = new SpellLanguages(); backup = new Backup(); /* Initialize the GUI */ ui = new MainUi(handlers); //The window must be made visible here because classes such as EventHandlers.OnSizeAllocated) may depend on //'ui' being set when the window is made visible (so it can't be made visible inside MainUi's constructor). ui.Show(); clipboards.WatchPrimaryChanges = true; EmitInitFinishedEvent(); }