internal FormEditProgram(DelayedProgram dp) { InitializeComponent(); this.TextBoxName.Text = dp.Name; this.TextBoxPath.Text = dp.Path; this.NumericUpDownDelay.Value = dp.Delay; }
internal DelayedProgram GetNewProgram() { DelayedProgram newProg = new DelayedProgram( this.TextBoxName.Text, this.TextBoxPath.Text, Convert.ToInt32(this.NumericUpDownDelay.Value)); return newProg; }
/// <summary> /// Loads all Objects from ./objects.dat /// </summary> public void LoadObjects() { string fPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\StartupDelayer\\objects.dat"; if(File.Exists(fPath)) { using(StreamReader sr = new StreamReader(fPath, Encoding.ASCII)) { //initial read... string line = sr.ReadLine(); do { DelayedProgram dp = new DelayedProgram(line); this.DelayedPrograms.Add(dp); this.AddRow(dp); line = sr.ReadLine(); } while(line != "" && line != null); } } }
/// <summary> /// Adds a DelayedProgram to the DatagridView /// </summary> /// <param name="newProg">The DelayedProgram to be added</param> private void AddRow(DelayedProgram newProg) { this.MainForm.AddRow(newProg); }
internal void AddRow(DelayedProgram newProg) { this.ProgramList.Rows.Add(newProg.Name, newProg.Path, newProg.Delay); }
/// <summary> /// Copy Constructor /// </summary> /// <param name="prog"></param> public DelayedProgram(DelayedProgram prog) { this.Name = prog.Name; this.Path = prog.Path; this.Delay = prog.Delay; }