예제 #1
0
            public _Tips()
            {
                /*ShowSubDirTips = true;
                 * SubDirTipsPreview = true;
                 * SubDirTipsFiles = true;
                 * SubDirTipsWithShift = false;
                 * ShowTooltipPreviews = true;
                 * ShowPreviewsWithShift = false;
                 * ShowPreviewInfo = true;
                 * PreviewMaxWidth = 512;
                 * PreviewMaxHeight = 256;
                 * PreviewFont = Control.DefaultFont;
                 * TextExt = new List<string> {".txt", ".ini", ".inf" ,".cs", ".log", ".js", ".vbs"};
                 * ImageExt = ThumbnailTooltipForm.MakeDefaultImgExts();*/

                ShowSubDirTips        = true;
                SubDirTipsPreview     = true;
                SubDirTipsFiles       = true;
                SubDirTipsWithShift   = true;
                ShowTooltipPreviews   = true;
                ShowPreviewsWithShift = true;
                ShowPreviewInfo       = true;

                PreviewMaxWidth  = 512;
                PreviewMaxHeight = 256;
                PreviewFont      = Control.DefaultFont;
                PreviewFont      = new Font(new FontFamily("微软雅黑"), 9f);
                TextExt          = new List <string> {
                    ".txt", ".rtf"
                    , ".ini", ".inf"
                    , ".cs", ".log"
                    , ".js", ".vbs", ".bat", ".cmd", ".sh"
                    , ".c", ".cpp", ".cc", ".h", ".rc"
                    , ".xml"
                    , ".htm", ".html", ".mht", ".mhtml", ".shtml", ".hta"
                    , ".java"
                    , ".sql"
                    , ".csv"
                    , ".md"

                    , ".py", ".rb"
                    , ".jsp", ".asp", ".php", ".aspx"
                    , ".resx", ".xaml", ".config", ".manifest", ".csproj", ".vbproj"
                };
                ImageExt = ThumbnailTooltipForm.MakeDefaultImgExts();
            }
예제 #2
0
 public _Tips()
 {
     ShowSubDirTips        = true;
     SubDirTipsPreview     = true;
     SubDirTipsFiles       = true;
     SubDirTipsWithShift   = false;
     ShowTooltipPreviews   = true;
     ShowPreviewsWithShift = false;
     ShowPreviewInfo       = true;
     PreviewMaxWidth       = 512;
     PreviewMaxHeight      = 256;
     PreviewFont           = Control.DefaultFont;
     TextExt = new List <string> {
         ".txt", ".ini", ".inf", ".cs", ".log", ".js", ".vbs"
     };
     ImageExt = ThumbnailTooltipForm.MakeDefaultImgExts();
 }
예제 #3
0
 public override void Dispose(bool fDisposing)
 {
     if (fDisposed)
     {
         return;
     }
     // Never call NativeWindow.ReleaseHandle().  EVER!!!
     if (ListViewController != null)
     {
         ListViewController.MessageCaptured -= ListViewController_MessageCaptured;
         ListViewController = null;
     }
     if (ShellViewController != null)
     {
         ShellViewController.MessageCaptured -= ShellViewController_MessageCaptured;
         ShellViewController = null;
     }
     if (timer_HoverSubDirTipMenu != null)
     {
         timer_HoverSubDirTipMenu.Dispose();
         timer_HoverSubDirTipMenu = null;
     }
     if (timer_Thumbnail != null)
     {
         timer_Thumbnail.Dispose();
         timer_Thumbnail = null;
     }
     if (thumbnailTooltip != null)
     {
         thumbnailTooltip.Dispose();
         thumbnailTooltip = null;
     }
     if (subDirTip != null)
     {
         subDirTip.Dispose();
         subDirTip = null;
     }
     if (dropTargetPassthrough != null)
     {
         dropTargetPassthrough.Dispose();
         dropTargetPassthrough = null;
     }
     base.Dispose(fDisposing);
 }
예제 #4
0
        private bool ShowThumbnailTooltip(int iItem, Point pnt, bool fKey)
        {
            string linkTargetPath;

            if (ShellBrowser.TryGetHotTrackPath(iItem, out linkTargetPath))
            {
                if ((linkTargetPath.StartsWith("::") || linkTargetPath.StartsWith(@"\\")) || linkTargetPath.ToLower().StartsWith(@"a:\"))
                {
                    return(false);
                }
                string ext = Path.GetExtension(linkTargetPath).ToLower();
                if (ext == ".lnk")
                {
                    linkTargetPath = ShellMethods.GetLinkTargetPath(linkTargetPath);
                    if (linkTargetPath.Length == 0)
                    {
                        return(false);
                    }
                    ext = Path.GetExtension(linkTargetPath).ToLower();
                }
                if (ThumbnailTooltipForm.ExtIsSupported(ext))
                {
                    if (thumbnailTooltip == null)
                    {
                        thumbnailTooltip = new ThumbnailTooltipForm();
                        thumbnailTooltip.ThumbnailVisibleChanged += thumbnailTooltip_ThumbnailVisibleChanged;
                        timer_Thumbnail          = new Timer();
                        timer_Thumbnail.Interval = 400;
                        timer_Thumbnail.Tick    += timer_Thumbnail_Tick;
                    }
                    if (thumbnailTooltip.IsShownByKey && !fKey)
                    {
                        thumbnailTooltip.IsShownByKey = false;
                        return(true);
                    }
                    thumbnailIndex = iItem;
                    thumbnailTooltip.IsShownByKey = fKey;
                    return(thumbnailTooltip.ShowToolTip(linkTargetPath, pnt));
                }
                HideThumbnailTooltip(6);
            }
            return(false);
        }
 public override void Dispose(bool fDisposing)
 {
     if (fDisposed)
     {
         return;
     }
     if (ListViewController != null)
     {
         ListViewController.ReleaseHandle();
         ListViewController = null;
     }
     if (ShellViewController != null)
     {
         ShellViewController.ReleaseHandle();
         ShellViewController = null;
     }
     if (timer_HoverSubDirTipMenu != null)
     {
         timer_HoverSubDirTipMenu.Dispose();
         timer_HoverSubDirTipMenu = null;
     }
     if (timer_Thumbnail != null)
     {
         timer_Thumbnail.Dispose();
         timer_Thumbnail = null;
     }
     if (thumbnailTooltip != null)
     {
         thumbnailTooltip.Dispose();
         thumbnailTooltip = null;
     }
     if (subDirTip != null)
     {
         subDirTip.Dispose();
         subDirTip = null;
     }
     if (dropTargetPassthrough != null)
     {
         dropTargetPassthrough.Dispose();
         dropTargetPassthrough = null;
     }
     base.Dispose(fDisposing);
 }