Inheritance: TorrentDataHandler
Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            this.ResizeRedraw = true;
            this.MainWindow_Resize(new object(), new EventArgs()); //Force a resize to make things look nice

            this.torrentsTableTableAdapter.Fill(this.dataset.TorrentsTable);
            this.moviesTableTableAdapter.Fill(this.dataset.MoviesTable);
            this.othersTableTableAdapter.Fill(this.dataset.OthersTable);

            //Allow another class to handle the deleting/handling of the datagridviews to keep this class slimmer
            dgvh = new DataGridViewHandler(ref torrentsTableDataGridView, ref torrentsTableBindingSource,
                ref moviesTableDataGridView, ref moviesTableBindingSource,
                ref othersTableDataGridView, ref othersTableBindingSource);
            data = new TorrentDataHandler(ref dataset, ref torrentsTableTableAdapter);

            timer.Interval = (double)SettingsHandler.GetAutoHandleTime();
            if (timer.Interval < (1000*10))
            {
                SettingsHandler.SetAutoHandleTime(10000);
                timer.Interval = 10000;
            }
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

            tb.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BuildWorkerCompleted);
            tb.ProgressChanged += new ProgressChangedEventHandler(ProgressChanged);

            if (SettingsHandler.GetAutoHandleBool())
                timer.Start();

            HideSent = (HideSentTorrentsCheckBox.Checked) ? true : false;

            Arrow.Visible = false;
            StatusLabel.Visible = false;
            ArrowText.Visible = false;
            notifyIcon.Visible = false;

            try
            {
                if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
                {
                    System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                    string version = ad.CurrentVersion.ToString();

                    if (SettingsHandler.GetCurrentVersion().CompareTo(version) < 0)
                    {
                        UpdatedInformationWindow uw = new UpdatedInformationWindow();
                        uw.ShowDialog();
                        SettingsHandler.SetCurrentVersion(version);
                    }
                }
            }
            catch (Exception) { }

            test();
        }
Ejemplo n.º 2
0
        /*GENERAL*/
        private void RefreshData()
        {
            Thread.Sleep(100);

            dataGridViewProgressBar.Visible = false;
            StatusLabel.Visible = false;
            ProcessTorrentsButton.Enabled = true;
            RefreshButton.Enabled = true;
            DeleteButton.Enabled = true;

            dgvh.ResumeLayout();

            if (timer.Enabled == false && SettingsHandler.GetAutoHandleBool())
                timer.Start();

            try
            {
                dgvh = new DataGridViewHandler();
            }
            catch { }
        }