Esempio n. 1
0
 private void toolStripButtonDelChecked_Click(object sender, EventArgs e)
 {
     try
     {
         ListView.CheckedListViewItemCollection checkeditems = lsvCacheCookie.CheckedItems;
         if (checkeditems.Count == 0)
         {
             return;
         }
         if (!AllForms.AskForConfirmation(
                 "Proceed to delete " + checkeditems.Count.ToString() +
                 " checked items?", this))
         {
             return;
         }
         foreach (ListViewItem item in checkeditems)
         {
             WinApis.DeleteUrlCacheEntry(item.SubItems[0].Text);
             lsvCacheCookie.Items.Remove(item);
         }
         AdjustThisText();
     }
     catch (Exception ee)
     {
         AllForms.m_frmLog.AppendToLog("toolStripButtonDelChecked_Click:\r\n" + ee.ToString());
     }
 }
Esempio n. 2
0
 private void toolStripButtonDelAll_Click(object sender, EventArgs e)
 {
     try
     {
         if (lsvCacheCookie.Items.Count == 0)
         {
             return;
         }
         if (!AllForms.AskForConfirmation(
                 "Proceed to delete all " + lsvCacheCookie.Items.Count.ToString() +
                 " items?", this))
         {
             return;
         }
         foreach (ListViewItem item in lsvCacheCookie.Items)
         {
             WinApis.DeleteUrlCacheEntry(item.SubItems[0].Text);
         }
         lsvCacheCookie.Items.Clear();
         AdjustThisText();
     }
     catch (Exception ee)
     {
         AllForms.m_frmLog.AppendToLog("toolStripButtonDelAll_Click:\r\n" + ee.ToString());
     }
 }
 void toolStripButtonSave_Click(object sender, EventArgs e)
 {
     if (AllForms.ShowStaticSaveDialogForText(this) == DialogResult.OK)
     {
         using (StreamWriter sw = new StreamWriter(AllForms.m_dlgSave.FileName))
         {
             sw.Write(richTextBox1.Text);
         }
     }
 }
Esempio n. 4
0
 private void tsBtnSaveLog_Click(object sender, EventArgs e)
 {
     if (AllForms.ShowStaticSaveDialogForText(this) == DialogResult.OK)
     {
         using (StreamWriter sw = new StreamWriter(AllForms.m_dlgSave.FileName))
         {
             sw.Write(txtLog.Text);
         }
     }
 }
Esempio n. 5
0
        private void frmCacheCookie_Load(object sender, EventArgs e)
        {
            //Add some icons
            this.Icon = AllForms.BitmapToIcon(5);
            toolStripButtonDelSelected.Image = AllForms.m_imgListMain.Images[29];
            toolStripButtonDelChecked.Image  = AllForms.m_imgListMain.Images[39];
            toolStripButtonDelAll.Image      = AllForms.m_imgListMain.Images[40];

            //To demonstrate of handling of a listviewitem dragdrop on a csEXWB control
            lsvCacheCookie.ItemDrag += new ItemDragEventHandler(lsvCacheCookie_ItemDrag);
        }
Esempio n. 6
0
 private void frmFileDownload_Load(object sender, EventArgs e)
 {
     this.Icon = AllForms.BitmapToIcon(45);
     try
     {
         FileDownloadStatusCtlHeader header = new FileDownloadStatusCtlHeader();
         header.Name = "DownloadStatusHeader";
         flowLayoutPanel1.Controls.Add(header);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 7
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         //Save as text
         if (AllForms.ShowStaticSaveDialogForText(this) == DialogResult.OK)
         {
             using (StreamWriter sw = new StreamWriter(AllForms.m_dlgSave.FileName))
             {
                 sw.Write(txtDocInfo.Text);
             }
         }
     }
     catch (Exception ee)
     {
         AllForms.m_frmLog.AppendToLog("frmDocInfo::saveToolStripMenuItem_Click\r\n" + ee.ToString());
     }
 }
Esempio n. 8
0
        public int ClearAllCache(string FromSite)
        {
            int ideleted = 0;

            System.Collections.ArrayList results = WinApis.FindUrlCacheEntries(
                AllForms.SetupCookieCachePattern(FromSite, AllForms.VISITED));
            foreach (INTERNET_CACHE_ENTRY_INFO entry in results)
            {
                //Avoid Null or empty entries
                if ((!string.IsNullOrEmpty(entry.lpszSourceUrlName)) &&
                    (entry.lpszSourceUrlName.Trim().Length > 0))
                {
                    WinApis.DeleteUrlCacheEntry(entry.lpszSourceUrlName);
                    ideleted++;
                }
            }

            return(ideleted);
        }
Esempio n. 9
0
        private void saveAsXMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (treeDocInfo.Nodes.Count == 0)
                {
                    return;
                }

                if (AllForms.ShowStaticSaveDialogForXML(this) == DialogResult.OK)
                {
                    TreeViewSerializer savetree = new TreeViewSerializer();
                    savetree.SerializeTreeView(treeDocInfo, AllForms.m_dlgSave.FileName);
                }
            }
            catch (Exception ee)
            {
                AllForms.m_frmLog.AppendToLog("frmDocInfo::saveAsXMLToolStripMenuItem_Click\r\n" + ee.ToString());
            }
        }
Esempio n. 10
0
 private void frmDocInfo_Load(object sender, EventArgs e)
 {
     this.Icon = AllForms.BitmapToIcon(34);
 }
Esempio n. 11
0
 private void frmAuthenticate_Load(object sender, EventArgs e)
 {
     this.Icon = AllForms.BitmapToIcon(14);
 }
Esempio n. 12
0
 private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     //Clear completed - Save download list
     if (e.ClickedItem.Name == tsCloseDownload.Name)
     {
         this.Hide();
     }
     else if (e.ClickedItem.Name == this.tsSave.Name)
     {
         if (AllForms.ShowStaticSaveDialogForText(this) == DialogResult.OK)
         {
             string tmp = "====================\r\nDownload Date: ";
             tmp += DateTime.Today.ToLongDateString();
             tmp += "\r\nDownload From: {0}\r\nDownload To: {0}\r\nFile Size: {0} Bytes\r\n====================\r\n";
             using (StreamWriter sw = new StreamWriter(AllForms.m_dlgSave.FileName, true))
             {
                 try
                 {
                     DLIDS id = new DLIDS();
                     FileDownloadStatusCtl ctl = null;
                     foreach (Control item in flowLayoutPanel1.Controls)
                     {
                         if (item.Tag == null) //first one
                         {
                             continue;
                         }
                         id = (DLIDS)item.Tag;
                         if (id.DlDone)
                         {
                             ctl = (FileDownloadStatusCtl)item;
                             if (ctl == null)
                             {
                                 return;
                             }
                             //Date - From - To - filesize
                             sw.Write(
                                 string.Format(tmp,
                                               ctl.lblFrom.Text,
                                               ctl.lblTo.Text,
                                               id.FileSize.ToString())
                                 );
                         }
                     }
                 }
                 catch (Exception)
                 {
                     throw;
                 }
             }
         }
     }
     else if (e.ClickedItem.Name == this.tsClearFinished.Name)
     {
         try
         {
             DLIDS id = new DLIDS();
             Control.ControlCollection col = flowLayoutPanel1.Controls;
             foreach (Control item in col)
             {
                 if (item.Tag == null) //first one
                 {
                     continue;
                 }
                 id = (DLIDS)item.Tag;
                 if (id.DlDone)
                 {
                     flowLayoutPanel1.Controls.Remove(item);
                     break;
                 }
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
 }