forked from pmengal/MailSystem.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenu.cs
More file actions
454 lines (364 loc) · 15.5 KB
/
MainMenu.cs
File metadata and controls
454 lines (364 loc) · 15.5 KB
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
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
using System.IO;
using System.Xml.Serialization;
using System.Reflection;
using ActiveUp.Net.Mail;
using ActiveUp.Net.Samples.Utils;
using System.Windows.Forms;
namespace ActiveUp.Net.Samples
{
public partial class MainMenu : System.Windows.Forms.Form
{
private SamplesConfiguration _configuration;
public MainMenu()
{
InitializeComponent();
SamplesConfiguration config = this.Configuration;
}
public SamplesConfiguration Configuration
{
get
{
if (_configuration == null)
{
_configuration = new SamplesConfiguration();
string configFullPath = Utils.Common.GetImagePath(Assembly.GetExecutingAssembly().Location) + @"\" + _configuration.FileName;
if (File.Exists(configFullPath))
{
TextReader reader = new StreamReader(configFullPath);
XmlSerializer serialize = new XmlSerializer(typeof(SamplesConfiguration));
_configuration = (SamplesConfiguration)serialize.Deserialize(reader);
reader.Close();
}
else
{
_configuration.SetDefaultValue();
ConfigurationForm configForm = new ConfigurationForm(this.Configuration);
configForm.ShowDialog();
}
}
return _configuration;
}
set
{
_configuration = value;
}
}
#region SMTP
private void _bSmtpSendingUsingSmtp_Click(object sender, EventArgs e)
{
SMTP.SendingUsingAnSmtpServer form = new SMTP.SendingUsingAnSmtpServer(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithoutSmtpServer_Click(object sender, EventArgs e)
{
SMTP.SendingWithoutASmtpServer form = new SMTP.SendingWithoutASmtpServer(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithMultipleFailOverSmtp_Click(object sender, EventArgs e)
{
SMTP.SendingWithMultipleFailoverSmtp form = new SMTP.SendingWithMultipleFailoverSmtp(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithFileAttachments_Click(object sender, EventArgs e)
{
SMTP.SendingWithFileAttachments form = new SMTP.SendingWithFileAttachments(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithSmtpAuthentication_Click(object sender, EventArgs e)
{
SMTP.SendingWithSmtpAuthentification form = new SMTP.SendingWithSmtpAuthentification(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithSecureConnection_Click(object sender, EventArgs e)
{
SMTP.SendingWithSecureConnection form = new SMTP.SendingWithSecureConnection(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingToMultipleRecipients_Click(object sender, EventArgs e)
{
SMTP.SendingToMultipleRecipients form = new SMTP.SendingToMultipleRecipients(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithEmbeddedObjects_Click(object sender, EventArgs e)
{
SMTP.SendingWithEmbeddedObjects form = new SMTP.SendingWithEmbeddedObjects(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingWithMultipleBody_Click(object sender, EventArgs e)
{
SMTP.SendingWithMultipleBody form = new SMTP.SendingWithMultipleBody(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingAsynchronously_Click(object sender, EventArgs e)
{
SMTP.SendingAsynchronously form = new SMTP.SendingAsynchronously(this.Configuration);
form.ShowDialog();
}
private void _bSmtpSendingSignedEmail_Click(object sender, EventArgs e)
{
SMTP.SendingSignedEmails form = new SMTP.SendingSignedEmails(this.Configuration);
form.ShowDialog();
}
private void _bSmptSendingCryptedEmail_Click(object sender, EventArgs e)
{
SMTP.SendingCryptedEmail form = new SMTP.SendingCryptedEmail(this.Configuration);
form.ShowDialog();
}
#endregion
#region Template
private void _bSendingFromAnXMLTemplate_Click(object sender, EventArgs e)
{
Template.SendingFromAnXmlTemplate form = new Template.SendingFromAnXmlTemplate(this.Configuration);
form.ShowDialog();
}
private void _bWorkingWithLists_Click(object sender, EventArgs e)
{
Template.WorkingWithList form = new Template.WorkingWithList(this.Configuration);
form.ShowDialog();
}
private void _bWorkingWithFieldFormat_Click(object sender, EventArgs e)
{
Template.WorkingWithFieldFormat form = new Template.WorkingWithFieldFormat(this.Configuration);
form.ShowDialog();
}
private void _bMailMerginFromDataSources_Click(object sender, EventArgs e)
{
Template.MailMergingFromDataSources form = new Template.MailMergingFromDataSources(this.Configuration);
form.ShowDialog();
}
private void _bCombiningMergingAndTemplating_Click(object sender, EventArgs e)
{
Template.CombiningMergingAndTemplating form = new Template.CombiningMergingAndTemplating(this.Configuration);
form.ShowDialog();
}
#endregion
#region Pop3
private void _bRetrieveMessageCount_Click(object sender, EventArgs e)
{
POP3.RetrieveMessageCount form = new POP3.RetrieveMessageCount(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveMessageList_Click(object sender, EventArgs e)
{
POP3.RetrieveMessageList form = new POP3.RetrieveMessageList(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveMessageHeaderOnly_Click(object sender, EventArgs e)
{
POP3.RetrieveMessageHeaderOnly form = new POP3.RetrieveMessageHeaderOnly(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveSpecificMessage_Click(object sender, EventArgs e)
{
POP3.RetrieveSpecificMessage form = new POP3.RetrieveSpecificMessage(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveFromSecureConnection_Click(object sender, EventArgs e)
{
POP3.RetrieveFromSecureConnection form = new POP3.RetrieveFromSecureConnection(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveAsynch_Click(object sender, EventArgs e)
{
POP3.RetrieveAsynchronously form = new POP3.RetrieveAsynchronously(this.Configuration);
form.ShowDialog();
}
private void _bRetriveToFile_Click(object sender, EventArgs e)
{
POP3.RetrieveToFile form = new POP3.RetrieveToFile(this.Configuration);
form.ShowDialog();
}
private void _bSecureConnectionUsingAPOP_Click(object sender, EventArgs e)
{
POP3.SecureConnectionUsingApop form = new POP3.SecureConnectionUsingApop(this.Configuration);
form.ShowDialog();
}
private void _bCRAMAuthentication_Click(object sender, EventArgs e)
{
POP3.CRAMAuthentication form = new POP3.CRAMAuthentication(this.Configuration);
form.ShowDialog();
}
#endregion
#region Imap4
private void _bImapRetrieveAllMailboxes_Click(object sender, EventArgs e)
{
IMAP4.RetrieveAllMailboxes form = new IMAP4.RetrieveAllMailboxes(this.Configuration);
form.ShowDialog();
}
private void _bImapRetrieveMessageList_Click(object sender, EventArgs e)
{
IMAP4.RetrieveMessageList form = new IMAP4.RetrieveMessageList(this.Configuration);
form.ShowDialog();
}
private void _bImapFlagMessage_Click(object sender, EventArgs e)
{
IMAP4.FlagMessage form = new IMAP4.FlagMessage(this.Configuration);
form.ShowDialog();
}
private void _bImapRetrieveSpecificMessage_Click(object sender, EventArgs e)
{
IMAP4.RetrieveSpecificMessage form = new IMAP4.RetrieveSpecificMessage(this.Configuration);
form.ShowDialog();
}
private void _bImapFlagMessage_Click_1(object sender, EventArgs e)
{
IMAP4.FlagMessage form = new IMAP4.FlagMessage(this.Configuration);
form.ShowDialog();
}
private void _bImapRetrieveMessageHeader_Click(object sender, EventArgs e)
{
IMAP4.RetrieveMessageHeader form = new IMAP4.RetrieveMessageHeader(this.Configuration);
form.ShowDialog();
}
private void _bRetrieveAsynchronously_Click(object sender, EventArgs e)
{
IMAP4.RetrieveAsynchronously form = new IMAP4.RetrieveAsynchronously(this.Configuration);
form.ShowDialog();
}
private void _bImapRetrieveSecureConnection_Click(object sender, EventArgs e)
{
IMAP4.RetrieveFromSecureConnection form = new IMAP4.RetrieveFromSecureConnection(this.Configuration);
form.ShowDialog();
}
private void _bSearchMailbox_Click(object sender, EventArgs e)
{
IMAP4.SearchMailbox form = new IMAP4.SearchMailbox(this.Configuration);
form.ShowDialog();
}
private void _bCreateMailbox_Click(object sender, EventArgs e)
{
IMAP4.CreateMailbox form = new IMAP4.CreateMailbox(this.Configuration);
form.ShowDialog();
}
private void _bDeleteMailbox_Click(object sender, EventArgs e)
{
IMAP4.DeleteMailbox form = new IMAP4.DeleteMailbox(this.Configuration);
form.ShowDialog();
}
private void _bEmptyMailbox_Click(object sender, EventArgs e)
{
IMAP4.EmptyMailbox form = new IMAP4.EmptyMailbox(this.Configuration);
form.ShowDialog();
}
private void _bImapRenameMailbox_Click(object sender, EventArgs e)
{
IMAP4.RenameMailbox form = new IMAP4.RenameMailbox(this.Configuration);
form.ShowDialog();
}
#endregion
#region NNTP
private void _bDisplayAllNewsgroup_Click(object sender, EventArgs e)
{
NNTP.DisplayAllNewsGroup form = new NNTP.DisplayAllNewsGroup(this.Configuration);
form.ShowDialog();
}
private void _bNntpMessageCount_Click(object sender, EventArgs e)
{
NNTP.DisplayMessageCount form = new NNTP.DisplayMessageCount(this.Configuration);
form.ShowDialog();
}
private void _bNntpRetrieveMessageList_Click(object sender, EventArgs e)
{
NNTP.RetrieveMessageList form = new NNTP.RetrieveMessageList(this.Configuration);
form.ShowDialog();
}
private void _bNntpRetrieveNewMessages_Click(object sender, EventArgs e)
{
NNTP.RetrieveNewMessages form = new NNTP.RetrieveNewMessages(this.Configuration);
form.ShowDialog();
}
private void _bNntpRetrieveSpecificMessage_Click(object sender, EventArgs e)
{
NNTP.RetrieveSpecificMessage form = new NNTP.RetrieveSpecificMessage(this.Configuration);
form.ShowDialog();
}
private void _bNntpPostMessage_Click(object sender, EventArgs e)
{
NNTP.PostMessage form = new NNTP.PostMessage(this.Configuration);
form.ShowDialog();
}
#endregion
#region Validation
private void _bWorkingWithDomainKeys_Click(object sender, EventArgs e)
{
Validation.WorkingWithDomainKeys form = new Validation.WorkingWithDomainKeys(this.Configuration);
form.ShowDialog();
}
private void _bWorkingWithBlackList_Click(object sender, EventArgs e)
{
Validation.WorkingWithBlackListServers form = new Validation.WorkingWithBlackListServers(this.Configuration);
form.ShowDialog();
}
private void _bValidateEmail_Click(object sender, EventArgs e)
{
Validation.ValidateEmail form = new Validation.ValidateEmail(this.Configuration);
form.ShowDialog();
}
private void _bFilterEmails_Click(object sender, EventArgs e)
{
Validation.FilterEmails form = new Validation.FilterEmails(this.Configuration);
form.ShowDialog();
}
#endregion
#region Common
private void _bSaveAttchment_Click(object sender, EventArgs e)
{
Common.SaveAttachmentToDisk form = new Common.SaveAttachmentToDisk(this.Configuration);
form.ShowDialog();
}
private void _bWorkingWithEncoding_Click(object sender, EventArgs e)
{
Common.WorkingWithEncodingAndCharset form = new Common.WorkingWithEncodingAndCharset(this.Configuration);
form.ShowDialog();
}
private void _bWorkingWithMessageSettings_Click(object sender, EventArgs e)
{
Common.WorkingWithMessageSettings form = new Common.WorkingWithMessageSettings(this.Configuration);
form.ShowDialog();
}
private void _bDetermineBounce_Click(object sender, EventArgs e)
{
Common.DetermineIfBounceEmail form = new Common.DetermineIfBounceEmail(this.Configuration);
form.ShowDialog();
}
#endregion
private void _tsbConfig_Click(object sender, EventArgs e)
{
ConfigurationForm configForm = new ConfigurationForm(this.Configuration);
configForm.ShowDialog();
}
private void blockListServersQueryButton_Click(object sender, EventArgs e)
{
Validation.BlockListServerQuery form = new Validation.BlockListServerQuery(this.Configuration);
form.ShowDialog();
}
private void readWritevCardButton_Click(object sender, EventArgs e)
{
PDI.ReadWritevCard form = new PDI.ReadWritevCard(this.Configuration);
form.ShowDialog();
}
private void readWritevCalendar_Click(object sender, EventArgs e)
{
PDI.ReadWritevCalendar form = new PDI.ReadWritevCalendar(this.Configuration);
form.ShowDialog();
}
private void commtouchTechnology_Click(object sender, EventArgs e)
{
MessageBox.Show("The Commtouch® Technology sample is available as a separated project.");
}
private void newMessageNotificationButton_Click(object sender, EventArgs e)
{
IMAP4.NewMessageNotification form = new IMAP4.NewMessageNotification(this.Configuration);
form.ShowDialog();
}
}
}