public void updateCategories(Thought t) { if (!cbx_cats.Items.Contains(t.getCategory())) { cbx_cats.Items.Add(t.getCategory()); } }
public Thought AddThought(String name) { Thought newThought = new Thought(name); thoughts.Add(newThought); allThoughts.Add(newThought); return newThought; }
public void deleteThought(Thought t) { if (thoughts.Contains(t)) thoughts.Remove(t); else if(archive.Contains(t)) archive.Remove(t); allThoughts.Remove(t); }
private void AddThought() { Thought newThought = new Thought(thoughtEntry.Text); thoughts.Add(newThought); ListViewItem newEntry = new ListViewItem(newThought.getTitle()); newEntry.SubItems.Add(newThought.getTimeCreated().ToShortTimeString()); thoughtList.Items.Add(newEntry); thoughtEntry.Text = String.Empty; }
public ThoughtInfo(ref ListViewItem inView, ref tQueue inThoughtList, MainWindow mainForm) { InitializeComponent(); item = inView; displayed = (Thought)item.Tag; queue = inThoughtList; txt_Title.Text = displayed.getTitle(); txt_Description.Text = displayed.getDescription(); txt_Created.Text = displayed.getTimeCreated().ToShortTimeString(); cbx_cat.Text = displayed.getCategory(); foreach (String el in inThoughtList.categories) { cbx_cat.Items.Add(el); } this.mainForm = mainForm; if (displayed.tState == thought_state.archived) { btnArchive.Enabled = false; } this.Text = "Thought Info -- " + displayed.getTitle(); }
public void archiveThought(Thought t) { archive.Add(t); t.tState = thought_state.archived; thoughts.Remove(t); }
public void RestoreThought(Thought t) { t.tState = thought_state.active; thoughts.Add(t); archive.Remove(t); }
private void AddThought(Thought t) { //Create the ListViewItem that will be displayed in the list ListViewItem newEntry = new ListViewItem(t.getTitle()); newEntry.SubItems.Add(t.getTimeCreated().ToShortTimeString()); newEntry.Tag = t; if (t.tState == thought_state.active) thoughtList.Items.Add(newEntry); else archiveList.Items.Add(newEntry); //Select the Active tab after creating a new item. if (tabControl1.SelectedTab.Name != "tb_Active") tabControl1.SelectTab("tb_Active"); }