public FormNightShift() { InitializeComponent(); // Acquire the version information and put it in the form header try { this.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } catch { this.Text = " in Debug"; } //probably in debug, no version info available this.Text = "NightShift V" + this.Text; TargetSpecs ts = new TargetSpecs("Sun"); SunRiseTextBox.Text = ts.RiseTime.ToString(@"hh\:mm"); SunSetTextBox.Text = ts.SetTime.ToString(@"hh\:mm"); TwilightTextBox.Text = ts.TwilightEODTime.ToString(@"hh\:mm"); DawnTextBox.Text = ts.TwilightSODTime.ToString(@"hh\:mm"); TargetSpecs tm = new TargetSpecs("Moon"); MoonRiseTextBox.Text = tm.RiseTime.ToString(@"hh\:mm"); MoonSetTextBox.Text = tm.SetTime.ToString(@"hh\:mm"); MoonTransitTextBox.Text = tm.TransitTime.ToString(@"hh\:mm"); MoonPhaseTextBox.Text = (tm.PhasePercent.ToString("0")) + "%"; //Test to see which buttons have installed applications QualifyToolKitButtons(); //Load the Target Plan datagridview WriteTargetList(); //Load the task list datagridview LogXDataBase tldb = new LogXDataBase(); List <string> taskList = tldb.GetTasks(); TaskDataGrid.Rows.Clear(); int tidx = 0; if (taskList != null) { foreach (string task in taskList) { TaskDataGrid.Rows.Add(); TaskDataGrid.Rows[tidx].Cells[0].Value = task; TaskDataGrid.Rows[tidx].Cells[1].Value = false; tidx++; } } Show(); TaskDataGrid.ClearSelection(); //Set the display date the the current date LogDateTimePicker.Value = DateTime.Now; //Create Humason Log content for Humason Log tab //Open log based on the most recent log HumasonReader hReader = new HumasonReader(DateTime.Now); //Get full list of logs in Log directory List <DateTime> hLogList = hReader.HumasonLogDates; foreach (DateTime ldate in hLogList) { HumasonLogFileListBox.Items.Add(ldate.ToShortDateString()); } HumasonLogFileListBox.SelectedIndex = HumasonLogFileListBox.Items.Count - 1; Show(); return; }
private void SetEnableRowsMove(bool set) { CanMoveRow = set; TaskDataGrid.SetValue(VisualHelper.EnableRowsMoveProperty, !CanMoveRow); }