root/lang/csharp/Criw-0/AutoJoinSettingForm.cs

Revision 1736, 1.8 kB (checked in by mayuki, 14 months ago)

lang/csharp: WZERO3などで動くIRCクライアントのサンプル実装 Criw-0 を追加。

  • Property svn:keywords set to Id
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8
9namespace Misuzilla.Applications.Mobile.Criw0
10{
11    public partial class AutoJoinSettingForm : Form
12    {
13        public AutoJoinSettingForm()
14        {
15            InitializeComponent();
16        }
17
18        public List<String> Channels
19        {
20            get
21            {
22                List<String> channels = new List<string>();
23                foreach (Object o in listChannels.Items)
24                {
25                    channels.Add(o.ToString());
26                }
27                return channels;
28            }
29
30            set
31            {
32                listChannels.Items.Clear();
33                if (value == null) return;
34                foreach (String s in value)
35                {
36                    listChannels.Items.Add(s);
37                }
38            }
39        }
40
41        private void buttonAdd_Click(object sender, EventArgs e)
42        {
43            if (!listChannels.Items.Contains(textChannelName.Text))
44            {
45                listChannels.Items.Add(textChannelName.Text);
46            }
47        }
48
49        private void buttonRemove_Click(object sender, EventArgs e)
50        {
51            if (listChannels.SelectedIndex > -1)
52            {
53                listChannels.Items.RemoveAt(listChannels.SelectedIndex);
54            }
55        }
56
57        private void menuItemSave_Click(object sender, EventArgs e)
58        {
59            this.DialogResult = DialogResult.OK;
60            this.Close();
61        }
62
63        private void menuItemCancel_Click(object sender, EventArgs e)
64        {
65            this.DialogResult = DialogResult.Cancel;
66            this.Close();
67        }
68    }
69}
Note: See TracBrowser for help on using the browser.