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


C# Commands.CommandInfo类代码示例

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


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

示例1: CommandUpdate

    /// <summary>
    /// Updates the text and visibility of each command with this attribute.
    /// </summary>
    /// <param name="target">Target node handler.</param>
    /// <param name="cinfo">Command info.</param>
    protected override void CommandUpdate(object target, CommandInfo cinfo)
    {
      if (cinfo != null)
      {
        cinfo.Visible = true;
        StyleCopNodeCommandHandler.CancelStypeCopRun = false;

        base.CommandUpdate(target, cinfo);

        if (IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
        {
          // Set the default StyleCop run text.
          if (string.IsNullOrEmpty(cinfo.Text))
          {
            cinfo.Text = StaticStringResources.StyleCopRunText;
          }
        }
        else
        {
          if (IdeApp.ProjectOperations.IsStyleCopRunning())
          {
            cinfo.Text = StaticStringResources.StyleCopCancelText;
            StyleCopNodeCommandHandler.CancelStypeCopRun = true;
          }
        }
      }
    }
开发者ID:DarkCloud14,项目名称:MonoDevelop.StyleCop,代码行数:32,代码来源:NodeAnalysisCommandAttribute.cs

示例2: Update

		protected override void Update (CommandInfo info)
		{
			if (IdeApp.Workspace.IsOpen)
				info.Enabled = IdeApp.ProjectOperations.CurrentSelectedSolution != null && IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted;
			else
				info.Enabled = (IdeApp.Workbench.ActiveDocument != null && IdeApp.Workbench.ActiveDocument.IsBuildTarget);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:ProjectCommands.cs

示例3: RenameCommand_Update

		public void RenameCommand_Update(CommandInfo ci)
		{
			var doc = IdeApp.Workbench.ActiveDocument;
			if (doc == null)
				return;

			var editor = doc.GetContent<ITextBuffer>();
			if (editor == null)
				return;

			var dom = doc.Dom;

			ResolveResult result;
			INode item;
			CurrentRefactoryOperationsHandler.GetItem(dom, doc, editor, out result, out item);

			var options = new RefactoringOptions()
			{
				Document = doc,
				Dom = dom,
				ResolveResult = result,
				SelectedItem = item is InstantiatedType ? ((InstantiatedType)item).UninstantiatedType : item
			};

			// If not a valid operation, allow command to be handled by others
			if (!new RenameRefactoring().IsValid(options))
				ci.Bypass = true;
		}
开发者ID:awatertree,项目名称:monodevelop,代码行数:28,代码来源:RenameTextEditorExtension.cs

示例4: Update

 protected override void Update (CommandInfo info)
 {
     MonoDevelop.Core.LoggingService.LogError ("*********UPDATE");
     info.Enabled = true;
     //MonoDevelop.Ide.Gui.Document doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
     //info.Enabled = doc != null && doc.GetContent<MonoDevelop.Ide.Gui.Content.IEditableTextBuffer> () != null;
  }
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:7,代码来源:InsertDateHandler.cs

示例5: Update

		protected override void Update (CommandInfo info)
		{
			MonoDevelop.Ide.Gui.Document document;
			IList<FixableResult> results;
			info.Enabled = FixOperationsHandler.GetFixes (out document, out results)
			    && results.Any (r => FixOperationsHandler.GetActions (document, r).Any ());
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:AnalysisCommands.cs

示例6: Update

		void Update (CommandInfo cmdInfo)
		{
			updating = true;
			if (Active != cmdInfo.Checked)
				Active = cmdInfo.Checked;
			updating = false;
			
			//same as CommandToolButton
			//only update each if changed, else we grab focus from tooltips during the command scane
			if (lastDesc != cmdInfo.Description) {
				string toolTip;
				if (string.IsNullOrEmpty (cmdInfo.AccelKey)) {
					toolTip = cmdInfo.Description;
				} else {
					toolTip = cmdInfo.Description + " (" + KeyBindingManager.BindingToDisplayLabel (cmdInfo.AccelKey, false) + ")";
				}
				TooltipText = toolTip;
				lastDesc = cmdInfo.Description;
			}
			
			if (Label != cmdInfo.Text)
				Label = cmdInfo.Text;
			if (cmdInfo.Icon != stockId) {
				stockId = cmdInfo.Icon;
				this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
			}
			if (cmdInfo.Enabled != Sensitive)
				Sensitive = cmdInfo.Enabled;
			if (cmdInfo.Visible != Visible)
				Visible = cmdInfo.Visible;
			if (cmdInfo.Icon.IsNull)
				IsImportant = true;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:33,代码来源:CommandToggleToolButton.cs

示例7: Update

        protected override void Update(CommandInfo info)
        {
            try
            {
                /* Pregunta si algun projecto se encuentra abierto para habilitar la opcion */
                if(IdeApp.Workspace.IsOpen)
                {
                    /* Obtiene el proyecto actualmente seleccionado */
                    //MonoDevelop.Projects.Project startupProject = (MonoDevelop.Projects.Project)IdeApp.Workspace.GetAllSolutions()[0].StartupItem;
                    MonoDevelop.Projects.Project currentProject = IdeApp.ProjectOperations.CurrentSelectedProject;

                    /* Si el tipo de proyecto es un proyecto web, habilitamos la opcion en el menu Project */
                    if(currentProject != null && currentProject.ProjectType == "AspNetApp")
                        info.Enabled = true;
                    else
                        info.Enabled = false;
                }
                else
                    info.Enabled = false;
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:denisjev,项目名称:SubscriptionService,代码行数:25,代码来源:ConnectionHandler.cs

示例8:

		void ICommandMenuItem.SetUpdateInfo (CommandInfo cmdInfo, object initialTarget)
		{
			isArrayItem = true;
			arrayDataItem = cmdInfo.DataItem;
			this.initialTarget = initialTarget;
			Update (cmdInfo);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:CommandCheckMenuItem.cs

示例9: CommandResult

 public CommandResult(Command cmd, CommandInfo ci, CommandTargetRoute route, string match, string matchedString, int rank)
     : base(match, matchedString, rank)
 {
     this.ci = ci;
     command = cmd;
     this.route = route;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:SearchResult.cs

示例10: Update

		protected override void Update (CommandInfo info)
		{
			info.Enabled = IdeApp.Workbench.ActiveDocument != null && 
				IdeApp.Workbench.ActiveDocument.Editor != null &&
				IdeApp.Workbench.ActiveDocument.Editor.Document.MimeType == "text/x-csharp";
			base.Update (info);
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:7,代码来源:Commands.cs

示例11: Update

		void Update (CommandInfo cmdInfo)
		{
			if (lastDesc != cmdInfo.Description) {
				string toolTip;
				if (string.IsNullOrEmpty (cmdInfo.AccelKey)) {
					toolTip = cmdInfo.Description;
				} else {
					toolTip = cmdInfo.Description + " (" + KeyBindingManager.BindingToDisplayLabel (cmdInfo.AccelKey, false) + ")";
				}
				TooltipText = toolTip;
				lastDesc = cmdInfo.Description;
			}
			
			if (Label != cmdInfo.Text)
				Label = cmdInfo.Text;
			if (cmdInfo.Icon != stockId) {
				stockId = cmdInfo.Icon;
				this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
			}
			if (cmdInfo.Enabled != Sensitive)
				Sensitive = cmdInfo.Enabled;
			if (cmdInfo.Visible != Visible)
				Visible = cmdInfo.Visible;
			if (cmdInfo.Icon.IsNull)
				IsImportant = true;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:26,代码来源:CommandToolButton.cs

示例12: OnUpdateExclude

		public void OnUpdateExclude (CommandInfo cinfo)
		{
			bool anyChecked = false;
			bool allChecked = true;
			bool anyEnabled = false;
			bool allEnabled = true;
			
			foreach (ITreeNavigator node in CurrentNodes) {
				ProjectFile file = (ProjectFile) node.DataItem;
				if (file.Project != null) {
					MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
					if (data != null && data.IsFileIntegrationEnabled (file.BuildAction)) {
						anyEnabled = true;
						if (!data.IsFileExcluded (file.FilePath)) {
							anyChecked = true;
						} else {
							allChecked = false;
						}
					} else {
						allEnabled = false;
					}
				}
			}
				
			cinfo.Visible = anyEnabled;
			cinfo.Enabled = anyEnabled && allEnabled;
			cinfo.Checked = anyChecked;
			cinfo.CheckedInconsistent = anyChecked && !allChecked;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:29,代码来源:FileNodeBuilderExtension.cs

示例13: Update

		protected override void Update (CommandInfo info)
		{
			//if no open window or only one
			if (IdeApp.Workbench.Documents.Count < 2) {
				info.Enabled = false;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:WindowCommands.cs

示例14: Update

        protected override void Update(CommandInfo info)
        {
            //info.Enabled = IsSupportedFile;
            info.Text = _presenter.IsConnected ? "Disconnect" : "Connect";

            Console.WriteLine (info.Command.Id);
        }
开发者ID:prashantvc,项目名称:FormsPlayer,代码行数:7,代码来源:FormsPlayerConnectHandler.cs

示例15: Insert

		public void Insert (int index, CommandInfo info, object dataItem)
		{
			info.DataItem = dataItem;
			if (info.Text == null) info.Text = defaultInfo.Text;
			if (info.Icon.IsNull) info.Icon = defaultInfo.Icon;
			list.Insert (index, info);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:CommandArrayInfo.cs


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