private void buttonAdd_Click(object sender, EventArgs e) { switch (ChosenPropStr()) { case "Children": frmDocChooser doc_chooser = new frmDocChooser(); doc_chooser.InitForDocSet(CurrentDoc.DocSet); doc_chooser.ShowDialog(); if (doc_chooser.DialogResult == System.Windows.Forms.DialogResult.OK) { GlDoc doc_choice = doc_chooser.ChosenDoc(); if (doc_choice != null) { CurrentDoc.AppendDoc(ChosenPropStr(), doc_choice); DisplayValues(); } } break; case "Favorite foods": InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Value ..."); new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { string new_val = new_name_dlg.TextValue.Trim(); if (new_val != "") { CurrentDoc.AppendString(ChosenPropStr(), new_val); DisplayValues(); } } break; } }
private void buttonNewDocSet_Click(object sender, EventArgs e) { InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new document set ..."); new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { string new_name = new_name_dlg.TextValue.Trim(); if (new_name == "") { return; } string err_msg = ""; GlDocSet new_docset = GlobalsDocDB.GlobalsDocDB.CreateDocSet(new_name, out err_msg); if (new_docset == null) { MessageBox.Show(err_msg); return; } RebuildDocSetList(); comboDocSets.SelectedItem = new_name; } }
private void buttonEdit_Click(object sender, EventArgs e) { switch (ChosenPropStr()) { case "Address": case "Favorite color": InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Value ..."); new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { string new_val = new_name_dlg.TextValue.Trim(); CurrentDoc.SetString(ChosenPropStr(), new_val); } break; case "Spouse": frmDocChooser doc_chooser = new frmDocChooser(); doc_chooser.InitForDocSet(CurrentDoc.DocSet); doc_chooser.ShowDialog(); if (doc_chooser.DialogResult == System.Windows.Forms.DialogResult.OK) { GlDoc doc_choice = doc_chooser.ChosenDoc(); if (doc_choice != null) { CurrentDoc.SetDoc(ChosenPropStr(), doc_choice); } } break; } DisplayValues(); }
private void buttonNewDoc_Click(object sender, EventArgs e) { if (CurrentDocSet == null) { return; } InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new document ..."); // in this example we're assuming that "name" will be required for nodes new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { DocWrapper.CreateDocument(CurrentDocSet, new_name_dlg.TextValue.Trim()); RebuildDocList(); } }
private void buttonNewDocSet_Click(object sender, EventArgs e) { InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new document set ..."); new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { string new_name = new_name_dlg.TextValue.Trim(); if (new_name == "") return; string err_msg = ""; GlDocSet new_docset = GlobalsDocDB.GlobalsDocDB.CreateDocSet(new_name, out err_msg); if (new_docset == null) { MessageBox.Show(err_msg); return; } RebuildDocSetList(); comboDocSets.SelectedItem = new_name; } }
private void buttonNewDoc_Click(object sender, EventArgs e) { if (CurrentDocSet == null) return; InputDialog new_name_dlg = new InputDialog(); new_name_dlg.SetInstr("Name of new document ..."); // in this example we're assuming that "name" will be required for nodes new_name_dlg.ShowDialog(); if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK) { DocWrapper.CreateDocument(CurrentDocSet, new_name_dlg.TextValue.Trim()); RebuildDocList(); } }