public void RemoveSuperInterface(Type interfaceType)
{
if (interfaceType == typeof(IData))
{
return;
}
if (_superInterfaces.Contains(interfaceType))
{
_superInterfaces.Remove(interfaceType);
}
foreach (PropertyInfo propertyInfo in interfaceType.GetProperties())
{
var dataFieldDescriptor = ReflectionBasedDescriptorBuilder.BuildFieldDescriptor(propertyInfo, true);
if (this.Fields.Contains(dataFieldDescriptor))
{
this.Fields.Remove(dataFieldDescriptor);
}
if (DynamicTypeReflectionFacade.IsKeyField(propertyInfo) &&
this.KeyPropertyNames.Contains(propertyInfo.Name))
{
this.KeyPropertyNames.Remove(propertyInfo.Name);
}
}
foreach (var dataScopeIdentifier in DynamicTypeReflectionFacade.GetDataScopes(interfaceType))
{
if (this.DataScopes.Contains(dataScopeIdentifier))
{
this.DataScopes.Remove(dataScopeIdentifier);
}
}
var superInterfaces = interfaceType.GetInterfaces().Where(t => typeof (IData).IsAssignableFrom(t));
foreach (Type superInterfaceType in superInterfaces)
{
RemoveSuperInterface(superInterfaceType);
}
}