示例#1
0
        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;
            }
        }
示例#2
0
   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);
   }
示例#3
0
        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);
        }
示例#4
0
        /// <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);
        }
示例#5
0
 /// <summary>
 /// Used to sort specifications.
 /// </summary>
 public int CompareTo(CommandSpec spec)
 {
     return this.Name.CompareTo(spec.Name);
 }
示例#6
0
 public void Add(CommandSpec Spec)
 {
     iItems.Add(Spec);
 }
示例#7
0
 /// <summary>
 /// Used to sort specifications.
 /// </summary>
 public int CompareTo(CommandSpec spec)
 {
     return(this.Name.CompareTo(spec.Name));
 }
示例#8
0
 public void Add(CommandSpec Spec)
 {
     iItems.Add(Spec);
 }