コード例 #1
0
        /// <summary>
        /// Creates the main form.
        /// </summary>
        /// <returns></returns>
        protected override Form CreateMainForm()
        {
            var chrome = new Chrome();

            Globals.MainForm = chrome;

            // Set the theme
            var themingService = This.GetService <IThemingService>();

            if (themingService != null)
            {
                const string themeId = "Delta.CertXplorer";
                if (themingService.ContainsTheme(themeId))
                {
                    themingService.ApplyTheme(themeId);
                }
            }

            This.AddService <IDocumentManagerService>(
                DocumentFactory.CreateDocumentManagerService(chrome));

            // Load document builders & view builders
            LoadBuilders();

            // Now tell the form what files it should open when launched.
            if (base.CommandLineArguments != null && base.CommandLineArguments.Length > 0)
            {
                chrome.FilesToOpenAtStartup.AddRange(base.CommandLineArguments);
            }

            return(chrome);
        }