Esempio n. 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex >= 0)
     {
         myConnection.deletePost(this.allPost.ElementAt(listBox1.SelectedIndex));
     }
     refreshAllPost();
 }
Esempio n. 2
0
        private void button5_Click(object sender, EventArgs e)
        {
            int ind = listBox2.SelectedIndex;

            if (ind >= 0)
            {
                PostInfo p = CurrentState.currentPostInfo;
                myConnection.deletePost(p);
                CurrentState.currentPostInfo = null;
                listBox3.Items.Clear(); listBox2.Items.Clear();
                this.allThreads = myConnection.WatchAllThreads(this.CurrentState.currentSubForumInfo);
                for (int i = 0; i < this.allThreads.Count; i++)
                {
                    listBox2.Items.Add(allThreads.ElementAt(i).msg);
                }
            }
        }
Esempio n. 3
0
        public void TestdeletePost() //need to return true only to values
        {
            Assert.IsTrue(forum.deletePost(makeTestPost(1)));

            Assert.IsFalse(forum.deletePost(makeTestPost(3)));
        }