public ShapeElementBase() { ColumnIndexes = new List <Index>(); RowIndexes = new List <Index>(); Commands = new List <Command>(); ChildShapes = new List <ChildShapeElement>(); UseRowHeaders = false; UseColumnHeaders = false; DataDescriptor = new DataElementDescriptor(); AdditionalDataDescriptors = new List <DataElementDescriptor>(); }
protected void ExtractIndexes(DataElementDescriptor dataDescriptor) { if (!isMainIndexExtracted) { dataDescriptor.ExtractColumnIndexes(ColumnIndexes); dataDescriptor.ExtractRowIndexes(RowIndexes); isMainIndexExtracted = true; } else { ChildShapeElement childShape = new ChildShapeElement(); dataDescriptor.ExtractColumnIndexes(childShape.ColumnIndexes); dataDescriptor.ExtractRowIndexes(childShape.RowIndexes); ChildShapes.Add(childShape); } }
public bool ParseNameString() { string nameToParse = FullName.Replace('“', '"').Replace('”', '"'); DataElementDescriptor dataDescriptor = DataDescriptor; if (ParseIntoDescriptor(nameToParse)) { //DataElementDescriptor additionalDescriptor; //while (ParseIntoDescriptor(CommandString, additionalDescriptor = new DataElementDescriptor())) //{ // AdditionalDataDescriptors.Add(additionalDescriptor); //} return(true); } return(false); }
private bool ParseIntoDescriptor(string nameToParse) { Match match = nameParseRegex.Match(nameToParse); if (match.Success) { string indexes = match.Groups["indexes"].Value; CommandString = match.Groups["commands"].Value; string name = match.Groups["name"].Value; if (!string.IsNullOrEmpty(indexes)) { foreach (var fragment in indexes.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries)) { Match indexMatch = indexParseRegex.Match(fragment); if (!CommandManager.KnownCommandsWithoutArguments.Contains(name.ToUpper())) //KAJ: Is this ever false? { DataElementDescriptor dataDescriptor = new DataElementDescriptor(); dataDescriptor.Name = name; if (indexMatch.Success) { dataDescriptor.RowIndexesString = indexMatch.Groups["rows"].Value; dataDescriptor.ColumnIndexesString = indexMatch.Groups["columns"].Value; } else { dataDescriptor.RowIndexesString = match.Groups["rows"].Value; dataDescriptor.ColumnIndexesString = match.Groups["columns"].Value; } AdditionalDataDescriptors.Add(dataDescriptor); } } } else { DataElementDescriptor dataDescriptor = new DataElementDescriptor(); dataDescriptor.Name = name; dataDescriptor.RowIndexesString = null; dataDescriptor.ColumnIndexesString = null; AdditionalDataDescriptors.Add(dataDescriptor); } return(true); } return(false); }