/// <summary>
/// Clones the data type description.
/// </summary>
/// <returns>A clone</returns>
public DataTypeDescriptor Clone()
{
var dataTypeDescriptor = new DataTypeDescriptor(this.DataTypeId, this.Namespace, this.Name, this.TypeManagerTypeName, this.IsCodeGenerated)
{
Title = this.Title,
BuildNewHandlerTypeName = this.BuildNewHandlerTypeName,
LabelFieldName = this.LabelFieldName,
InternalUrlPrefix = this.InternalUrlPrefix,
Searchable = this.Searchable
};
foreach (DataTypeAssociationDescriptor dataTypeAssociationDescriptor in this.DataAssociations)
{
dataTypeDescriptor.DataAssociations.Add(dataTypeAssociationDescriptor.Clone());
}
dataTypeDescriptor.DataScopes = new List <DataScopeIdentifier>(this.DataScopes);
foreach (DataFieldDescriptor dataFieldDescriptor in this.Fields)
{
if (!dataFieldDescriptor.Inherited)
{
dataTypeDescriptor.Fields.Add(dataFieldDescriptor.Clone());
}
}
foreach (string keyPropertyName in this.KeyPropertyNames)
{
dataTypeDescriptor.KeyPropertyNames.Add(keyPropertyName, false);
}
foreach (string storeSortOrderFieldNames in this.StoreSortOrderFieldNames)
{
dataTypeDescriptor.StoreSortOrderFieldNames.Add(storeSortOrderFieldNames, false);
}
foreach (Type superInterface in this.SuperInterfaces)
{
dataTypeDescriptor.AddSuperInterface(superInterface);
}
return(dataTypeDescriptor);
}