示例#1
0
        private void AddAndRefreshVariableToVariableList()
        {
            selections.Add(CreateCurrentSelectionVariable());
            lastSelectionVariable = selections.Last();
            DisplayTextList.Add(selections.Last().ToString(inputText));

            RefreshItemDataSource(DisplayListBox, DisplayTextList);

            SetOutputText(inputText, 10);
        }
示例#2
0
        internal string GenerateListOfInputVariables()
        {
            // Get Text in input box
            // Find all matches for
            // regex string (" " || "(" || "." || "{" || "[")  + \w+\d
            // e.g starts with space, left bracket, full stop, left curly brace, or left square bracket
            // Contains any number of non numeric letters, and ends with a digits
            string regexPattern          = "[\\s \\( \\. \\{ \\[ ]([A-Za-z]+\\d+)";
            var    collectionOfVariables = Regex.Matches(inputText, regexPattern);


            // foreach match, place in variables list if not already in list
            foreach (Match match in collectionOfVariables)
            {
                DisplayTextList.Add(new SelectionVariable(match.Index + 1, match.Length - 1).ToString(inputText));
            }

            RefreshItemDataSource(DisplayListBox, DisplayTextList);

            return(string.Empty);
        }