protected override void SetItem(int index, KnownSchema item) { KnownSchema knownSchema = Items[index]; if (!UriComparer.Instance.Equals(item.Id, knownSchema.Id)) { UriKnownSchemaLookup.Remove(knownSchema.Id); UriKnownSchemaLookup[item.Id] = item; JSchemaKnownSchemaLookup.Remove(knownSchema.Schema); JSchemaKnownSchemaLookup[item.Schema] = item; } base.SetItem(index, item); }
protected override void SetItem(int index, KnownSchema item) { KnownSchema knownSchema = Items[index]; if (!UriComparer.Instance.Equals(item.Id, knownSchema.Id)) { if (UriKnownSchemaLookup.TryGetValue(knownSchema.Id, out var existingKnownSchema) && knownSchema == existingKnownSchema) { UriKnownSchemaLookup.Remove(knownSchema.Id); } // First Uri ID wins. if (!UriKnownSchemaLookup.ContainsKey(item.Id)) { UriKnownSchemaLookup[item.Id] = item; } JSchemaKnownSchemaLookup.Remove(knownSchema.Schema); JSchemaKnownSchemaLookup[item.Schema] = item; } base.SetItem(index, item); }