private void UpdateCmdSyntax() { // Update command syntax on status bar: string text = PipeTextBox.Text + System.Environment.NewLine; int startIndex = PipeTextBox.GetFirstCharIndexOfCurrentLine(); int endIndex = text.IndexOf(System.Environment.NewLine, startIndex); int length = endIndex - startIndex; if (length > 0) { text = PipeTextBox.Text.Substring(startIndex, length); string filterName = ParseFilterName(text); CommandSpec cmdSpec = GetCmdSpec(filterName); if (cmdSpec != null) { mainStatusStripHintLabel.Text = cmdSpec.Name + " " + cmdSpec.Prompt; } else { mainStatusStripHintLabel.Text = string.Empty; } } else { mainStatusStripHintLabel.Text = string.Empty; } }
public void AddCoreSpec(string typeName, string iconName, string template, string prompt, string shortDesc, string assyPath) { string[] parts = typeName.Split(new char[] {'.'}, StringSplitOptions.None); string name = parts[parts.Length-1]; CommandSpec Spec = new CommandSpec(name, typeName, iconName, template, shortDesc, prompt, assyPath, true); iItems.Add(Spec); }
public void AddNonCoreSpec(string typeName, string iconName, string template, string prompt, string shortDesc, string assyPath) { string[] parts = typeName.Split(new char[] { '.' }, StringSplitOptions.None); string name = parts[parts.Length - 1]; CommandSpec Spec = new CommandSpec(name, typeName, iconName, template, shortDesc, prompt, assyPath, false); iItems.Add(Spec); }
/// <summary> /// Returns a CommandSpec object given a filter name. /// </summary> private CommandSpec GetCmdSpec(string filterName) { CommandSpec result = null; foreach (CommandSpec cmdSpec in PipeEng.CmdSpecs) { if (filterName.ToUpper() == cmdSpec.Name.ToUpper()) { result = cmdSpec; break; } } return(result); }
/// <summary> /// Used to sort specifications. /// </summary> public int CompareTo(CommandSpec spec) { return this.Name.CompareTo(spec.Name); }
public void Add(CommandSpec Spec) { iItems.Add(Spec); }
/// <summary> /// Used to sort specifications. /// </summary> public int CompareTo(CommandSpec spec) { return(this.Name.CompareTo(spec.Name)); }