Ejemplo n.º 1
0
 public Color DupeCheck(ListViewItem item)
 {
     try
     {
         BiblioUpTik.Web web = new BiblioUpTik.Web();
         this._w.Navigate(BiblioSite.SearchUrl(item));
         this.LoadWait();
         string stringBetween = web.GetStringBetween(this._w.DocumentText, "<tbody>", "</tbody>", 0);
         int    num           = BiblioSite.CountOccurences("<span class=\"title\">", stringBetween);
         int    Start         = 1;
         for (int index = 0; index < num; ++index)
         {
             if (web.GetStringBetween(stringBetween, "<td>", "</td>", Start).Contains("[Retail]"))
             {
                 return(Color.Red);
             }
             if (index + 1 == num)
             {
                 return(item.Tag.ToString().Split('|')[1].Trim().Equals("retail") ? Color.Green : Color.Teal);
             }
             Start += 8;
         }
         return(Color.Green);
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show(ex.ToString());
         return(Color.Black);
     }
 }
Ejemplo n.º 2
0
        public void ShowDupeCheck(ListViewItem book)
        {
            if (this._form != null)
            {
                this._form.Close();
            }
            Form form = new Form();

            form.Text          = "Dupe Check Results";
            form.StartPosition = FormStartPosition.CenterScreen;
            form.Size          = Screen.PrimaryScreen.WorkingArea.Size;
            form.WindowState   = FormWindowState.Maximized;
            this._form         = form;
            if (BiblioUpTik.Properties.Settings.Default.FormX > 0 && BiblioUpTik.Properties.Settings.Default.FormY > 0)
            {
                this._form.SetDesktopLocation(BiblioUpTik.Properties.Settings.Default.FormX, BiblioUpTik.Properties.Settings.Default.FormY);
            }
            // ISSUE: variable of a compiler-generated type
            BiblioUpTik.Properties.Settings settings1 = BiblioUpTik.Properties.Settings.Default;
            Point desktopLocation = this._form.DesktopLocation;
            int   x = desktopLocation.X;

            settings1.FormX = x;
            // ISSUE: variable of a compiler-generated type
            BiblioUpTik.Properties.Settings settings2 = BiblioUpTik.Properties.Settings.Default;
            desktopLocation = this._form.DesktopLocation;
            int y = desktopLocation.Y;

            settings2.FormY = y;
            BiblioUpTik.Properties.Settings.Default.Save();
            this._w.Dock = DockStyle.Fill;
            this._form.Controls.Add((Control)this._w);
            if (!this._form.Visible)
            {
                this._form.Show();
            }
            this._w.Navigate(BiblioSite.SearchUrl(book));
            this._form.FormClosing += new FormClosingEventHandler(this.Form_FormClosing);
        }