Example #1
0
        private ProgramStart EditStartProgramsAfterWake(ProgramStart selectedItem)
        {
            var psList = new List <ProgramStart>(this.dataGridStartProgramsAfterWake.Items.Count);

            for (int i = 0; i < this.dataGridStartProgramsAfterWake.Items.Count; i++)
            {
                psList.Add((ProgramStart)this.dataGridStartProgramsAfterWake.Items[i]);
            }

            var addForm = new AddProcessToStartWindow(selectedItem, psList.ToArray());
            var result  = addForm.ShowDialog();

            if (result != true)
            {
                return(null);
            }

            var p = addForm.GetProgramStart();

            if (p == null)
            {
                return(null);
            }

            return(p);
        }
Example #2
0
        private void buttonAddStartProgramAfterWake_Click(object sender, RoutedEventArgs e)
        {
            var psList = new List <ProgramStart>(this.dataGridStartProgramsAfterWake.Items.Count);

            for (int i = 0; i < this.dataGridStartProgramsAfterWake.Items.Count; i++)
            {
                psList.Add((ProgramStart)this.dataGridStartProgramsAfterWake.Items[i]);
            }

            var addForm = new AddProcessToStartWindow(psList.ToArray());
            var result  = addForm.ShowDialog();

            if (result != true)
            {
                return;
            }

            var p = addForm.GetProgramStart();

            if (p == null)
            {
                return;
            }

            this.dataGridStartProgramsAfterWake.Items.Add(p);
        }