Exemplo n.º 1
0
 public void updateCategories(Thought t)
 {
     if (!cbx_cats.Items.Contains(t.getCategory()))
     {
         cbx_cats.Items.Add(t.getCategory());
     }
 }
Exemplo n.º 2
0
        public Thought AddThought(String name)
        {
            Thought newThought = new Thought(name);
            thoughts.Add(newThought);
            allThoughts.Add(newThought);

            return newThought;
        }
Exemplo n.º 3
0
        public void deleteThought(Thought t)
        {
            if (thoughts.Contains(t))
                thoughts.Remove(t);
            else if(archive.Contains(t))
                archive.Remove(t);

            allThoughts.Remove(t);
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
 public void archiveThought(Thought t)
 {
     archive.Add(t);
     t.tState = thought_state.archived;
     thoughts.Remove(t);
 }
Exemplo n.º 7
0
 public void RestoreThought(Thought t)
 {
     t.tState = thought_state.active;
     thoughts.Add(t);
     archive.Remove(t);
 }
Exemplo n.º 8
0
        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");
        }