コード例 #1
0
ファイル: Form1.cs プロジェクト: JDiPierro/ThoughtQ
        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;
        }
コード例 #2
0
ファイル: ThoughtInfo.cs プロジェクト: JDiPierro/ThoughtQ
        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();
        }
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: JDiPierro/ThoughtQ
        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");
        }