Beispiel #1
0
 public frmSettings(WorkListFile _file)
 {
     InitializeComponent();
     if (_file != null && _file.Path != null)
     {
         txtFile.Text = _file.Path;
     }
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 private void frmWorkList_Load(object sender, EventArgs e)
 {
     if (_path != null)
     {
         _file = new WorkListFile(_path);
         _file.fillBoxes(lbTodo, lbInProgress, lbDone);
     }
     else
     {
         _file = new WorkListFile();
     }
 }
Beispiel #5
0
        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;
            }
        }
Beispiel #6
0
 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;
     }
 }
Beispiel #7
0
 public frmPrintChooser(ref WorkListFile file)
 {
     _file = file;
     InitializeComponent();
 }