當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。