コード例 #1
0
        /// <summary>
        /// Called to initialize the extension.
        /// </summary>
        /// <param name="host">WebMatrix host interface.</param>
        /// <param name="initData">Extension initialization data.</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            _webMatrixHost = host;

            initData.RibbonItems.Add(
                new RibbonGroup(
                    "TypeScript",
                    new RibbonItem[]
                        {
                            new RibbonButton(
                        "Compile TypeScript",
                        new DelegateCommand(CanExecute, HandleRibbonButtonCompileTypeScriptInvoke),
                        null,
                        _typescriptCompileImageSmall,
                        _typescriptCompileImageLarge),
                            new RibbonButton(
                        "Update software",
                        new DelegateCommand(CanExecute, HandleRibbonButtonUpdateSoftwareInvoke),
                        null,
                        _typescriptUpdateImageSmall,
                        _typescriptUpdateImageLarge)
                        }));

            _executer = DesignFactory.WebMatrix.ExecuterFactory.GetExecuter(
                "TypeScript", _webMatrixHost, _editorTaskPanel);

            _webMatrixHost.WebSiteChanged += (sender, e) => _executer.InitializeTabs();

            // Register handler for right-click context menu
            _webMatrixHost.ContextMenuOpening += new EventHandler<ContextMenuOpeningEventArgs>(webMatrixHost_ContextMenuOpening);
        }
コード例 #2
0
        protected override void  Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            this.Host    = (IWebMatrixHostInternal)host;
            this.Globals = new ModuleGlobals(this.Host, this.Host.ServiceProvider);

            this.Host.WebSiteChanged += this.Host_WebSiteChanged;
        }
コード例 #3
0
ファイル: NuGetExtension.cs プロジェクト: Newtopian/nuget
        protected override void  Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            this.Host = (IWebMatrixHostInternal)host;
            this.Globals = new ModuleGlobals(this.Host, this.Host.ServiceProvider);

            this.Host.WebSiteChanged += this.Host_WebSiteChanged;
        }
コード例 #4
0
        /// <summary>
        /// Called to initialize the extension.
        /// </summary>
        /// <param name="host">WebMatrix host interface.</param>
        /// <param name="initData">Extension initialization data.</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            _webMatrixHost = host;

            initData.RibbonItems.Add(
                new RibbonGroup(
                    "TypeScript",
                    new RibbonItem[]
            {
                new RibbonButton(
                    "Compile TypeScript",
                    new DelegateCommand(CanExecute, HandleRibbonButtonCompileTypeScriptInvoke),
                    null,
                    _typescriptCompileImageSmall,
                    _typescriptCompileImageLarge),
                new RibbonButton(
                    "Update software",
                    new DelegateCommand(CanExecute, HandleRibbonButtonUpdateSoftwareInvoke),
                    null,
                    _typescriptUpdateImageSmall,
                    _typescriptUpdateImageLarge)
            }));

            _executer = DesignFactory.WebMatrix.ExecuterFactory.GetExecuter(
                "TypeScript", _webMatrixHost, _editorTaskPanel);

            _webMatrixHost.WebSiteChanged += (sender, e) => _executer.InitializeTabs();

            // Register handler for right-click context menu
            _webMatrixHost.ContextMenuOpening += new EventHandler <ContextMenuOpeningEventArgs>(webMatrixHost_ContextMenuOpening);
        }
コード例 #5
0
        //--------------------------------------------------------------------------
        //
        //	Event Handlers
        //
        //--------------------------------------------------------------------------

        #region Initialize
        /// <summary>
        /// get a reference to the host when the app starts
        /// </summary>
        /// <param name="host"></param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData data)
        {
            // add host event handlers
            _host = host;
            if (host != null)
            {
                host.WebSiteChanged += new EventHandler <EventArgs>(WebMatrixHost_WebSiteChanged);
                _worker              = new Worker(host);

                host.ContextMenuOpening += new EventHandler <ContextMenuOpeningEventArgs>(host_ContextMenuOpening);
                InitSite();
            }
        }
コード例 #6
0
        //--------------------------------------------------------------------------
        //
        //	Methods
        //
        //--------------------------------------------------------------------------

        /// <summary>
        /// Called to initialize the extension.
        /// </summary>
        /// <param name="host">WebMatrix host interface.</param>
        /// <param name="initData">Extension initialization data.</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            _webMatrixHost = host;
            _webMatrixHost.WebSiteChanged += webMatrixHost_WebSiteChanged;

            // create a new ribbon button group that contains the get version button
            _ribbonGroup = new RibbonGroup(
                "NumediaStack",
                new RibbonItem[]
            {
                new RibbonButton(
                    "Get Version",
                    new DelegateCommand(HandleGetVersion),
                    null,
                    _starImageSmall,
                    _starImageLarge)
            });

            // create a new contextual ribbon tab that will only show up for Numedia Stack
            _contextualTab = new RibbonContextualTab("Numedia Stack Tools", new RibbonItem[] { _ribbonGroup });
        }
