public TCFile(DirectoryInfo dir, ImageSource iconSource) : this(dir.Name, iconSource) { this.dir = dir; isFolder = true; FilePath = dir.FullName; fileClickedArg = new FileClickedEventArgs(dir.FullName, isFolder); }
public TCFile(string filePath, ImageSource iconSource) : this() { FileNameText = Path.GetFileNameWithoutExtension(filePath); FilePath = filePath; IconSource = iconSource; fileClickedArg = new FileClickedEventArgs(FilePath, isFolder, file); }
public TCFile(DirectoryInfo dir, ImageSource iconSource, bool isPreviousDir) : this(dir, iconSource) { IsSystemItem = isPreviousDir; FileNameText = @"..."; isFolder = true; FilePath = dir.FullName; fileClickedArg = new FileClickedEventArgs(dir.FullName, isFolder); }
public TCFile(DirectoryInfo dir, int id, bool isSystemItem) : this() { IsSystemItem = isSystemItem; this.dir = dir; Id = id; FileNameText = dir.Name; FilePath = dir.Name; fileClickedArg = new FileClickedEventArgs(dir.FullName, true); }
public TCFile(FileInfo file, ImageSource iconSource, bool isFavorite) : this() { IsFavorited = isFavorite; this.file = file; FileNameText = Path.GetFileNameWithoutExtension(file.Name); FilePath = file.FullName; IconSource = iconSource; isFolder = false; fileClickedArg = new FileClickedEventArgs(FilePath, isFolder, file); }
public TCFile(string name, string filePath, string previousFolder, TCType tcType, string iconSource) : this() { if ((!string.IsNullOrEmpty(name)) && (TcType == TCType.FOLDER) && string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(name))) { FileNameText = name; } else { FileNameText = (name == "...") ? name : (string.IsNullOrEmpty(name)) ? string.Empty : Path.GetFileNameWithoutExtension(name); } FilePath = filePath; TcType = tcType; IconSourceString = iconSource; switch (tcType) { case TCType.FILE: IsFolder = false; break; case TCType.PREVIOUS: IsSystemItem = true; IsFolder = true; break; case TCType.FOLDER: IsFolder = true; break; case TCType.FAVORITE: IsFolder = false; IsFavorited = true; break; default: break; } if (tcType == TCType.FILE || tcType == TCType.FAVORITE) { try { File = new FileInfo(FilePath); } catch (Exception) { } } fileClickedArg = new FileClickedEventArgs(FilePath, isFolder, file); }
public void FavoriteClicked() { FileClickedEventArgs arg = new FileClickedEventArgs(FilePath, false, file, IsInfoMenuOpen, isFavorited); FavouriteClickEvent?.Invoke(this, arg); }
public void CheckedInfoPanel() { var arg = new FileClickedEventArgs(file.FullName, isFolder, file, IsInfoMenuOpen); InfoPanelClickEvent?.Invoke(this, arg); }