예제 #1
0
파일: MainWindow.cs 프로젝트: joslinm/CSL
        public MainWindow()
        {
            InitializeComponent();
            TorrentXMLHandler.Initialize(); //Initialize data source (read XML file)
            dgvh = new DataGridViewHandler(dataGridView);
            bw = new BWHandler(dataGridViewProgressBar, StatusLabel);

            internaltimer.Interval = 2;
            internaltimer.Elapsed += new System.Timers.ElapsedEventHandler(internaltimer_Elapsed);

            timer.Interval = (double)SettingsHandler.GetAutoHandleTime();
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            if (SettingsHandler.GetAutoHandleBool())
                timer.Start();

            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) { }
        }