Example #1
0
		internal void NotifySelected (CommandInfo cmdInfo)
		{
			if (CommandSelected != null) {
				CommandSelectedEventArgs args = new CommandSelectedEventArgs (cmdInfo);
				CommandSelected (this, args);
			}
		}
		static void OnCommandSelected (object s, CommandSelectedEventArgs args)
		{
			string msg = args.CommandInfo.Description;
			if (string.IsNullOrEmpty (msg)) {
				msg = args.CommandInfo.Text;
				// only replace _ outside of markup: usecase : Field <b>some_field</b>
				int idx = msg.IndexOf ('<');
				if (idx < 0)
					idx = msg.Length;
				msg = msg.Substring (0, idx).Replace ("_", "") + msg.Substring (idx);
			}
			if (!string.IsNullOrEmpty (msg)) {
				if (menuDescriptionContext == null)
					menuDescriptionContext = Workbench.StatusBar.CreateContext ();
				menuDescriptionContext.ShowMessage (msg, args.CommandInfo.UseMarkup);
			}
		}