public static void PersistMetaData(DataTypeDescriptor dataTypeDescriptor)
{
lock (_lock)
{
Initialize();
string filepath = CreateFilename(dataTypeDescriptor);
XElement rootElement = dataTypeDescriptor.ToXml();
XDocument doc = new XDocument(rootElement);
XDocumentUtils.Save(doc, filepath);
_dataTypeDescriptorCache[dataTypeDescriptor.DataTypeId] = dataTypeDescriptor;
if ((_dataTypeDescriptorFilesnamesCache.ContainsKey(dataTypeDescriptor.DataTypeId)) &&
(_dataTypeDescriptorFilesnamesCache[dataTypeDescriptor.DataTypeId] != filepath))
{
FileUtils.Delete(_dataTypeDescriptorFilesnamesCache[dataTypeDescriptor.DataTypeId]);
_dataTypeDescriptorFilesnamesCache[dataTypeDescriptor.DataTypeId] = filepath;
}
}
}