public HGPendingChangesToolWindow() : base(null) { // set the window title this.Caption = Resources.ResourceManager.GetString("HGPendingChangesToolWindowCaption"); // set the CommandID for the window ToolBar //this.ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu); // set the icon for the frame this.BitmapResourceID = CommandId.ibmpToolWindowsImages; // bitmap strip resource ID this.BitmapIndex = CommandId.iconSccProviderToolWindow; // index in the bitmap strip control = new HGPendingChangesToolWindowControl(); // update pending list SccProviderService service = (SccProviderService)SccProvider.GetServiceEx(typeof(SccProviderService)); if (service != null) { UpdatePendingList(service.StatusTracker); } }
protected override void Initialize() { Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); // Proffer the source control service implemented by the provider sccService = new SccProviderService(this); ((IServiceContainer)this).AddService(typeof(SccProviderService), sccService, true); ((IServiceContainer)this).AddService(typeof(System.IServiceProvider), this, true); // Add our command handlers for menu (commands must exist in the .vsct file) InitVSCTMenuCommandHandler(); // Register the provider with the source control manager // If the package is to become active, this will also callback on OnActiveStateChange and the menu commands will be enabled IVsRegisterScciProvider rscp = (IVsRegisterScciProvider)GetService(typeof(IVsRegisterScciProvider)); rscp.RegisterSourceControlProvider(GuidList.guidSccProvider); _OnIdleEvent.RegisterForIdleTimeCallbacks(GetGlobalService(typeof(SOleComponentManager)) as IOleComponentManager); _OnIdleEvent.OnIdleEvent += new OnIdleEvent(sccService.UpdateDirtyNodesGlyphs); //ShowToolWindow(VisualHGToolWindow.PendingChanges); }
private void UpdateGlyphs_Click(object sender, EventArgs e) { SccProviderService sccProviderService = (SccProviderService)GetService(typeof(SccProviderService)); sccProviderService.RefreshNodesGlyphs(); }