public ColumnDescriptor ResolveDescendant(IdentifierPath identifierPath) { if (identifierPath.IsRoot) { return(this); } ColumnDescriptor parent = ResolveDescendant(identifierPath.Parent); if (parent == null) { return(null); } return(parent.ResolveChild(identifierPath.Name)); }
private ColumnPropertyDescriptor(ColumnDescriptor columnDescriptor, IdentifierPath identifierPath) : base(ColumnPropertyDescriptorBaseName + identifierPath, new Attribute[0]) { if (columnDescriptor.CollectionInfo != null && columnDescriptor.CollectionInfo.IsDictionary) { // Special case dictionary items. // No one wants to see a KeyValuePair displayed in a GridColumn, // so we display the Value instead. ColumnDescriptor = columnDescriptor.ResolveChild("Value"); } if (ColumnDescriptor == null) { ColumnDescriptor = columnDescriptor; } else { ColumnDescriptor = ColumnDescriptor.SetCaption(columnDescriptor.Caption); } IdentifierPath = identifierPath; }