Пример #1
0
 private void RenderFilesInView(List <FileInfo> files, bool isSearchResults)
 {
     try
     {
         IsCheckIOBusy       = true;
         IsRightPanelVisible = false;
         foreach (var mFile in files)
         {
             //Get Icons
             string shortCutPath = mFile.FullName;
             string icon         = IconUtilities.GetIconString(shortCutPath);
             //ImageSource image = null;
             //string extension = IconUtilities.GetExtension(shortCutPath);
             //try
             //{
             //    if (extension == ".lnk")
             //    {
             //        image = IconUtilities.GetIconForShortCut(shortCutPath);
             //    }
             //    else
             //    {
             //        image = IconUtilities.GetIcon(shortCutPath);
             //    }
             //    if (image == null)
             //    {
             //        image = folderIcon;
             //    }
             //}
             //catch (Exception)
             //{
             //    image = folderIcon;
             //}
             var    isFavorite = _referenceService.IsFileInFavorite(mFile.FullName);
             TCFile file       = new TCFile(mFile.Name, mFile.FullName, previousFolder, TCFile.TCType.FILE, icon);
             file.IsFavorited          = isFavorite;
             file.DoubleClickEvent    += File_DoubleClickEvent;
             file.FileClickedEvent    += File_FileClickedEvent;
             file.InfoPanelClickEvent += File_InfoPanelClickEvent;
             file.FavouriteClickEvent += File_FavouriteClickEvent;
             FileCollection.Add(file);
         }
         IsCheckIOBusy = false;
     }
     catch (Exception e)
     {
         Console.WriteLine("Render Files In View Failed: {0}", e.ToString());
     }
 }
Пример #2
0
        private void RenderFavorites(ObservableCollection <cc310_reference_centre_file> favorites)
        {
            IsCheckIOBusy = true;
            FileCollection.Clear();

            foreach (var mFile in favorites)
            {
                //Get Icons

                string shortCutPath = mFile.file_full_nm;
                string icon         = IconUtilities.GetIconString(shortCutPath);

                FileInfo fileInfo = new FileInfo(mFile.file_path_txt);
                TCFile   file     = new TCFile(fileInfo.Name, fileInfo.FullName, previousFolder, TCFile.TCType.FAVORITE, icon); //new TCFile(fileInfo, image, true);
                file.DoubleClickEvent    += File_DoubleClickEvent;
                file.FileClickedEvent    += File_FileClickedEvent;
                file.InfoPanelClickEvent += File_InfoPanelClickEvent;
                file.FavouriteClickEvent += File_FavouriteClickEvent;
                FileCollection.Add(file);
            }
            IsCheckIOBusy = false;
        }