Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try {
                System.Windows.Data.Binding binding = new System.Windows.Data.Binding("TheLog")
                {
                    Source = this.debugLogText
                };
                this.txtDebug.SetBinding(System.Windows.Controls.TextBox.TextProperty, binding);
                this.theWatchManager    = new WatchThreadManager();
                this.theDownloadManager = new DownloadManager();
                this.theDownloadManager.RegisterDebugLog(ref this.debugLogText);
                this.theDownloadManager.RegisterDownloadTaskViewCollection(this.DownloadTaskViewCollection);
                this.theDownloadManager.RefreshDownloadListViewCallback = new RefreshDownloadListDelegate(this.RefreshDownloadsListView);
                this.theWatchManager.RegisterDebugLog(this.debugLogText);
                this.theWatchManager.RegisterDownloadManager(this.theDownloadManager);
                this.theWatchManager.RegisterWatchThreadViewCollection(this.WatchThreadViewCollection);
                this.theWatchManager.RefreshListViewCallback = new RefreshWatchListDelegate(this.RefreshWatchThreadsListView);
                this.wts = new WatchThreadSerializer(this.theWatchManager, this.theDownloadManager, this.WatchThreadViewCollection);
                this.wts.RefreshListViewCallback = this.theWatchManager.RefreshListViewCallback;
                this.wts.debugLogText            = this.debugLogText;


                lvWatchList.ItemsSource       = WatchThreadViewCollection;
                lvDownloadManager.ItemsSource = DownloadTaskViewCollection;


                if (Properties.Settings.Default.AutoLoadWatchList)
                {
                    try {
                        this.theWatchManager = this.wts.Deserialize();
                    } catch {
                    }
                }
                if (Properties.Settings.Default.MinimizeToTray)
                {
                    this.CreateNotifyIcon();
                }
            } catch (Exception exception) {
                System.Windows.MessageBox.Show("Error Creating Watch Manager\r\n" + exception.Message);
                System.Windows.Application.Current.Shutdown();
            }
            try {
                this.txtURL.Focus();
            } catch {
            }
        }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try {
            System.Windows.Data.Binding binding = new System.Windows.Data.Binding("TheLog")
            {
              Source = this.debugLogText
            };
            this.txtDebug.SetBinding(System.Windows.Controls.TextBox.TextProperty, binding);
            this.theWatchManager = new WatchThreadManager();
            this.theDownloadManager = new DownloadManager();
            this.theDownloadManager.RegisterDebugLog(ref this.debugLogText);
            this.theDownloadManager.RegisterDownloadTaskViewCollection(this.DownloadTaskViewCollection);
            this.theDownloadManager.RefreshDownloadListViewCallback = new RefreshDownloadListDelegate(this.RefreshDownloadsListView);
            this.theWatchManager.RegisterDebugLog(this.debugLogText);
            this.theWatchManager.RegisterDownloadManager(this.theDownloadManager);
            this.theWatchManager.RegisterWatchThreadViewCollection(this.WatchThreadViewCollection);
            this.theWatchManager.RefreshListViewCallback = new RefreshWatchListDelegate(this.RefreshWatchThreadsListView);
            this.wts = new WatchThreadSerializer(this.theWatchManager, this.theDownloadManager, this.WatchThreadViewCollection);
            this.wts.RefreshListViewCallback = this.theWatchManager.RefreshListViewCallback;
            this.wts.debugLogText = this.debugLogText;

            lvWatchList.ItemsSource = WatchThreadViewCollection;
            lvDownloadManager.ItemsSource = DownloadTaskViewCollection;

            if (Properties.Settings.Default.AutoLoadWatchList) {
              try {
            this.theWatchManager = this.wts.Deserialize();
              } catch {
              }
            }
            if (Properties.Settings.Default.MinimizeToTray) {
              this.CreateNotifyIcon();
            }
              } catch (Exception exception) {
            System.Windows.MessageBox.Show("Error Creating Watch Manager\r\n" + exception.Message);
            System.Windows.Application.Current.Shutdown();
              }
              try {
            this.txtURL.Focus();
              } catch {
              }
        }
Exemplo n.º 3
0
 public void RegisterWatchThreadSerializer(ref WatchThreadSerializer argwts)
 {
     this.watchThreadSerializer = argwts;
 }