/
IceChatOptions.cs
1008 lines (836 loc) · 31 KB
/
IceChatOptions.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******************************************************************************\
* IceChat 9 Internet Relay Chat Client
*
* Copyright (C) 2011 Paul Vanderzee <snerf@icechat.net>
* <www.icechat.net>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Please consult the LICENSE.txt file included with this project for
* more details
*
\******************************************************************************/
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;
using System.Xml.Serialization;
namespace IceChat
{
[XmlRoot("IceChatColors")]
public class IceChatColors
{
//default color values
private int _channelOwnerColor = 4;
private int _channelAdminColor = 4;
private int _channelOpColor = 12;
private int _channelHalfOpColor = 7;
private int _channelVoiceColor = 9;
private int _channelRegularColor = 1;
private int _tabBarCurrent = 1;
private int _tabBarNewMessage = 4;
private int _tabBarChannelJoin = 3;
private int _tabBarChannelPart = 7;
private int _tabBarServerQuit = 10;
private int _tabBarServerMessage = 13;
private int _tabBarOtherMessage = 6;
private int _tabBarDefault = 1;
private int _tabBarCurrentBG1 = 29;
private int _tabBarCurrentBG2 = 0;
private int _tabBarOtherBG1 = 14;
private int _tabBarOtherBG2 = 0;
private int _tabBarHoverBG1 = 0;
private int _tabBarHoverBG2 = 7;
private int _panelHeaderBGColor1 = 15;
private int _panelHeaderBGColor2 = 0;
private int _panelHeaderForeColor = 1;
private int _consoleBack = 0;
private int _channelBack = 0;
private int _queryBack = 0;
private int _nicklistBack = 0;
private int _serverlistBack = 0;
private int _inputboxBack = 0;
private int _inputboxFore = 1;
private int _channellistBack = 0;
private int _channellistFore = 1;
private int _tabbarBack = 20;
private int _menubarBack = 20;
private int _toolbarBack = 20;
private int _statusbarBack = 20;
private int _statusbarFore = 1;
private int _unreadTextMarker = 4;
private bool _randomizeNickColors = false;
private bool _newMessageEnabled = true;
private bool _channelJoinEnabled = true;
private bool _channelPartEnabled = true;
private bool _serverQuitEnabled = true;
private bool _serverMessageEnabled = true;
private bool _otherMessageEnabled = true;
[XmlElement("ConsoleBackColor")]
public int ConsoleBackColor
{ get { return _consoleBack; } set { _consoleBack = value; } }
[XmlElement("ChannelBackColor")]
public int ChannelBackColor
{ get { return _channelBack; } set { _channelBack = value; } }
[XmlElement("QueryBackColor")]
public int QueryBackColor
{ get { return _queryBack; } set { _queryBack = value; } }
[XmlElement("NickListBackColor")]
public int NickListBackColor
{ get { return _nicklistBack; } set { _nicklistBack = value; } }
[XmlElement("ServerListBackColor")]
public int ServerListBackColor
{ get { return _serverlistBack; } set { _serverlistBack = value; } }
[XmlElement("ChannelListBackColor")]
public int ChannelListBackColor
{ get { return _channellistBack; } set { _channellistBack = value; } }
[XmlElement("ChannelListForeColor")]
public int ChannelListForeColor
{ get { return _channellistFore; } set { _channellistFore = value; } }
[XmlElement("InputboxBackColor")]
public int InputboxBackColor
{ get { return _inputboxBack; } set { _inputboxBack = value; } }
[XmlElement("InputboxForeColor")]
public int InputboxForeColor
{ get { return _inputboxFore; } set { _inputboxFore = value; } }
[XmlElement("TabbarBackColor")]
public int TabbarBackColor
{ get { return _tabbarBack; } set { _tabbarBack = value; } }
[XmlElement("MenubarBackColor")]
public int MenubarBackColor
{ get { return _menubarBack; } set { _menubarBack = value; } }
[XmlElement("ToolbarBackColor")]
public int ToolbarBackColor
{ get { return _toolbarBack; } set { _toolbarBack = value; } }
[XmlElement("StatusbarBackColor")]
public int StatusbarBackColor
{ get { return _statusbarBack; } set { _statusbarBack = value; } }
[XmlElement("StatusbarForeColor")]
public int StatusbarForeColor
{ get { return _statusbarFore; } set { _statusbarFore = value; } }
[XmlElement("ChannelOwnerColor")]
public int ChannelOwnerColor
{ get { return _channelOwnerColor; } set { _channelOwnerColor = value; } }
[XmlElement("ChannelAdminColor")]
public int ChannelAdminColor
{ get { return this._channelAdminColor; } set { this._channelAdminColor = value; } }
[XmlElement("ChannelOpColor")]
public int ChannelOpColor
{ get { return this._channelOpColor; } set { this._channelOpColor = value; } }
[XmlElement("ChannelHalfOpColor")]
public int ChannelHalfOpColor
{ get { return this._channelHalfOpColor; } set { this._channelHalfOpColor = value; } }
[XmlElement("ChannelVoiceColor")]
public int ChannelVoiceColor
{ get { return this._channelVoiceColor; } set { this._channelVoiceColor = value; } }
[XmlElement("ChannelRegularColor")]
public int ChannelRegularColor
{ get { return this._channelRegularColor; } set { this._channelRegularColor = value; } }
[XmlElement("TabBarCurrent")]
public int TabBarCurrent
{ get { return _tabBarCurrent; } set { _tabBarCurrent = value; } }
//new messages and actions
[XmlElement("TabBarNewMessage")]
public int TabBarNewMessage
{ get { return _tabBarNewMessage; } set { _tabBarNewMessage = value; } }
[XmlElement("TabBarChannelJoin")]
public int TabBarChannelJoin
{ get { return _tabBarChannelJoin; } set { _tabBarChannelJoin = value; } }
[XmlElement("TabBarChannelPart")]
public int TabBarChannelPart
{ get { return _tabBarChannelPart; } set { _tabBarChannelPart = value; } }
[XmlElement("TabBarServerQuit")]
public int TabBarServerQuit
{ get { return _tabBarServerQuit; } set { _tabBarServerQuit = value; } }
[XmlElement("TabBarServerMessage")]
public int TabBarServerMessage
{ get { return _tabBarServerMessage; } set { _tabBarServerMessage = value; } }
[XmlElement("TabBarOtherMessage")]
public int TabBarOtherMessage
{ get { return _tabBarOtherMessage; } set { _tabBarOtherMessage = value; } }
[XmlElement("TabBarDefault")]
public int TabBarDefault
{ get { return _tabBarDefault; } set { _tabBarDefault = value; } }
[XmlElement("TabBarCurrentBG1")]
public int TabBarCurrentBG1
{ get { return _tabBarCurrentBG1; } set { _tabBarCurrentBG1= value; } }
[XmlElement("TabBarCurrentBG2")]
public int TabBarCurrentBG2
{ get { return _tabBarCurrentBG2; } set { _tabBarCurrentBG2 = value; } }
[XmlElement("TabBarOtherBG1")]
public int TabBarOtherBG1
{ get { return _tabBarOtherBG1; } set { _tabBarOtherBG1 = value; } }
[XmlElement("TabBarOtherBG2")]
public int TabBarOtherBG2
{ get { return _tabBarOtherBG2; } set { _tabBarOtherBG2 = value; } }
[XmlElement("TabBarHoverBG1")]
public int TabBarHoverBG1
{ get { return _tabBarHoverBG1; } set { _tabBarHoverBG1 = value; } }
[XmlElement("TabBarHoverBG2")]
public int TabBarHoverBG2
{ get { return _tabBarHoverBG2; } set { _tabBarHoverBG2 = value; } }
[XmlElement("PanelHeaderBG1")]
public int PanelHeaderBG1
{ get { return _panelHeaderBGColor1; } set { _panelHeaderBGColor1 = value; } }
[XmlElement("PanelHeaderBG2")]
public int PanelHeaderBG2
{ get { return _panelHeaderBGColor2; } set { _panelHeaderBGColor2 = value; } }
[XmlElement("PanelHeaderForeColor")]
public int PanelHeaderForeColor
{ get { return _panelHeaderForeColor; } set { _panelHeaderForeColor = value; } }
[XmlElement("UnreadTextMarker")]
public int UnreadTextMarkerColor
{ get { return this._unreadTextMarker; } set { this._unreadTextMarker = value; } }
[XmlElement("RandomizeNickColors")]
public bool RandomizeNickColors
{ get { return this._randomizeNickColors; } set { this._randomizeNickColors = value; } }
[XmlElement("NewMessageColorChange")]
public bool NewMessageColorChange
{ get { return this._newMessageEnabled; } set { this._newMessageEnabled = value; } }
[XmlElement("ChannelJoinColorChange")]
public bool ChannelJoinColorChange
{ get { return this._channelJoinEnabled; } set { this._channelJoinEnabled = value; } }
[XmlElement("ChannePartColorChange")]
public bool ChannelPartColorChange
{ get { return this._channelPartEnabled; } set { this._channelPartEnabled = value; } }
[XmlElement("ServerQuitColorChange")]
public bool ServerQuitColorChange
{ get { return this._serverQuitEnabled; } set { this._serverQuitEnabled = value; } }
[XmlElement("ServerMessageColorChange")]
public bool ServerMessageColorChange
{ get { return this._serverMessageEnabled; } set { this._serverMessageEnabled = value; } }
[XmlElement("OtherMessageColorChange")]
public bool OtherMessageColorChange
{ get { return this._otherMessageEnabled; } set { this._otherMessageEnabled = value; } }
}
[XmlRoot("IceChatOptions")]
public class IceChatOptions
{
//set the default values
private string _timeStamp = "[hh:mm.ss] ";
private bool _saveWindow = true;
private bool _identServer = true;
private bool _reconnectServer = true;
private bool _logConsole = true;
private bool _logChannel = true;
private bool _logQuery = true;
private bool _seperateLogs = true;
private string _logFormat = "Plain Text";
private bool _showEmoticons = false;
private bool _showEmoticonPicker = true;
private bool _emoticonsFixedSize = true;
private bool _showColorPicker = true;
private bool _showStatusBar = true;
private bool _showServerTree = true;
private bool _showNickList = true;
private bool _showToolBar = true;
private bool _disableQueries = false;
private bool _showQueryForegound = true;
private bool _whoisNewQuery = true;
private bool _showUnreadLine = false;
private bool _minimizeTray = false;
private bool _isOnTray = false;
private int _maxTextLines = 500;
private bool _showNickHost = true;
private bool _showNickButtons = true;
private bool _showServerButtons = true;
private int _panelRightWidth = 230;
private int _panelLeftWidth = 200;
private int _dccChatTimeOut = 60;
private int _dccPortLower = 5000;
private int _dccPortUpper = 10000;
private string _dccReceiveFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
private string _dccSendFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
private int _dccBufferSize = 1024;
private bool _autoGetRouterIP = true;
private string _language = "English";
private string _identName = "IceChat9";
private string _fullName = "The Chat Cool People Use";
private string _quitMessage = "$randquit";
[XmlElement("TimeStamp")]
public string TimeStamp
{
get { return this._timeStamp; }
set { this._timeStamp = value; }
}
[XmlElement("SaveWindowPosition")]
public bool SaveWindowPosition
{
get { return this._saveWindow; }
set { this._saveWindow = value; }
}
[XmlElement("WindowSize")]
public System.Drawing.Size WindowSize
{ get; set; }
[XmlElement("WindowLocation")]
public System.Drawing.Point WindowLocation
{ get; set; }
[XmlElement("RightPanelWidth")]
public int RightPanelWidth
{
get { return this._panelRightWidth; }
set { this._panelRightWidth = value; }
}
[XmlElement("LeftPanelWidth")]
public int LeftPanelWidth
{
get { return this._panelLeftWidth; }
set { this._panelLeftWidth = value; }
}
[XmlElement("DefaultNick")]
public string DefaultNick
{ get; set; }
[XmlElement("DefaultIdent")]
public string DefaultIdent
{
get { return this._identName; }
set { this._identName = value; }
}
[XmlElement("DefaultFullName")]
public string DefaultFullName
{
get { return this._fullName; }
set { this._fullName = value; }
}
[XmlElement("DefaultQuitMessage")]
public string DefaultQuitMessage
{
get { return this._quitMessage; }
set { this._quitMessage = value; }
}
[XmlElement("IdentServer")]
public bool IdentServer
{
get { return this._identServer; }
set { this._identServer = value; }
}
[XmlElement("ReconnectServer")]
public bool ReconnectServer
{
get { return this._reconnectServer; }
set { this._reconnectServer = value; }
}
[XmlElement("LogConsole")]
public bool LogConsole
{
get { return this._logConsole; }
set { this._logConsole = value; }
}
[XmlElement("LogChannel")]
public bool LogChannel
{
get { return this._logChannel; }
set { this._logChannel = value; }
}
[XmlElement("LogQuery")]
public bool LogQuery
{
get { return this._logQuery; }
set { this._logQuery = value; }
}
[XmlElement("SeperateLogs")]
public bool SeperateLogs
{
get { return this._seperateLogs; }
set { this._seperateLogs = value; }
}
[XmlElement("LogFormat")]
public string LogFormat
{
get { return this._logFormat; }
set { this._logFormat = value; }
}
[XmlElement("ShowEmoticons")]
public bool ShowEmoticons
{
get { return this._showEmoticons; }
set { this._showEmoticons = value; }
}
[XmlElement("ShowEmoticonPicker")]
public bool ShowEmoticonPicker
{
get { return this._showEmoticonPicker; }
set { this._showEmoticonPicker = value; }
}
[XmlElement("EmoticonsFixedSize")]
public bool EmoticonsFixedSize
{
get { return this._emoticonsFixedSize; }
set { this._emoticonsFixedSize = value; }
}
[XmlElement("ShowColorPicker")]
public bool ShowColorPicker
{
get { return this._showColorPicker; }
set { this._showColorPicker = value; }
}
[XmlElement("ShowStatusBar")]
public bool ShowStatusBar
{
get { return this._showStatusBar; }
set { this._showStatusBar = value; }
}
[XmlElement("ShowToolBar")]
public bool ShowToolBar
{
get { return this._showToolBar; }
set { this._showToolBar = value; }
}
[XmlElement("ShowServerTree")]
public bool ShowServerTree
{
get { return this._showServerTree; }
set { this._showServerTree = value; }
}
[XmlElement("ShowNickList")]
public bool ShowNickList
{
get { return this._showNickList; }
set { this._showNickList = value; }
}
[XmlElement("ShowNickHost")]
public bool ShowNickHost
{
get { return this._showNickHost; }
set { this._showNickHost = value; }
}
[XmlElement("ShowNickButtons")]
public bool ShowNickButtons
{
get { return this._showNickButtons; }
set { this._showNickButtons = value; }
}
[XmlElement("ShowServerButtons")]
public bool ShowServerButtons
{
get { return this._showServerButtons; }
set { this._showServerButtons = value; }
}
[XmlElement("DisableQueries")]
public bool DisableQueries
{
get { return this._disableQueries; }
set { this._disableQueries = value; }
}
[XmlElement("NewQueryForegound")]
public bool NewQueryForegound
{
get { return this._showQueryForegound; }
set { this._showQueryForegound = value; }
}
[XmlElement("WhoisNewQuery")]
public bool WhoisNewQuery
{
get { return this._whoisNewQuery; }
set { this._whoisNewQuery = value; }
}
[XmlElement("ChannelOpenKick")]
public bool ChannelOpenKick
{ get; set; }
[XmlElement("ShowUnreadLine")]
public bool ShowUnreadLine
{
get { return this._showUnreadLine; }
set { this._showUnreadLine = value; }
}
[XmlElement("MinimizeToTray")]
public bool MinimizeToTray
{
get { return this._minimizeTray; }
set { this._minimizeTray = value; }
}
[XmlElement("IsOnTray")]
public bool IsOnTray
{
get { return this._isOnTray; }
set { this._isOnTray = value; }
}
[XmlElement("MaximumTextLines")]
public int MaximumTextLines
{
get { return this._maxTextLines; }
set { this._maxTextLines = value; }
}
[XmlElement("Language")]
public string Language
{
get { return this._language; }
set { this._language = value; }
}
[XmlElement("DCCChatAutoAccept")]
public bool DCCChatAutoAccept
{ get; set; }
[XmlElement("DCCFileAutoAccept")]
public bool DCCFileAutoAccept
{ get; set; }
[XmlElement("DCCChatIgnore")]
public bool DCCChatIgnore
{ get; set; }
[XmlElement("DCCFileIgnore")]
public bool DCCFileIgnore
{ get; set; }
[XmlElement("DCCChatTimeOut")]
public int DCCChatTimeOut
{
get { return this._dccChatTimeOut; }
set { this._dccChatTimeOut = value; }
}
[XmlElement("DCCPortLower")]
public int DCCPortLower
{
get { return this._dccPortLower; }
set { this._dccPortLower = value; }
}
[XmlElement("DCCPortUpper")]
public int DCCPortUpper
{
get { return this._dccPortUpper; }
set { this._dccPortUpper = value; }
}
[XmlElement("DCCReceiveFolder")]
public string DCCReceiveFolder
{
get { return this._dccReceiveFolder; }
set { this._dccReceiveFolder = value; }
}
[XmlElement("DCCSendFolder")]
public string DCCSendFolder
{
get { return this._dccSendFolder; }
set { this._dccSendFolder = value; }
}
[XmlElement("DCCLocalIP")]
public string DCCLocalIP
{ get; set; }
[XmlElement("DCCAutoGetRouterIP")]
public bool DCCAutogetRouterIP
{
get { return this._autoGetRouterIP; }
set { this._autoGetRouterIP = value; }
}
[XmlElement("DCCBufferSize")]
public int DCCBufferSize
{
get { return this._dccBufferSize; }
set { this._dccBufferSize = value; }
}
[XmlArray("ScriptFiles")]
[XmlArrayItem("Item")]
public string[] ScriptFiles
{ get; set; }
[XmlElement("JoinEventLocation")]
public int JoinEventLocation
{ get; set; }
[XmlElement("PartEventLocation")]
public int PartEventLocation
{ get; set; }
[XmlElement("QuitEventLocation")]
public int QuitEventLocation
{ get; set; }
[XmlElement("ModeEventLocation")]
public int ModeEventLocation
{ get; set; }
[XmlElement("TopicEventLocation")]
public int TopicEventLocation
{ get; set; }
[XmlElement("KickEventLocation")]
public int KickEventLocation
{ get; set; }
[XmlElement("ChannelMessageEventLocation")]
public int ChannelMessageEventLocation
{ get; set; }
[XmlElement("ChannelActionEventLocation")]
public int ChannelActionEventLocation
{ get; set; }
[XmlElement("NickChangeEventLocation")]
public int NickChangeEventLocation
{ get; set; }
[XmlElement("ServerNoticeEventLocation")]
public int ServerNoticeEventLocation
{ get; set; }
[XmlElement("UserNoticeEventLocation")]
public int UserNoticeEventLocation
{ get; set; }
[XmlElement("WhoisEventLocation")]
public int WhoisEventLocation
{ get; set; }
[XmlElement("CtcpEventLocation")]
public int CtcpEventLocation
{ get; set; }
[XmlElement("ServerErrorEventLocation")]
public int ServerErrorEventLocation
{ get; set; }
[XmlElement("BuddyEventLocation")]
public int BuddyEventLocation
{ get; set; }
[XmlElement("DccEventLocation")]
public int DccEventLocation
{ get; set; }
[XmlElement("CurrentTheme")]
public string CurrentTheme
{ get; set; }
[XmlArray("Themes")]
[XmlArrayItem("Item")]
public string[] Themes
{ get; set; }
[XmlElement("SoundUseExternalCommand")]
public bool SoundUseExternalCommand
{ get; set; }
[XmlElement("SoundExternalCommand")]
public string SoundExternalCommand
{ get; set; }
}
[XmlRoot("IceChatMessageFormat")]
public class IceChatMessageFormat
{
[XmlArray("MessageSettings")]
[XmlArrayItem("Item", typeof(ServerMessageFormatItem))]
public ServerMessageFormatItem[] MessageSettings
{ get; set; }
}
public class ServerMessageFormatItem
{
public string MessageName;
public string FormattedMessage;
}
[XmlRoot("IceChatFonts")]
public class IceChatFontSetting
{
[XmlArray("FontSettings")]
[XmlArrayItem("Item", typeof(FontSettingItem))]
public FontSettingItem[] FontSettings
{ get; set; }
}
public class FontSettingItem
{
public string WindowType;
public string FontName;
public float FontSize;
}
public class IceChatPluginFile
{
[XmlArray("Plugins")]
[XmlArrayItem("Item", typeof(PluginItem))]
public List<PluginItem> listPlugins;
public IceChatPluginFile()
{
listPlugins = new List<PluginItem>();
}
public void AddPlugin(PluginItem plugin)
{
listPlugins.Add(plugin);
}
}
public class PluginItem
{
[XmlElement("PluginFile")]
public string PluginFile
{ get; set; }
[XmlElement("Enabled")]
public bool Enabled
{ get; set; }
}
//seperate file(s) for all the aliases
public class IceChatAliases
{
[XmlArray("Aliases")]
[XmlArrayItem("Item", typeof(AliasItem))]
public List<AliasItem> listAliases;
public IceChatAliases()
{
listAliases = new List<AliasItem>();
}
public void AddAlias(AliasItem alias)
{
listAliases.Add(alias);
}
}
public class AliasItem
{
[XmlElement("AliasName")]
public string AliasName
{ get; set; }
[XmlArray("Command")]
[XmlArrayItem("Item")]
public string[] Command
{ get; set; }
}
public class IceChatEmoticon
{
[XmlArray("Emoticons")]
[XmlArrayItem("Item", typeof(EmoticonItem))]
public List<EmoticonItem> listEmoticons;
public IceChatEmoticon()
{
listEmoticons = new List<EmoticonItem>();
}
public void AddEmoticon(EmoticonItem item)
{
listEmoticons.Add(item);
}
}
public class EmoticonItem
{
[XmlAttribute("ID")]
public int ID
{ get; set; }
[XmlElement("EmoticonImage")]
public string EmoticonImage
{ get; set; }
[XmlElement("Trigger")]
public string Trigger
{ get; set; }
}
public class IceChatPopupMenus
{
[XmlArray("Popups")]
[XmlArrayItem("Item",typeof(PopupMenuItem))]
public List<PopupMenuItem> listPopups;
public IceChatPopupMenus()
{
listPopups = new List<PopupMenuItem>();
}
public void ReplacePopup(string popupType, PopupMenuItem menu)
{
foreach (PopupMenuItem p in listPopups)
{
if (p.PopupType == popupType)
{
listPopups.Remove(p);
break;
}
}
listPopups.Add(menu);
}
public void AddPopup(PopupMenuItem menu)
{
listPopups.Add(menu);
}
}
public class PopupMenuItem
{
[XmlAttribute("PopupType")]
public string PopupType
{ get; set; }
[XmlArray("Menu")]
[XmlArrayItem("Item")]
public string[] Menu
{ get; set; }
}
[XmlRoot("IceChatSounds")]
public class IceChatSounds
{
public class SoundEntry
{
public SoundEntry() { }
public SoundEntry(string k, string d)
{
key = k; desc = d;
}
public SoundEntry(string k, string d, string f)
{
key=k; desc=d; file=f;
}
public SoundEntry(string k, string d, SoundEntry p)
{
key = k; desc = d; parent = p;
}
private string key;
private string desc;
private string file;
SoundEntry parent;
[XmlElement("Key")]
public string Key
{
get { return key; }
set
{
if (key != null)
throw new InvalidOperationException("Cannot modify a key after it was assigned a value.");
key = value;
}
}
[XmlElement("Description")]
public string Description
{
get { return desc; }
set { desc = value; }
}
[XmlElement("File")]
public string File
{
get { return file; }
set { file = value; }
}
public SoundEntry Parent
{
get {return parent;}
set { parent = value; }
}
public string getSoundFile()
{
if (file!=null && file.Length>0) return file;
if (parent!=null) return parent.getSoundFile();
return null;
}
}
[XmlArray("soundList")]
[XmlArrayItem("soundEntry", typeof(SoundEntry))]
public List<SoundEntry> soundList;
public IceChatSounds()
{
soundList = new List<SoundEntry>();
}
public void AddDefaultSounds()
{
Add(new SoundEntry("conmsg", "New Message in Console"));
Add(new SoundEntry("chanmsg", "New Channel Message"));
Add(new SoundEntry("privmsg", "New Private Message"));
Add(new SoundEntry("notice", "New User Notice"));
Add(new SoundEntry("nickchan", "Nickname said in channel"));
Add(new SoundEntry("nickpriv", "Nickname said in private message"));
Add(new SoundEntry("buddy", "A buddy has come online"));
Add(new SoundEntry("dropped", "Server Disconnection"));
Add(new SoundEntry("operping", "Request for operator"));
}
public void Add(SoundEntry s)
{
foreach (SoundEntry x in soundList)
{
if (x.Key.Equals(s.Key))
{
x.Parent = s.Parent;
return;
}
}
soundList.Add(s);
}
public SoundEntry getSound(string key)
{
foreach (SoundEntry x in soundList)
{
if (x.Key.Equals(key))
{
return x;
}
}
return null;
}