Example #1
0
        public static Image GetSiteLogo(string siteName)
        {
            Image fileLogo = null;

            fileLogo = (Bitmap)WebsiteImage.DownloadSiteIcon(siteName);
            if (fileLogo == null)
            {
                fileLogo = NativeThemeManager.LoadBitmap("url.png");
            }
            return(fileLogo);
        }
Example #2
0
        public static Image GetFileLogo(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                return(NativeThemeManager.LoadBitmap("UnknownFile.png"));
            }

            Image fileLogo = null;

            if (IsURL(fileName))
            {
                fileLogo = (Bitmap)WebsiteImage.DownloadSiteIcon(fileName);
                if (fileLogo == null)
                {
                    fileLogo = NativeThemeManager.LoadBitmap("url.png");
                }
            }
            else
            {
                fileLogo = (Bitmap)FileImage.FileNameImage(fileName);

                if (fileLogo == null)
                {
                    if (FileOperations.DirectoryExists(fileName))
                    {
                        fileLogo = NativeThemeManager.LoadBitmap("Folder.png");
                    }
                    else
                    {
                        fileLogo = GetExtensionLogo(fileName);
                        if (fileLogo == null)
                        {
                            fileLogo = NativeThemeManager.LoadBitmap("UnknownFile.png");
                        }
                    }
                }
            }

            return(fileLogo);
        }