public static bool xmlDB_UpdateGuidanceExplorer(this TM_Xml_Database tmDatabase, Guid libraryId, string caption, bool deleteLibrary)
{
//"[xmlDB_UpdateGuidanceExplorer]".info();
if (TM_Xml_Database.Current.GuidanceExplorers_XmlFormat.hasKey(libraryId).isFalse())
{
"[TM_Xml_Database] in xmlDB_UpdateGuidanceExplorer, could not find library to update with id: {0}".error(libraryId);
return false;
}
if (deleteLibrary)
{
return tmDatabase.xmlDB_DeleteGuidanceExplorer(libraryId);
}
var guidanceExplorerToUpdate = TM_Xml_Database.Current.GuidanceExplorers_XmlFormat[libraryId];
// this is a rename
if (guidanceExplorerToUpdate.library.caption != caption)
return tmDatabase.xmlDB_RenameGuidanceExplorer(guidanceExplorerToUpdate, caption);
return false;
}