-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRapidLink.cs
85 lines (79 loc) · 2.03 KB
/
RapidLink.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
using Aspose.Email.Mapi;
using OSTandPSTParser.Inputs;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OSTandPSTParser
{
public class RapidLink
{
private MainForm _RapidForm;
private String _FileName;
private InputPST _sourcePST;
private List<RapidMailItem> _rapidMailItems;
private List<BackgroundWorker> _backgroundWorkers;
public RapidLink(MainForm _MainFrom)
{
_RapidForm = _MainFrom;
_rapidMailItems = new List<RapidMailItem>();
_backgroundWorkers = new List<BackgroundWorker>();
}
public String FileName
{
get { return _FileName; }
set { _FileName = value; }
}
public MainForm RapidForm
{
get { return _RapidForm; }
set { _RapidForm = value; }
}
internal InputPST MailStore
{
get { return _sourcePST; }
set { _sourcePST = value; }
}
internal void AddBgWorker(BackgroundWorker worker)
{
_backgroundWorkers.Add(worker);
}
internal void AddMailItem(RapidMailItem mailItem)
{
_rapidMailItems.Add(mailItem);
}
internal bool CheckThenAddMailItem(RapidMailItem mailItem)
{
if(GetMailItem(mailItem.MsgID) != null )
{
return false;
}
else
{
_rapidMailItems.Add(mailItem);
return true;
}
}
internal RapidMailItem GetMailItem(string msgId)
{
return(_rapidMailItems.Find(x => x.MsgID == msgId));
}
}
internal class RapidMailItem
{
public RapidMailItem(string msgID, MapiMessage message, TreeNode msgTreeNode, TreeNode folderTreeNode)
{
this.MsgID = msgID;
this.MsgTreeNode = msgTreeNode;
this.FolderTreeNode = folderTreeNode;
this.Message = message;
}
internal string MsgID { get; set; }
internal TreeNode MsgTreeNode { get; set; }
internal TreeNode FolderTreeNode { get; set; }
internal MapiMessage Message { get; set; }
}
}