private IEnumerable<SemanticSchemaFieldData> GetSemanticSchemaFields( IEnumerable<ItemFieldDefinition> schemaFields, SemanticTypeData[] semanticTypes, Schema schema, string contextPath ) { List<SemanticSchemaFieldData> semanticSchemaFields = new List<SemanticSchemaFieldData>(); if (schemaFields == null) { return semanticSchemaFields; } foreach (ItemFieldDefinition schemaField in schemaFields) { SemanticSchemaFieldData semanticSchemaField = new SemanticSchemaFieldData { Name = schemaField.Name, Path = string.Format("{0}/{1}", contextPath, schemaField.Name), IsMultiValue = schemaField.MaxOccurs != 1, Semantics = GetSemanticProperties(schemaField, semanticTypes, schema).ToArray() }; EmbeddedSchemaFieldDefinition embeddedSchemaField = schemaField as EmbeddedSchemaFieldDefinition; if (embeddedSchemaField == null) { semanticSchemaField.Fields = new SemanticSchemaFieldData[0]; } else { Schema embeddedSchema = embeddedSchemaField.EmbeddedSchema; semanticSchemaField.Fields = GetSemanticSchemaFields( embeddedSchemaField.EmbeddedFields, semanticTypes.Concat(GetSemanticTypes(embeddedSchema)).ToArray(), embeddedSchema, semanticSchemaField.Path ).ToArray(); } semanticSchemaFields.Add(semanticSchemaField); } return semanticSchemaFields; }
public override bool Equals(object obj) { SemanticTypeData other = obj as SemanticTypeData; return((other != null) && (other.Prefix == Prefix) && (other.Entity == Entity)); }