/// <summary> /// Removes a custom folder using given data. /// </summary> internal static bool RemoveCustomFolder(FolderData data) { switch (data.DataType) { case FolderDataType.Path: return(pathBasedFoldersData.Remove(data.Path)); case FolderDataType.Name: return(nameBasedFoldersData.Remove(data.Name)); } return(false); }
/// <summary> /// Creates a custom folder using given data. /// </summary> internal static void CreateCustomFolder(FolderData data) { switch (data.DataType) { case FolderDataType.Path: pathBasedFoldersData[data.Path] = data; return; case FolderDataType.Name: nameBasedFoldersData[data.Name] = data; return; } }
/// <summary> /// Creates a custom folder using given data. /// </summary> /// <param name="data"></param> internal static void CreateCustomFolder(FolderData data) { //TODO: data overriding validation switch (data.DataType) { case FolderDataType.Path: //if (validationEnabled) pathBasedFoldersData[data.Path] = data; return; case FolderDataType.Name: nameBasedFoldersData[data.Name] = data; return; } }
/// <summary> /// Tries to retrive proper icon for given <see cref="FolderData"/> and <see cref="Rect"/>. /// </summary> private static bool TryGetFolderIcon(FolderData data, Rect labelRect, out Texture icon, out Rect rect) { var isSmallIcon = labelRect.width > labelRect.height; icon = isSmallIcon ? data.SmallIcon : data.LargeIcon; //skip rect-related calculations if there is no icon if (!icon) { rect = labelRect; return(false); } rect = isSmallIcon ? GetSmallIconRect(labelRect) : GetLargeIconRect(labelRect, true); return(true); }
public void RemoveCustomFolder(FolderData path) { customFolders?.Remove(path); }
public void RemoveCustomFolder(FolderData data) { customFolders?.Remove(data); }
/// <summary> /// Tries to retrive <see cref="FolderData"/> associated to given path. /// </summary> private static bool TryGetFolderData(string path, out FolderData data) { return(pathBasedFoldersData.TryGetValue(path, out data) || nameBasedFoldersData.TryGetValue(Path.GetFileName(path), out data)); }