public UIContextHandler(AlcantareaPackage host) { m_host = host; IVsMonitorSelection service = Package.GetGlobalService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection; if (service != null) { service.GetCmdUIContextCookie(VSConstants.UICONTEXT.SolutionExists_guid, out m_cookie_solution); service.GetCmdUIContextCookie(VSConstants.UICONTEXT.Debugging_guid, out m_cookie_debugging); service.GetCmdUIContextCookie(VSConstants.UICONTEXT.DesignMode_guid, out m_cookie_design); service.AdviseSelectionEvents(this, out m_cookie); } }
public static List <alcSymbolFilterColumn> GetDefaultFilter(String path_to_obj, bool show_error = true) { List <alcSymbolFilterColumn> ret = null; try { ret = AlcantareaHelper.GetDefaultSymbolFilter(path_to_obj, true); } catch (Exception e) { if (show_error) { AlcantareaPackage.ShowMessage("Alcantarea: Error", e.Message); } } return(ret); }
/// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public AlcantareaPackage() { Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); Instance = this; m_addindir = Path.GetDirectoryName(typeof(AlcantareaPackage).Assembly.Location); try { AlcantareaHelper.Startup(m_addindir); } catch (Exception er) { ShowMessage("Alcantarea: Notice", er.Message); } Guid cmdset = GuidList.guidAlcantareaCmdSet; m_commands = new CommandData[] { new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcStartDebugging), onStartDebugging, (int c) => { return((c & (int)UIContext.Debugging) == 0); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcAttachToDebugee), onAttachToDebugee, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.Debugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcApplyChange), onApplyChange, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.AlcDebugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcSymbolFilter), onSymbolFilter, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.AlcDebugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcToggleSuspend), onToggleSuspend, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.AlcDebugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcReloadSymbols), onLoadSymbols, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.AlcDebugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcLoadObjFiles), onLoadObjFiles, (int c) => { return((c & (int)UIContext.AlcDebugging) == (int)UIContext.AlcDebugging); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcReloadObjFiles), onReloadObjFiles, (int c) => { return((c & (int)UIContext.Debugging) != 0 && AlcantareaPackage.Instance.LastLoadedObjFiles != null && AlcantareaPackage.Instance.LastLoadedObjFiles.Length > 0); }), new CommandData(new CommandID(cmdset, (int)PkgCmdIDList.alcOptions), onOptions, (int c) => { return(true); }), }; m_uichandler = new UIContextHandler(this); GlobalConfig = new alcGlobalConfig(); }
public UIContextHandler(AlcantareaPackage host) { m_host = host; IVsMonitorSelection service = Package.GetGlobalService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection; if (service != null) { service.GetCmdUIContextCookie(VSConstants.UICONTEXT.SolutionExists_guid, out m_cookie_solution); service.GetCmdUIContextCookie(VSConstants.UICONTEXT.Debugging_guid, out m_cookie_debugging); service.GetCmdUIContextCookie(VSConstants.UICONTEXT.DesignMode_guid, out m_cookie_design); service.AdviseSelectionEvents(this, out m_cookie); } }