Exemplo n.º 1
0
        private void Rename(object para)
        {
            Note note = para as Note;

            if (note == null)
            {
                return;
            }
            NewWindow newWindow = new NewWindow(this)
            {
                Owner = mainWindow
            };

            newWindow.ShowDialog();
            if (TitleInput == "")
            {
                return;
            }
            string oldPath = note.FilePath;
            string newName = TitleInput;

            if (dataService.RenameData(oldPath, newName))
            {
                NoteList.Remove(note);
                NoteList.Add(new Note(dataService.GetPath(newName)));
                SelectedIndex = NoteList.Count - 1;
                OnAddedNewNote();
            }
            TitleInput = "";
        }
Exemplo n.º 2
0
        private void BtnStart_Click(object sender, EventArgs e)
        {
            frmMain NewWindow;

            if (rad3Min.Checked == true)
            {
                NewWindow = new frmMain(3);
            }
            else if (rad10Min.Checked == true)
            {
                NewWindow = new frmMain(10);
            }
            else
            {
                int time;
                if (!String.IsNullOrWhiteSpace(txtOther.Text) && int.TryParse(txtOther.Text, out time) && time < 100)
                {
                    NewWindow = new frmMain(time);
                }
                else
                {
                    MessageBox.Show("Time entered must be an integer less than 100.");
                    return;
                }
            }
            //make this form invisible while the new window opens, make it visible again when new window closes
            this.Visible = false;
            NewWindow.ShowDialog();
            NewWindow.Dispose();
            this.Visible = true;
        }
Exemplo n.º 3
0
        protected override void OnExecute(object parameter)
        {
            NewWindow newWindow = new NewWindow();

            if (newWindow.ShowDialog().Value)
            {
                ProjectMgr.Instance.NewProject(newWindow.AssessmentName, newWindow.Description, newWindow.Thumbnail);
            }
        }
Exemplo n.º 4
0
        protected override void OnExecute(object parameter)
        {
            if (ProjectMgr.Instance.App == null)
            {
                return;
            }

            NewWindow newWindow = new NewWindow();

            newWindow.AssessmentName = ProjectMgr.Instance.App.Name;
            newWindow.Description    = ProjectMgr.Instance.App.Description;
            newWindow.Thumbnail      = ProjectMgr.Instance.App.Thumbnail;
            if (newWindow.ShowDialog().Value)
            {
                ProjectMgr.Instance.App.Name        = newWindow.AssessmentName;
                ProjectMgr.Instance.App.Description = newWindow.Description;
                ProjectMgr.Instance.App.Thumbnail   = newWindow.Thumbnail;
                ProjectMgr.Instance.Changed         = true;
            }
        }
Exemplo n.º 5
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            //makes a new game window based on the time limit chosen
            frmMain NewWindow;

            if (rad3Min.Checked)
            {
                NewWindow = new frmMain(3);
            }
            else
            {
                NewWindow = new frmMain(10);
            }

            //make this form invisible while the new window opens, make it visible again when new window closes
            this.Visible = false;
            NewWindow.ShowDialog();
            NewWindow.Dispose();
            this.Visible = true;
        }
Exemplo n.º 6
0
        private void New(object parameter)
        {
            TitleInput = "";
            NewWindow newWindow = new NewWindow(this)
            {
                Owner = mainWindow
            };

            newWindow.ShowDialog();
            if (TitleInput == "")
            {
                return;
            }
            Note newNote = dataService.AddNewData(TitleInput);

            if (newNote != null)
            {
                NoteList.Add(newNote);
                SelectedIndex = NoteList.Count - 1;
                OnAddedNewNote();
            }
            ClearSearchResult();
            TitleInput = "";
        }
Exemplo n.º 7
0
 public void ShowDialog()
 {
     _window.ShowDialog();
 }