internal ElementMetadata( ReadOnlyArray <AttributeMetadata> attributes, ReadOnlyArray <IValidator> validators, ReadOnlyArray <IValidator> constraints, FileFormatVersions version, OpenXmlSchema schema, CompiledParticle particle, Lazy <ElementLookup> lookup) { Attributes = attributes; Validators = validators; Constraints = constraints; Availability = version; Schema = schema; Particle = particle; _children = lookup; }
public OpenXmlElement?Create(OpenXmlSchema schema) { if (_data.Length == 0) { return(null); } // This is on a hot-path and using a dictionary adds substantial time to the lookup. Most child lists are small, so using a sorted // list to store them with a binary search improves overall performance. var idx = Array.BinarySearch(_data, new ElementChild(null, schema), ElementChildNameComparer.Instance); if (idx < 0) { return(null); } return(_data[idx].Create()); }
private ActivatorElementChild(Type child, OpenXmlSchema schema) : base(child, schema.NamespaceId, schema.Tag) { }
public ElementChild(Type?type, OpenXmlSchema schema) { Type = type; Schema = schema; }