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


C# CommandArrayInfo.Add方法代码示例

本文整理汇总了C#中MonoDevelop.Components.Commands.CommandArrayInfo.Add方法的典型用法代码示例。如果您正苦于以下问题:C# CommandArrayInfo.Add方法的具体用法?C# CommandArrayInfo.Add怎么用?C# CommandArrayInfo.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Components.Commands.CommandArrayInfo的用法示例。


在下文中一共展示了CommandArrayInfo.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

		protected override void Update(CommandArrayInfo info)
		{
			if (IdeApp.Workspace.IsOpen) {
				info.Add("Default", "Default").Checked = !IsRoslynCompilerSet;
				info.Add("Roslyn", "Roslyn").Checked = IsRoslynCompilerSet;
			}
		}
开发者ID:berlamont,项目名称:RoslynCompilerAddIn,代码行数:7,代码来源:SelectActiveCompilerHandler.cs

示例2: GenerateExecutionModeCommands

        public static void GenerateExecutionModeCommands(SolutionEntityItem project, CanExecuteDelegate runCheckDelegate, CommandArrayInfo info)
        {
            CommandExecutionContext ctx = new CommandExecutionContext (project, runCheckDelegate);
            bool supportsParameterization = false;

            foreach (List<IExecutionMode> modes in GetExecutionModeCommands (ctx, false, true)) {
                foreach (IExecutionMode mode in modes) {
                    CommandInfo ci = info.Add (mode.Name, new CommandItem (ctx, mode));
                    if ((mode.ExecutionHandler is ParameterizedExecutionHandler) || ((mode is CustomExecutionMode) && ((CustomExecutionMode)mode).PromptForParameters)) {
                        // It will prompt parameters, so we need command to end with '..'.
                        // However, some commands may end with '...' already and we don't want to break
                        // already-translated strings by altering them
                        if (!ci.Text.EndsWith ("..."))
                            ci.Text += "...";
                        supportsParameterization = true;
                    } else {
                        // The parameters window will be shown if ctrl is pressed
                        ci.Description = GettextCatalog.GetString ("Run With: {0}", ci.Text);
                        if (SupportsParameterization (mode, ctx)) {
                            ci.Description += " - " + GettextCatalog.GetString ("Hold Control key to display the execution parameters dialog.");
                            supportsParameterization = true;
                        }
                    }
                }
                if (info.Count > 0)
                    info.AddSeparator ();
            }
            if (supportsParameterization) {
                info.AddSeparator ();
                info.Add (GettextCatalog.GetString ("Edit Custom Modes..."), new CommandItem (ctx, null));
            }
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:ExecutionModeCommandService.cs

示例3: Update

        protected override void Update(CommandArrayInfo info)
        {
            ResolverContextStack ctxt;
            var rr = Resolver.DResolverWrapper.ResolveHoveredCode(out ctxt);

            bool noRes = true;

            if (rr != null && rr.Length > 0)
            {
                res = rr[rr.Length - 1];

                n = DResolver.GetResultMember(res);

                if (n != null)
                {
                    noRes = false;
                    info.Add(IdeApp.CommandService.GetCommandInfo(RefactoryCommands.GotoDeclaration), new Action(GotoDeclaration));
                    info.Add(IdeApp.CommandService.GetCommandInfo(RefactoryCommands.FindReferences), new Action(FindReferences));

                    if (RenamingRefactoring.CanRename(n))
                    {
                        info.AddSeparator();
                        info.Add(IdeApp.CommandService.GetCommandInfo(EditCommands.Rename), new Action(RenameSymbol));
                    }
                }
            }

            if(noRes)
                info.Add(IdeApp.CommandService.GetCommandInfo(RefactoryCommands.ImportSymbol), new Action(ImportSymbol));

            info.Add(IdeApp.CommandService.GetCommandInfo(Commands.OpenDDocumentation), new Action(OpenDDoc));
        }
开发者ID:gavin-norman,项目名称:Mono-D,代码行数:32,代码来源:Commands.cs

示例4: Update

        protected override void Update(CommandArrayInfo info)
        {
            if (caps.Update ()) {
                if (caps.resultResolutionAttempt != DResolver.NodeResolutionAttempt.RawSymbolLookup) {
                    var refactoringMenu = new CommandInfoSet { Text = GettextCatalog.GetString ("Refactoring") };

                    if(caps.lastResults.Any(t => t is DSymbol && DRenameRefactoring.CanRenameNode ((t as DSymbol).Definition)))
                        refactoringMenu.CommandInfos.Add (IdeApp.CommandService.GetCommandInfo (EditCommands.Rename), new Action (caps.RenameSymbol));

                    if (refactoringMenu.CommandInfos.Count > 0)
                        info.Add (refactoringMenu);

                    info.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.GotoDeclaration), new Action (caps.GotoDeclaration));
                    info.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindReferences), new Action (() => caps.FindReferences (false)));

                    if (caps.lastResults.Any (t => t is DSymbol && (t as DSymbol).Definition.Parent is DClassLike))
                        info.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindAllReferences), new Action (() => caps.FindReferences (true)));

                    if (caps.lastResults.Any (t => {
                        var ds = DResolver.StripMemberSymbols (t);
                        return ds is ClassType || ds is InterfaceType;
                    }))
                        info.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindDerivedClasses), new Action (caps.FindDerivedClasses));
                } else {
                    var importSymbolMenu = new CommandInfoSet { Text = GettextCatalog.GetString ("Resolve") };

                    var alreadyAddedItems = new List<INode> ();
                    foreach (var t in caps.lastResults) {
                        var ds = t as DSymbol;
                        if (ds == null)
                            continue;
                        var m = ds.Definition.NodeRoot as DModule;
                        if (m != null && !alreadyAddedItems.Contains (m)) {
                            alreadyAddedItems.Add (m);
                            importSymbolMenu.CommandInfos.Add (new CommandInfo {
                                Text = "import " + AbstractNode.GetNodePath (m, true) + ";",
                                Icon = MonoDevelop.Ide.Gui.Stock.AddNamespace
                            }, new object[]{ "a", ds.Definition });
                        }
                    }

                    if (importSymbolMenu.CommandInfos.Count > 0) {
                        // To explicitly show the Ctrl+Alt+Space hint.
                        importSymbolMenu.CommandInfos.AddSeparator ();
                        importSymbolMenu.CommandInfos.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.ImportSymbol), new Action (caps.TryImportMissingSymbol));

                        info.Add (importSymbolMenu);
                    }
                }
            }

            if(SortImportsCommandHandler.CanSortImports(caps.lastDoc))
                info.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.SortImports), new Action(()=>SortImportsCommandHandler.SortImports(caps.lastDoc)));
        }
