public void ProcessLine(string line)
        {
            string lineTrimmed = line.Trim();

            if (!RegularExpressions.ColumnName.IsMatch(line) && !RegularExpressions.ValueItemName.IsMatch(line))
            {
                if (ExistingGridsAssignment.IsMatch(lineTrimmed))
                {
                    GridPropertyReader.ProcessGridProperty(grids, columns, valueItems, lineTrimmed);
                    outputDesignerLines.Add(line);
                }
                else if (columns.Count > 0 && ExistingColumnsAssignment.IsMatch(lineTrimmed))
                {
                    ColumnPropertyReader.ProcessColumnInstanceProperty(columns, valueItems, lineTrimmed);
                }
                else if (valueItems.Count > 0 && ExistingValueItemsAssignment.IsMatch(lineTrimmed))
                {
                    ValueItemPropertyReader.ProcessValueItemInstanceProperty(valueItems, line);
                }
                else
                {
                    outputDesignerLines.Add(line);
                }
            }
        }
Exemple #2
0
        public static void ProcessValueItemCollectionProperty(ValueItemCollection valueItems, Dictionary <string, ValueItem> valueItemsDict, string line, string value)
        {
            //Verify to Regular expression is match with the line
            MatchCollection matches  = RegularExpressions.PropertyRegex.Matches(line);
            GroupCollection groups   = matches[0].Groups;
            string          property = groups[2].Value;

            switch (property.ToUpper())
            {
            case nameof(ValueItemCollectionProperties.VALUES):
                if (groups[10].Value == "Add")
                {
                    string argument = groups[15].Value;
                    if (!argument.StartsWith("new "))
                    {
                        string valueItemName = argument.Split('.')[1];
                        valueItems.Values.Add(valueItemsDict[valueItemName]);
                    }
                }
                else
                {
                    int       valueItemIndex = Utilities.StringToIndex(groups[5].Value);
                    ValueItem valueItem      = Utilities.GetCreateListElement <ValueItem>(valueItems.Values, valueItemIndex);
                    ValueItemPropertyReader.ProcessValueItemProperty(valueItem, groups[8].Value, value);
                }
                break;

            default:
                valueItems.Properties[property] = Utilities.CleanXMLProperty(value);
                break;
            }
        }