コード例 #1
0
ファイル: Base.cs プロジェクト: sahwar/gnome-subtitles
        /* 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();
        }
コード例 #2
0
ファイル: Base.cs プロジェクト: isabella232/gnome-subtitles
        /* 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();
        }