コード例 #7
0
        //--------------------------------------------------------------------------
        //
        //	Event Handlers
        //
        //--------------------------------------------------------------------------

        #region Initialize
        /// <summary>
        /// Called when the WebMatrixHost property changes.
        /// </summary>
        /// <param name="Host">Host used to communicate with WebMatrix</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData data)
        {
            // Get new values
            _host = host;
            if (host != null)
            {
                host.WorkspaceChanged += new EventHandler <WorkspaceChangedEventArgs>(WebMatrixHost_WorkspaceChanged);
                host.WebSiteChanged   += new EventHandler <EventArgs>(WebMatrixHost_WebSiteChanged);

                // Add a simple button to the Ribbon
                _ribbonGroup = new RibbonGroup(
                    "Node",
                    new RibbonItem[]
                {
                    new RibbonButton(
                        "Debug",
                        _launchDebuggerCommand,
                        null,
                        _starImageSmall,
                        _starImageLarge)
                });
                data.RibbonItems.Add(_ribbonGroup);
                _editorTaskPanel.PageChanged += InitializeLogTab;

                // handle the right click event the tree
                host.ContextMenuOpening += new EventHandler <ContextMenuOpeningEventArgs>(host_ContextMenuOpening);

                // if this is the first time the extension is installed, this method will be called
                if (_host.WebSite != null && !String.IsNullOrEmpty(_host.WebSite.Path))
                {
                    _isNodeSite            = IsNodeProject();
                    _ribbonGroup.IsVisible = _host.Workspace is IEditorWorkspace && _isNodeSite;
                    InitializeLogTab(this, EventArgs.Empty);
                }

                InstallNodeInspector();
            }
        }
コード例 #8
0
        //--------------------------------------------------------------------------
        //
        //	Event Handlers
        //
        //--------------------------------------------------------------------------      

        #region Initialize
        /// <summary>
        /// Called when the WebMatrixHost property changes.
        /// </summary>
        /// <param name="Host">Host used to communicate with WebMatrix</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData data)
        {
            // Get new values
            _host = host;
            if (host != null)
            {
                host.WorkspaceChanged += new EventHandler<WorkspaceChangedEventArgs>(WebMatrixHost_WorkspaceChanged);
                host.WebSiteChanged += new EventHandler<EventArgs>(WebMatrixHost_WebSiteChanged);

                // Add a simple button to the Ribbon
                _ribbonGroup = new RibbonGroup(
                        "Node",
                        new RibbonItem[]
                        {
                            new RibbonButton(
                                "Debug",
                                _launchDebuggerCommand,
                                null,
                                _starImageSmall,
                                _starImageLarge)
                        });
                data.RibbonItems.Add(_ribbonGroup);
                _editorTaskPanel.PageChanged += InitializeLogTab;

                // handle the right click event the tree
                host.ContextMenuOpening += new EventHandler<ContextMenuOpeningEventArgs>(host_ContextMenuOpening);

                // if this is the first time the extension is installed, this method will be called                                               
                if (_host.WebSite != null && !String.IsNullOrEmpty(_host.WebSite.Path))
                {
                    _isNodeSite = IsNodeProject();
                    _ribbonGroup.IsVisible = _host.Workspace is IEditorWorkspace && _isNodeSite;
                    InitializeLogTab(this, EventArgs.Empty);
                }

                InstallNodeInspector();

            }
        }
コード例 #9
0
        /// <summary>
        /// get a reference to the host when the app starts
        /// </summary>
        /// <param name="host"></param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData data)
        {
            // add host event handlers
            _host = host;
            if (host != null)
            {
                host.WebSiteChanged += new EventHandler<EventArgs>(WebMatrixHost_WebSiteChanged);
                _worker = new Worker(host);

                host.ContextMenuOpening += new EventHandler<ContextMenuOpeningEventArgs>(host_ContextMenuOpening);
                InitSite();
            }
        }
コード例 #10
0
        //--------------------------------------------------------------------------
        //
        //	Methods
        //
        //--------------------------------------------------------------------------

        /// <summary>
        /// Called to initialize the extension.
        /// </summary>
        /// <param name="host">WebMatrix host interface.</param>
        /// <param name="initData">Extension initialization data.</param>
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            _webMatrixHost = host;
            _webMatrixHost.WebSiteChanged += webMatrixHost_WebSiteChanged;
                                  
            // create a new ribbon button group that contains the get version button
            _ribbonGroup = new RibbonGroup(
                   "NumediaStack",
                   new RibbonItem[]
                    {
                        new RibbonButton(
                            "Get Version",
                            new DelegateCommand(HandleGetVersion),
                            null,
                            _starImageSmall,
                            _starImageLarge)
                    });

            // create a new contextual ribbon tab that will only show up for Numedia Stack 
            _contextualTab = new RibbonContextualTab("Numedia Stack Tools", new RibbonItem[] { _ribbonGroup });
        }
コード例 #11
0
        protected override void Initialize(IWebMatrixHost host, ExtensionInitData initData)
        {
            this.webMatrixHost = host;
            this.webMatrixHost.WebSiteChanged += new EventHandler<EventArgs>(host_WebSiteChanged);
            this.webMatrixHost.TreeItemCreated += new EventHandler<TreeItemEventArgs>(webMatrixHost_TreeItemCreated);
            this.webMatrixHost.TreeItemRemoved += new EventHandler<TreeItemEventArgs>(webMatrixHost_TreeItemRemoved);
            this.webMatrixHost.ContextMenuOpening += new EventHandler<ContextMenuOpeningEventArgs>(webMatrixHost_ContextMenuOpening);

            var list = new List<RibbonButton>{
                new RibbonButton("Initialize", this.gitInitCommand, null, Resources.git_init, Resources.git_32),
                //new RibbonButton("Clone", this.gitInitCommand, null, Resources.git_init, Resources.git_32),
                new RibbonButton("Commit Changes", this.gitCommitCommand, null, Resources.git_16, Resources.git_32),
                new RibbonButton("View Log/History", this.gitLogCommand, null, Resources.git_16, Resources.git_32),
                new RibbonButton("Refresh", this.gitRefreshCommand, null, Resources.git_16, Resources.git_32),
                new RibbonButton("Run Git Bash", this.gitBashCommand, null, Resources.git_16, Resources.git_32),
            };
            var button = new RibbonSplitButton("Git", this.gitBashCommand, null, list, Resources.git_16, Resources.git_32);
            initData.RibbonItems.Add(button);
        }