Exemple #1
0
 static void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data)
 {
     if (viewer == null)
     {
         return;
     }
     if (format.ToString().Equals("Text"))
     {
         viewer.Search((string)data);
     }
 }
Exemple #2
0
 void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data)
 {
     m_log.TraceEvent(LogLevels.Verbose, 76543, "Clipboard changed ... format now: " + format.ToString());
 }
Exemple #3
0
        private void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data)
        {
            // Do Something...
            if (format.ToString() == "Text") 
            {
                string[] URLs = data.ToString().Split(new char[0]);
                foreach (string _url in URLs)
                {
                    ListViewItem lvItem;
                    bool blogExists = false;
                    string str = this.ExtractBlogname_paste(_url);
                    if (str != null)
                    {
                        this.Invoke((Action)delegate
                        {
                            foreach (ListViewItem item in this.lvBlog.Items)
                            {
                                if (item.Text.Equals(str))
                                {
                                    blogExists = true;
                                    return;
                                }
                            }
                        });
                        if (blogExists)
                        {

                        }
                        else
                        {
                            lvItem = new ListViewItem();
                            {
                                TumblrBlog newBlog = new TumblrBlog
                                {
                                    _Name = str,
                                    _URL = this.ExtractUrl(_url),
                                    _DateAdded = DateTime.Now,
                                    _DownloadedImages = 0,
                                    _TotalCount = 0,
                                    _LastCrawled = System.DateTime.MinValue,
                                    _finishedCrawl = false
                                };
                                lvItem.Text = newBlog._Name;
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add(newBlog._URL);
                                lvItem.SubItems.Add("0.00");
                                lvItem.SubItems.Add(newBlog._DateAdded.ToString());
                                lvItem.SubItems.Add("Not yet completely crawled!");
                                //lvItem.SubItems.Add(newBlog._finishedCrawl.ToString());
                                this.SaveBlog(newBlog);
                                newBlog = null;
                                this.Invoke((Action)delegate
                                {
                                    this.lvBlog.Items.Add(lvItem);
                                });
                            }
                            if (Directory.Exists(Properties.Settings.Default.configDownloadLocation.ToString() + "Index/"))
                            {
                                if (Directory.GetFiles(Properties.Settings.Default.configDownloadLocation.ToString() + "Index/", "*.tumblr").Count<string>() > 0)
                                {
                                    this.Invoke((Action)delegate
                                    {
                                        this.toolShowExplorer.Enabled = true;
                                        this.toolRemoveBlog.Enabled = true;
                                        this.toolCrawl.Enabled = true;
                                    });
                                }
                                else
                                {
                                    this.Invoke((Action)delegate
                                    {
                                        this.toolShowExplorer.Enabled = false;
                                        this.toolRemoveBlog.Enabled = false;
                                        this.toolCrawl.Enabled = false;
                                    });
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
 private void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data)
 {
     // Do Something...
     if (format.ToString() == "Text")
     {
         string[] URLs = data.ToString().Split(new char[0]);
         foreach (string _url in URLs)
         {
             ListViewItem lvItem;
             bool         blogExists = false;
             string       str        = this.ExtractBlogname_paste(_url);
             if (str != null)
             {
                 this.Invoke((Action) delegate
                 {
                     foreach (ListViewItem item in this.lvBlog.Items)
                     {
                         if (item.Text.Equals(str))
                         {
                             blogExists = true;
                             return;
                         }
                     }
                 });
                 if (blogExists)
                 {
                 }
                 else
                 {
                     lvItem = new ListViewItem();
                     {
                         TumblrBlog newBlog = new TumblrBlog
                         {
                             _Name             = str,
                             _URL              = this.ExtractUrl(_url),
                             _DateAdded        = DateTime.Now,
                             _DownloadedImages = 0,
                             _TotalCount       = 0,
                             _LastCrawled      = System.DateTime.MinValue,
                             _finishedCrawl    = false
                         };
                         lvItem.Text = newBlog._Name;
                         lvItem.SubItems.Add("");
                         lvItem.SubItems.Add("");
                         lvItem.SubItems.Add(newBlog._URL);
                         lvItem.SubItems.Add(newBlog._DateAdded.ToString());
                         lvItem.SubItems.Add("Not yet completely crawled!");
                         //lvItem.SubItems.Add(newBlog._finishedCrawl.ToString());
                         this.SaveBlog(newBlog);
                         newBlog = null;
                         this.Invoke((Action) delegate
                         {
                             this.lvBlog.Items.Add(lvItem);
                         });
                     }
                     if (Directory.Exists(Properties.Settings.Default.configDownloadLocation.ToString() + "Index/"))
                     {
                         if (Directory.GetFiles(Properties.Settings.Default.configDownloadLocation.ToString() + "Index/", "*.tumblr").Count <string>() > 0)
                         {
                             this.Invoke((Action) delegate
                             {
                                 this.toolShowExplorer.Enabled = true;
                                 this.toolRemoveBlog.Enabled   = true;
                                 this.toolCrawl.Enabled        = true;
                             });
                         }
                         else
                         {
                             this.Invoke((Action) delegate
                             {
                                 this.toolShowExplorer.Enabled = false;
                                 this.toolRemoveBlog.Enabled   = false;
                                 this.toolCrawl.Enabled        = false;
                             });
                         }
                     }
                 }
             }
         }
     }
 }
 void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data)
 {
     m_log.TraceEvent(LogLevels.Verbose, 76543, "Clipboard changed ... format now: " + format.ToString());
 }