当前位置: 首页>>代码示例>>C#>>正文


C# Plugin.AddCommandBar方法代码示例

本文整理汇总了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...");
			}
开发者ID:transformersprimeabcxyz,项目名称:_To-Do-unreal-3D-niftyplugins-ben-marsh,代码行数:51,代码来源:Connect.cs


注:本文中的Plugin.AddCommandBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。