static public int GetBinaryLockedOrUnlockedIcon(string lockFilename, string filename) { // Check for locks on this asset if (MOG_ControllerProject.IsLocked(lockFilename)) { // Currently we dont distinguish between read and write locks return(GetLockedBinaryIcon(filename)); } else { return(GetFileIconIndex(filename)); } }
/// <summary> SetAssetIcon /// Searches through mAssetTypes to find the matching key with /// that of the filename. Then returns the index /// </summary> /// <param name="filename"></param> /// <returns>index of icon in the mAssetTypeImages list</returns> static public int GetClassIconIndex(string filename, MOG_Properties properties) { // Construct a filename MOG_Filename file = null; try { file = new MOG_Filename(filename); } catch (Exception e) { e.ToString(); return(0); } string classification; string lockName; switch (file.GetFilenameType()) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: classification = file.GetAssetClassification(); lockName = file.GetAssetFullName(); break; case MOG_FILENAME_TYPE.MOG_FILENAME_Group: classification = "group"; lockName = file.GetAssetFullName(); break; default: classification = filename; lockName = classification; break; } // Check for locks on this asset if (MOG_ControllerProject.IsLocked(lockName)) { // Currently we dont distinguish between read and write locks return(GetLockedIcon(lockName, IconType.CLASS, properties)); } else { return(FindOrAddIcon(ref properties, IconType.CLASS, classification, classification)); } } // end ()
static public int GetAssetIconIndex(string filename, MOG_Properties properties, bool bCheckLockedIcons) { // Construct a filename MOG_Filename file = null; try { file = new MOG_Filename(filename); } catch (Exception e) { e.ToString(); return(0); } string assetName = "default"; switch (file.GetFilenameType()) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: assetName = file.GetAssetClassification(); break; case MOG_FILENAME_TYPE.MOG_FILENAME_Group: assetName = "group"; break; default: assetName = filename; break; } // Check for locks on this asset if (bCheckLockedIcons == true && MOG_ControllerProject.IsLocked(file.GetAssetFullName())) { // Currently we dont distinguish between read and write locks return(GetLockedIcon(assetName, IconType.ASSET, properties)); } else { return(FindOrAddIcon(ref properties, IconType.ASSET, assetName, assetName + "_ASSET")); } }