/// <summary>
        /// Initialization method called by the package base class when this package is loaded.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            // Register the editor factory used to create the DSL editor.
            this.RegisterEditorFactory(new ConfigurationSectionDesignerEditorFactory(this));

            // Initialize the toolbox helper
            toolboxHelper = new global::ConfigurationSectionDesigner.ConfigurationSectionDesignerToolboxHelper(this);

            // Create the command set that handles menu commands provided by this package.
            ConfigurationSectionDesignerCommandSet commandSet = new ConfigurationSectionDesignerCommandSet(this);

            commandSet.Initialize();

            // Create the command set that handles cut/copy/paste commands provided by this package.
            ConfigurationSectionDesignerClipboardCommandSet clipboardCommandSet = new ConfigurationSectionDesignerClipboardCommandSet(this);

            clipboardCommandSet.Initialize();

            // Register the model explorer tool window for this DSL.
            this.AddToolWindow(typeof(ConfigurationSectionDesignerExplorerToolWindow));

            // Initialize Extension Registars
            // this is a partial method call
            this.InitializeExtensions();

            // Add dynamic toolbox items
            this.SetupDynamicToolbox();
        }
Пример #2
0
        /// <summary>
        /// Initialization method called by the package base class when this package is loaded.
        /// </summary>
        protected async override System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <VSShell.ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            // Register the editor factory used to create the DSL editor.
            this.RegisterEditorFactory(new ConfigurationSectionDesignerEditorFactory(this));

            // Initialize the toolbox helper
            toolboxHelper = new global::ConfigurationSectionDesigner.ConfigurationSectionDesignerToolboxHelper(this);

            // Create the command set that handles menu commands provided by this package.
            ConfigurationSectionDesignerCommandSet commandSet = new ConfigurationSectionDesignerCommandSet(this);
            await commandSet.InitializeAsync(cancellationToken);

            // Create the command set that handles cut/copy/paste commands provided by this package.
            ConfigurationSectionDesignerClipboardCommandSet clipboardCommandSet = new ConfigurationSectionDesignerClipboardCommandSet(this);
            await clipboardCommandSet.InitializeAsync(cancellationToken);

            // Register the model explorer tool window for this DSL.
            this.AddToolWindow(typeof(ConfigurationSectionDesignerExplorerToolWindow));

            if (cancellationToken.IsCancellationRequested)
            {
                return;
            }

            await JoinableTaskFactory.SwitchToMainThreadAsync();

            // Initialize Extension Registars
            // this is a partial method call
            this.InitializeExtensions();

            // Add dynamic toolbox items
            await this.SetupDynamicToolboxAsync(cancellationToken);
        }
Пример #3
0
        /// <summary>
        /// Initialization method called by the package base class when this package is loaded.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            // Register the editor factory used to create the DSL editor.
            this.RegisterEditorFactory(new ConfigurationSectionDesignerEditorFactory(this));

            // Create the command set that handles menu commands provided by this package.
            ConfigurationSectionDesignerCommandSet commandSet = new ConfigurationSectionDesignerCommandSet(this);

            commandSet.Initialize();

            // Register the model explorer tool window for this DSL.
            this.AddToolWindow(typeof(ConfigurationSectionDesignerExplorerToolWindow));

            if (this.DesignTimeRunMode)
            {
                // Toolbar registration doesn't work well under design run mode as the toolbox needs to be reset
                // Instead we'll dynamically zap and recreate our toolbox every time
                // Regular users of the finished tool will get the toolbox setup in the perfectly normal way
                this.SetupDynamicToolbox();
            }
        }