Exemple #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            #region Make Columns of DataTable
            // dtFiles
            DataColumn dc1 = new DataColumn("FileID");
            dc1.AutoIncrement     = true;
            dc1.AutoIncrementSeed = 0;
            dc1.AutoIncrementStep = 1;

            DataColumn dc2 = new DataColumn("FilePath");

            DataColumn dc3 = new DataColumn("Selected");
            dc3.DefaultValue = false;

            dtFiles.Columns.Add(dc1);
            dtFiles.Columns.Add(dc2);
            dtFiles.Columns.Add(dc3);
            //

            // dtSelectedFiles
            DataColumn dc11 = new DataColumn("FileID");
            dc11.AutoIncrement     = true;
            dc11.AutoIncrementSeed = 0;
            dc11.AutoIncrementStep = 1;

            DataColumn dc22 = new DataColumn("FilePath");

            DataColumn dc33 = new DataColumn("Selected");
            dc33.DefaultValue = false;

            dtSelectedFiles.Columns.Add(dc11);
            dtSelectedFiles.Columns.Add(dc22);
            dtSelectedFiles.Columns.Add(dc33);
            //
            #endregion

            #region Initials Timers
            timerClearStatus.AutoReset = false;
            timerClearStatus.Enabled   = false;
            timerClearStatus.Interval  = 10000;
            timerClearStatus.Elapsed  += new System.Timers.ElapsedEventHandler(ClearStatusbar);

            timerUpdateSliderPosition.AutoReset = true;
            timerUpdateSliderPosition.Enabled   = false;
            timerUpdateSliderPosition.Interval  = 1000;
            timerUpdateSliderPosition.Elapsed  += new System.Timers.ElapsedEventHandler(UpdatePosition);
            #endregion

            #region Check for Update
            // Check for update if last check was more than 7 days before
            DateTime currentDate = DateTime.Now;
            DateTime lastUpdate  = Properties.Settings.Default.LastUpdateCheck;
            TimeSpan ts          = currentDate - lastUpdate;
            //
            if (ts.Days > 7)
            {
                UpdateAvailbaleCallback uaCallback = new UpdateAvailbaleCallback(RaiseUpdateWindow);
                CheckUpdate             chkUp      = new CheckUpdate(uaCallback);
                chkUp.Check();
            }

            //UpdateAvailbaleCallback uaCallback = new UpdateAvailbaleCallback(RaiseUpdateWindow);
            //CheckUpdate chkUp = new CheckUpdate(uaCallback);
            //chkUp.Check();
            #endregion

            LoadSettings();
        }
Exemple #2
0
 public CheckUpdate(UpdateAvailbaleCallback uv)
 {
     _update_available = uv;
 }