本文整理汇总了C#中Plugin.AddCommandBar方法的典型用法代码示例。如果您正苦于以下问题:C# Plugin.AddCommandBar方法的具体用法?C# Plugin.AddCommandBar怎么用?C# Plugin.AddCommandBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin.AddCommandBar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnConnection
public void OnConnection(object application_, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
if(null != m_plugin)
return;
// Load up the options from file.
string optionsFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "NiftySolution.xml");
Options options = Options.Load(optionsFileName);
// Create our main plugin facade.
DTE2 application = (DTE2)application_;
m_plugin = new Plugin(application, (AddIn)addInInst, "NiftySolution", "Aurora.NiftySolution.Connect", options);
// Every plugin needs a command bar.
CommandBar commandBar = m_plugin.AddCommandBar("NiftySolution", MsoBarPosition.msoBarTop);
m_commandRegistry = new CommandRegistry(m_plugin, commandBar);
// Initialize the logging system.
if(Log.HandlerCount == 0)
{
#if DEBUG
Log.AddHandler(new DebugLogHandler());
#endif
Log.AddHandler(new VisualStudioLogHandler(m_plugin.OutputPane));
Log.Prefix = "NiftySolution";
}
// Now we can take care of registering ourselves and all our commands and hooks.
Log.Debug("Booting up...");
Log.IncIndent();
bool doBindings = options.EnableBindings;
m_commandRegistry.RegisterCommand("NiftyOpen", doBindings, new QuickOpen(m_plugin));
m_commandRegistry.RegisterCommand("NiftyToggle", doBindings, new ToggleFile(m_plugin));
m_commandRegistry.RegisterCommand("NiftyClose", doBindings, new CloseToolWindow(m_plugin));
m_commandRegistry.RegisterCommand("NiftyConfigure", doBindings, new Configure(m_plugin));
if (options.SilentDebuggerExceptions || options.IgnoreDebuggerExceptions)
{
m_debuggerEvents = application.Events.DebuggerEvents;
m_debuggerEvents.OnExceptionNotHandled += new _dispDebuggerEvents_OnExceptionNotHandledEventHandler(OnExceptionNotHandled);
}
m_timings = new SolutionBuildTimings(m_plugin);
Log.DecIndent();
Log.Debug("Initialized...");
}