-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrostpan.cs
157 lines (143 loc) · 4.67 KB
/
rostpan.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XIMA_Beta
{
public partial class rostpan : UserControl
{
#region Declaration
public vcard[] name;
public vcard2[] name2;
public int z = 0;
#endregion
#region Construction
public rostpan()
{
InitializeComponent();
name = new vcard[100];
name2 = new vcard2[500];
}
#endregion
#region Presence Array Creation
public void additems(String status, String jid, String show)
{
try
{
name[z] = new vcard();
this.Controls.Add(name[z]);
name[z].Location = new Point(name[z].Location.X, name[z].Location.Y + (27 * z));
name[z].Size = new Size(250, 27);
name[z].jidlab.Text = jid;
name[z].Tag = jid;
name[z].statuslab.Text = status;
if (show == "away")
{
name[z].shimg.Image = global::XIMA_Beta.Properties.Resources.aw;
}
else
{
if (show == "dnd")
{
name[z].shimg.Image = global::XIMA_Beta.Properties.Resources.dnd;
}
else
{
if (show == "off")
{
name[z].shimg.Image = global::XIMA_Beta.Properties.Resources.off;
}
else
{
name[z].shimg.Image = global::XIMA_Beta.Properties.Resources.chat;
}
}
}
name[z].MouseDoubleClick += new MouseEventHandler(x_MouseDoubleClick);
z++;
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
#endregion
#region Roster Array Creation
public void addrost(String jid)
{
try
{
name2[z] = new vcard2();
this.Controls.Add(name2[z]);
name2[z].Location = new Point(name2[z].Location.X, name2[z].Location.Y + (14 * z));
name2[z].jidlab.Text = jid;
name2[z].MouseDoubleClick += new MouseEventHandler(x_MouseDoubleClick2);
z++;
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
#endregion
#region Presence Update
public void itemup(String jid, String show, String status, int i)
{
try
{
if (jid == name[i].jidlab.Text)
{
name[i].statuslab.Text = status;
if (show == "away")
{
name[i].shimg.Image = global::XIMA_Beta.Properties.Resources.aw;
}
else
{
if (show == "dnd")
{
name[i].shimg.Image = global::XIMA_Beta.Properties.Resources.dnd;
}
else
{
if (show == "off")
{
name[i].shimg.Image = global::XIMA_Beta.Properties.Resources.off;
}
else
{
name[i].shimg.Image = global::XIMA_Beta.Properties.Resources.chat;
}
}
}
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
#endregion
#region Mouse Event Handlers
public void x_MouseDoubleClick(object n, EventArgs e)
{
chatload.loadchat(((vcard)n).jidlab.Text);
}
public void x_MouseDoubleClick2(object n, EventArgs e)
{
chatload.loadchat(((vcard2)n).jidlab.Text);
}
#endregion
#region Flush
public void flush()
{
this.Controls.Clear();
z = 0;
}
#endregion
}
}