开发者ID:foerdi,项目名称:Mono-D,代码行数:54,代码来源:ContextMenuRefactoringCommandHandler.cs

示例5: Update

		protected override void Update (CommandArrayInfo ainfo)
		{
			CommandInfo info = ainfo.Add (GettextCatalog.GetString ("_Errors & Warnings"), new Action (delegate {
				MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles = MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
			}));
			info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles == MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
			
			info = ainfo.Add (GettextCatalog.GetString ("E_rrors only"), new Action (delegate {
				MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles = MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
			}));
			info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles == MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:12,代码来源:MessageBubbleCommands.cs

示例6: Update

		protected override void Update (CommandArrayInfo ainfo)
		{
			ainfo.Add (NavigationBar.HideStatusBox ? GettextCatalog.GetString ("_Show Caret Panel") : GettextCatalog.GetString ("_Hide Caret Panel"), new System.Action (delegate {
				IdeApp.Workbench.StatusBar.ClearCaretState ();
				NavigationBar.HideStatusBox = !NavigationBar.HideStatusBox;
			}));
			
			if (!NavigationBar.HideStatusBox) {
				ainfo.Add (StatusBox.ShowRealColumns ? GettextCatalog.GetString ("_Show logical caret position") : GettextCatalog.GetString ("_Show visual caret position") , new System.Action (delegate {
					StatusBox.ShowRealColumns = !StatusBox.ShowRealColumns;
				}));
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:NavigationBarCommands.cs

示例7: Update

		protected override void Update (CommandArrayInfo info)
		{
			if (DbFactoryService.DbFactoryCount > 0) {
				foreach (IDbFactory fac in DbFactoryService.DbFactories) {
					CommandInfo cmd = new CommandInfo (fac.Name);
					cmd.Icon = "md-db-database";
					info.Add (cmd, fac);
				}
			} else {
				CommandInfo cmd = new CommandInfo (AddinCatalog.GetString ("No database providers detected."));
				cmd.Enabled = false;
				info.Add (cmd, null);
			}
		}		
开发者ID:Kalnor,项目名称:monodevelop,代码行数:14,代码来源:AbstractDatabaseProviderList.cs

示例8: Update

		protected override void Update (CommandArrayInfo ainfo)
		{
			CommandInfo info = ainfo.Add (GettextCatalog.GetString ("E_rrors"), new Action (delegate {
				IdeApp.Preferences.ShowMessageBubbles.Value = ShowMessageBubbles.ForErrors;
				IdeApp.Preferences.DefaultHideMessageBubbles.Value = false;
			}));
			info.Checked = !IdeApp.Preferences.DefaultHideMessageBubbles && IdeApp.Preferences.ShowMessageBubbles.Value == ShowMessageBubbles.ForErrors;

			info = ainfo.Add (GettextCatalog.GetString ("_Errors and Warnings"), new Action (delegate {
				IdeApp.Preferences.ShowMessageBubbles.Value = ShowMessageBubbles.ForErrorsAndWarnings;
				IdeApp.Preferences.DefaultHideMessageBubbles.Value = false;
			}));
			info.Checked = !IdeApp.Preferences.DefaultHideMessageBubbles && IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrorsAndWarnings;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:14,代码来源:MessageBubbleCommands.cs

示例9: OnAddSpecialDirectoryUpdate

		public void OnAddSpecialDirectoryUpdate (CommandArrayInfo info)
		{
			var proj = CurrentNode.DataItem as DotNetProject;
			if (proj == null)
				return;

			var asp = proj.GetFlavor<AspNetAppProjectFlavor> ();
			if (asp == null)
				return;

			List<string> dirs = new List<string> (asp.GetSpecialDirectories ());
			dirs.Sort ();
			List<FilePath> fullPaths = new List<FilePath> (dirs.Count);
			foreach (string s in dirs)
				fullPaths.Add (proj.BaseDirectory.Combine (s));
			RemoveDirsNotInProject (fullPaths, proj);

			if (fullPaths.Count == 0)
				return;

			foreach (string dir in dirs) {
				if (!fullPaths.Contains (proj.BaseDirectory.Combine (dir)))
					continue;
				info.Add (dir.Replace("_", "__"), dir);
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:26,代码来源:AspNetProjectNodeCommandHandler.cs

示例10: OnUpdateViewToolbar

		protected void OnUpdateViewToolbar (CommandArrayInfo info)
		{
			foreach (IDockToolbar bar in Toolbars) {
				CommandInfo cmd = new CommandInfo (bar.Title);
				cmd.Checked = bar.Visible;
				cmd.Description = AddinManager.CurrentLocalizer.GetString ("Show toolbar '{0}'", bar.Title);
				info.Add (cmd, bar);
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:CommandFrame.cs

示例11: Update

		protected override void Update (CommandArrayInfo info)
		{
			foreach (ExternalTools.ExternalTool externalTool in ExternalTools.ExternalToolService.Tools) {
				//Create CommandInfo object
				CommandInfo commandInfo = new CommandInfo ();
				commandInfo.Text = externalTool.MenuCommand;
				commandInfo.Description = GettextCatalog.GetString ("Start tool") + " " + string.Join (string.Empty, externalTool.MenuCommand.Split('&'));

				//Add menu item
				info.Add (commandInfo, externalTool);

			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:ToolsCommands.cs

示例12: Update

		protected override void Update (CommandArrayInfo info)
		{
			IWorkspaceObject wob = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
			GitRepository repo = VersionControlService.GetRepository (wob) as GitRepository;
			if (repo != null) {
				string currentBranch = repo.GetCurrentBranch ();
				foreach (string branch in repo.GetBranches ()) {
					CommandInfo ci = info.Add (branch, branch);
					if (branch == currentBranch)
						ci.Checked = true;
				}
			}
		}
开发者ID:acken,项目名称:monodevelop,代码行数:13,代码来源:Commands.cs

示例13: Update

		protected override void Update (CommandArrayInfo info)
		{
			var proj = IdeApp.ProjectOperations.CurrentSelectedProject as IPhoneProject;
			if (proj == null)
				return;
			
			var workspaceConfig = IdeApp.Workspace.ActiveConfigurationId;
			var conf = proj.GetConfiguration (new SolutionConfigurationSelector (workspaceConfig)) as IPhoneProjectConfiguration;
			if (conf == null || conf.Platform != IPhoneProject.PLAT_SIM)
				return;
			
			var projSetting = proj.GetSimulatorTarget (conf);
			
			var def = info.Add ("Default", null);
			if (projSetting == null)
				def.Checked  = true;
			
			foreach (var st in IPhoneFramework.GetSimulatorTargets (IPhoneSdkVersion.Parse (conf.MtouchMinimumOSVersion), proj.SupportedDevices)) {
				var i = info.Add (st.ToString (), st);
				if (projSetting != null && projSetting.Equals (st))
					i.Checked  = true;
			}
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:23,代码来源:IPhoneCommands.cs

示例14: Update

		protected override void Update (CommandArrayInfo info)
		{
			var proj = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject ();
			if (proj == null || !MonoDroidFramework.HasAndroidJavaSdks)
				return;
			
			var conf = (MonoDroidProjectConfiguration) proj.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
			var projSetting = proj.GetDeviceTarget (conf);
			
			foreach (var st in MonoDroidFramework.DeviceManager.Devices) {
				var i = info.Add (st.ID, st);
				if (projSetting != null && projSetting.Equals (st))
					i.Checked  = true;
			}
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:15,代码来源:MonoDroidCommands.cs

示例15: Update

        protected override void Update(CommandArrayInfo info)
        {
            var project = IdeApp.ProjectOperations.CurrentSelectedProject as DnxProject;
            if (project == null) {
                info.Bypass = true;
                return;
            }

            foreach (DnxFramework framework in project.GetFrameworks ()) {
                CommandInfo item = info.Add (framework.FriendlyName, framework);
                if (framework.Name == project.CurrentFramework) {
                    item.Checked = true;
                }
            }
        }
开发者ID:fogzot,项目名称:monodevelop-dnx-addin,代码行数:15,代码来源:SelectActiveRuntimeCommandHandler.cs


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