Ejemplo n.º 1
0
 public void ShowPreview(Models.GlimpseItem item)
 {
     System.Windows.Threading.Dispatcher.CurrentDispatcher.InvokeAsync(() =>
     {
         this.Source = item.FullPath;
     });
 }
Ejemplo n.º 2
0
        public void ShowPreview(Models.GlimpseItem item)
        {
            this.Source = item.FullPath;

            BitmapDecoder decoder = BitmapDecoder.Create(item.Uri, BitmapCreateOptions.None, BitmapCacheOption.None);

            this.image = decoder.Frames[0];
        }
Ejemplo n.º 3
0
        public void ShowPreview(Models.GlimpseItem item)
        {
            var source = System.IO.File.ReadAllText(item.FullPath);

            var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
            var content  = Markdown.ToHtml(source, pipeline);
            var template = Properties.Resources.MarkdownHtmlTemplate;

            MarkdownHtml = template.Replace("<$CONTENT-PLACEHOLDER$ />", content);
        }
Ejemplo n.º 4
0
        public void ShowPreview(Models.GlimpseItem item)
        {
            using (var sf = ShellFolder.FromParsingName(item.FullPath))
            {
                this.Thumbnail = sf.Thumbnail.ExtraLargeBitmapSource;
                this.DriveName = sf.GetDisplayName(DisplayNameType.Default);
            }

            DriveInfo di = new DriveInfo(item.FullPath);

            this.FreeBytes  = di.TotalFreeSpace;
            this.TotalBytes = di.TotalSize;

            this.FreeSpaceRatio = (di.TotalFreeSpace / (double)di.TotalSize);
        }
Ejemplo n.º 5
0
        public void ShowPreview(Models.GlimpseItem item)
        {
            using (var sf = ShellFolder.FromParsingName(item.FullPath))
            {
                this.Thumbnail  = sf.Thumbnail.ExtraLargeBitmapSource;;
                this.Foldername = sf.GetDisplayName(DisplayNameType.Default);
            }

            var di = new DirectoryInfo(item.FullPath);

            this.CreationTime = di.CreationTime;

            if (!folderStatsCache.TryGetValue(item.FullPath, out this.currentFolderStats))
            {
                this.currentFolderStats = new FolderStats(di);
                this.currentFolderStats.StartCalculation();
                this.folderStatsUpdateTimer = new Timer((state) =>
                {
                    UpdateFolderStats();
                }, state: null, dueTime: 0, period: 500);

                folderStatsCache.Add(item.FullPath, currentFolderStats);
            }
        }
Ejemplo n.º 6
0
 public void ShowPreview(Models.GlimpseItem item)
 {
     this.Source = item.FullPath;
 }
Ejemplo n.º 7
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(supportedExtensions.Contains(item.FileExtension));
 }
Ejemplo n.º 8
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(item.FileExtension == ".md");
 }
Ejemplo n.º 9
0
 public void ShowPreview(Models.GlimpseItem item)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(item.IsLocalDrive);
 }
Ejemplo n.º 12
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(item.FileExtension == ".htm" ||
            item.FileExtension == ".html" ||
            item.ShellFile?.Properties.System.ContentType?.Value == "text/html");
 }
Ejemplo n.º 13
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(Interop.Win32.PreviewHandlerGuid(item.FullPath) != Guid.Empty);
 }
Ejemplo n.º 14
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(item.IsDirectory);
 }
Ejemplo n.º 15
0
 public void ShowPreview(Models.GlimpseItem item)
 {
     this.Source        = item.Uri;
     this.PlaybackState = MediaState.Play;
 }
Ejemplo n.º 16
0
 public bool CanCreatePreview(Models.GlimpseItem item)
 {
     return(item.PerceivedType == Models.PerceivedType.Video);
 }
Ejemplo n.º 17
0
 public void ShowPreview(Models.GlimpseItem item)
 {
     this.RtfText = System.IO.File.ReadAllText(item.FullPath);
 }