Beispiel #1
0
        public PolicyPanel(ForumConnection myConnectionP, CurrentForumState State)
        {
            CurrentState      = State;
            this.myConnection = myConnectionP;
            InitializeComponent();
            CurrentState.currentPolicyInfo = myConnection.GetPolicyParam(CurrentState.myForum);

            for (int i = 0; i < CurrentState.currentPolicyInfo.ileg.Count; i++)
            {
                listBox2.Items.Add(this.CurrentState.currentPolicyInfo.ileg.ElementAt(i));
            }
            this.textBox3.Text = Convert.ToString(this.CurrentState.currentPolicyInfo.maxmoth);
            this.textBox2.Text = Convert.ToString(this.CurrentState.currentPolicyInfo.minword);
        }
Beispiel #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (!(this.CurrentState.currentPolicyInfo.ileg.Contains(textBox1.Text)))
     {
         this.CurrentState.currentPolicyInfo.ileg.Add(textBox1.Text);
         // this.myConnection.UpdatePolicyParams(this.CurrentState.myForum, this.CurrentState.currentPolicyInfo.minword, this.CurrentState.currentPolicyInfo.maxmoth, this.CurrentState.currentPolicyInfo.ileg);
         List <String> ans = CurrentState.currentPolicyInfo.ileg.ToList <String>();
         myConnection.UpdatePolicyParams(CurrentState.myForum, CurrentState.currentPolicyInfo.minword, CurrentState.currentPolicyInfo.maxmoth, CurrentState.currentPolicyInfo.ileg.ToList <String>());
         this.CurrentState.currentPolicyInfo = myConnection.GetPolicyParam(this.CurrentState.myForum);
         for (int i = 0; i < this.CurrentState.currentPolicyInfo.ileg.Count; i++)
         {
             listBox2.Items.Add(this.CurrentState.currentPolicyInfo.ileg.ElementAt(i));
         }
     }
     else
     {
         MessageBox.Show("המילה המוזנת קיימת כבר");
     }
 }