public void Dispose() { if (_mapiFolders != null) { foreach( var key in _mapiFolders.Keys) { _mapiFolders[key].Dispose(); } _mapiFolders.Clear(); _mapiFolders = null; } if (_wsCurrentUser != null) { _wsCurrentUser.Dispose(); _wsCurrentUser = null; } if (_wsAccounts != null) { _wsAccounts.Dispose(); _wsAccounts = null; } if (_nameSpace != null) { Marshal.ReleaseComObject(_nameSpace); _nameSpace = null; } }
public Recipient Add(string Name) { var recipient = new WsRecipient(_recipients.Add(Name)); _wsRecipients.Add(recipient); return recipient; }