Пример #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            List <Module> list = new List <Module>();

            //Save content of each listbox in list and pass to Base_offscreen along with selected layout
            if (nrOfModules.SelectedItem.ToString() == "1" || nrOfModules.SelectedItem.ToString() == "4")
            {
                foreach (ListBox listBox in box)
                {
                    list.Add(new Module(listBox.Items[0].ToString(), listBox.Name));
                }
                base_offscreen = new Base_offscreen(list, nrOfModules.SelectedItem.ToString());
            }
            else
            {
                foreach (ListBox listBox in box)
                {
                    list.Add(new Module(listBox.Items[0].ToString(), listBox.Name));
                }
                base_offscreen = new Base_offscreen(list, picName);
            }


            this.Hide();

            //Save last used in settings
            Properties.Settings.Default.nrOfModules = nrOfModules.SelectedIndex;
            Properties.Settings.Default.Save();

            base_offscreen.ShowDialog();
            this.Close();
        }
Пример #2
0
        private void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (listBoxChat.SelectedItem == null)
            {
                return;
            }

            ChatText temp = (ChatText)listBoxChat.SelectedItem;

            if (e.ClickedItem.Text == "Slett")
            {
                listBoxChat.Items.RemoveAt(listBoxChat.SelectedIndex);
                UpdateText();
            }
            else if (e.ClickedItem.Text == "Utesteng IP")
            {
                if (!Base_offscreen.CheckBlacklist(temp.ip))
                {
                    Base_offscreen.blackList.Add(temp.ip);
                }

                for (int i = 0; i < listBoxChat.Items.Count; i++)
                {
                    if (((ChatText)listBoxChat.Items[i]).ip == temp.ip)
                    {
                        listBoxChat.Items.RemoveAt(i);
                    }
                }
                UpdateText();
            }
        }
Пример #3
0
 public string CheckIP(string content, ref string ip)
 {
     content = content.Remove(0, content.IndexOf("[") + 1);
     ip      = content.Remove(content.IndexOf("]"));
     if (Base_offscreen.CheckBlacklist(ip))
     {
         return("");
     }
     else
     {
         return(content.Remove(0, content.IndexOf("]") + 1));
     }
 }