예제 #1
0
 public TCFile(DirectoryInfo dir, ImageSource iconSource) : this(dir.Name, iconSource)
 {
     this.dir       = dir;
     isFolder       = true;
     FilePath       = dir.FullName;
     fileClickedArg = new FileClickedEventArgs(dir.FullName, isFolder);
 }
예제 #2
0
 public TCFile(string filePath, ImageSource iconSource) : this()
 {
     FileNameText   = Path.GetFileNameWithoutExtension(filePath);
     FilePath       = filePath;
     IconSource     = iconSource;
     fileClickedArg = new FileClickedEventArgs(FilePath, isFolder, file);
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }
예제 #6
0
        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);
        }
예제 #7
0
        public void FavoriteClicked()
        {
            FileClickedEventArgs arg = new FileClickedEventArgs(FilePath, false, file, IsInfoMenuOpen, isFavorited);

            FavouriteClickEvent?.Invoke(this, arg);
        }
예제 #8
0
        public void CheckedInfoPanel()
        {
            var arg = new FileClickedEventArgs(file.FullName, isFolder, file, IsInfoMenuOpen);

            InfoPanelClickEvent?.Invoke(this, arg);
        }