public void TopOpenWebpagesAssociatedWithJpegs(string[] files)
 {
     if (files == null || files.Length == 0)
     {
         return;
     }
     foreach (string file in files)
     {
         if (file.ToLowerInvariant().EndsWith(".jpeg"))
         {
             string sUrl = BookmarkBucketCore.GetExifDataUrl(file);
             if (sUrl == null || sUrl.Length == 0)
             {
                 MessageBox.Show("Url does not appear to be valid."); return;
             }
             BookmarkBucketCore.LaunchWebpage(sUrl);
         }
         else if (file.ToLowerInvariant().EndsWith(".html"))
         {
             string sAll  = File.ReadAllText(file);
             int    index = sAll.IndexOf(strHtmlStamp, StringComparison.InvariantCulture);
             if (index != -1)
             {
                 string strRest = sAll.Substring(index + strHtmlStamp.Length).Trim().Replace("-->", "");
                 if (BookmarkBucketCore.looksLikeAUrl(strRest) && !strRest.Contains("<") && !strRest.Contains(">") && strRest.Length < 200)
                 {
                     BookmarkBucketCore.LaunchWebpage(strRest);
                 }
             }
             sAll = null;
         }
         else
         {
             MessageBox.Show("Please use only .jpeg files, as created by BookmarkBucket."); return;
         }
     }
 }
        private BookmarkBucketObjectModel JpegFilesToModel(string sDir)
        {
            if (!Directory.Exists(sDir))
            {
                throw new BookmarkBucketException("Dir does not exist");
            }
            BookmarkBucketObjectModel model = new BookmarkBucketObjectModel();
            DirectoryInfo             di    = new DirectoryInfo(sDir);

            FileInfo[] rgFiles = di.GetFiles("*.JPEG");
            foreach (FileInfo fi in rgFiles)
            {
                string sUrl = BookmarkBucketCore.GetExifDataUrl(sDir + "\\" + fi.Name);
                if (sUrl == null || sUrl.Length == 0)
                {
                    throw new BookmarkBucketException("Url is null in " + fi.Name);
                }

                model.list.Add(new BookmarkBucketItem {
                    sFile = Path.GetFileNameWithoutExtension(fi.Name), sUrl = sUrl
                });
            }
            return(model);
        }