public frmSettings(WorkListFile _file) { InitializeComponent(); if (_file != null && _file.Path != null) { txtFile.Text = _file.Path; } }
private void showDetails(WorkListFile.ItemType type,ListBox listBox, int index) { switch (type) { case WorkListFile.ItemType.New: lblSectionContent.Text = "New"; break; case WorkListFile.ItemType.InProgress: lblSectionContent.Text = "In Progress"; break; case WorkListFile.ItemType.Done: lblSectionContent.Text = "Done"; break; } ListEntry _tmp = (ListEntry)listBox.Items[index]; lblNameContent.Text = _tmp.Name; lblDetailsContent.Text = _tmp.Value; }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog odlg = new OpenFileDialog(); odlg.Filter = "WorkList XML files (*.xml)|*.xml"; odlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); odlg.CheckFileExists = true; DialogResult res = odlg.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { _file = new WorkListFile(odlg.FileName); _file.fillBoxes(lbTodo, lbInProgress, lbDone); } }
private void frmWorkList_Load(object sender, EventArgs e) { if (_path != null) { _file = new WorkListFile(_path); _file.fillBoxes(lbTodo, lbInProgress, lbDone); } else { _file = new WorkListFile(); } }
private void editItem(ListBox lb, WorkListFile.ItemType type, int index) { string text = ((ListEntry)lb.Items[index]).Name; if (InputBox(Application.ProductName, "Edit item: ", ref text) == System.Windows.Forms.DialogResult.OK) { _file.Edit(type, lb, index, text); _changed = true; } }
private void addItem(ListBox lb, WorkListFile.ItemType type) { string text = null; if (InputBox(Application.ProductName, "Add new item: ", ref text) == System.Windows.Forms.DialogResult.OK) { _file.Add(type, lb, text,null); _changed = true; } }
public frmPrintChooser(ref WorkListFile file) { _file = file; InitializeComponent(); }