Revision: 170
http://svn.sourceforge.net/nmailserver/?rev=170&view=rev
Author: tmyroadctfig
Date: 2007-03-08 01:43:35 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
Changed some classes to use generic interfaces instead of concrete types. Added a default constructor to LocalStoreGroup.
Modified Paths:
--------------
NMail/trunk/NMail/DataTypes/ACLs/GenericAcl.cs
NMail/trunk/NMail/DataTypes/IMessageBodyPart.cs
NMail/trunk/NMail/DataTypes/Imap/FetchDataList.cs
NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreGroup.cs
NMail/trunk/NMail/DataTypes/LocalStore/MailDomain.cs
NMail/trunk/NMail/DataTypes/Message.cs
NMail/trunk/NMail/DataTypes/MultipartBodyPart.cs
NMail/trunk/NMail/DataTypes/SimpleBodyPart.cs
Modified: NMail/trunk/NMail/DataTypes/ACLs/GenericAcl.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/ACLs/GenericAcl.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/ACLs/GenericAcl.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -29,7 +29,7 @@
/// <summary>
/// A map of identifiers to access control entries.
/// </summary>
- protected Dictionary<string, GenericAce<PrivilegeType>> entries = new Dictionary<string, GenericAce<PrivilegeType>>(StringComparer.InvariantCultureIgnoreCase);
+ protected IDictionary<string, GenericAce<PrivilegeType>> entries = new Dictionary<string, GenericAce<PrivilegeType>>(StringComparer.InvariantCultureIgnoreCase);
/// <summary>
/// Creates a new ACL.
Modified: NMail/trunk/NMail/DataTypes/IMessageBodyPart.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/IMessageBodyPart.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/IMessageBodyPart.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -41,7 +41,7 @@
/// <summary>
/// Gets the mime parts of this message part, if any.
/// </summary>
- List<IMessageBodyPart> MimeParts { get; }
+ IList<IMessageBodyPart> MimeParts { get; }
/// <summary>
/// Gets the preamble for the message body, if any.
Modified: NMail/trunk/NMail/DataTypes/Imap/FetchDataList.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/Imap/FetchDataList.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/Imap/FetchDataList.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -29,7 +29,7 @@
/// <summary>
/// Internal storage for the data list.
/// </summary>
- private List<FetchDataItem> fetchDataList = new List<FetchDataItem>();
+ private IList<FetchDataItem> fetchDataList = new List<FetchDataItem>();
/// <summary>
/// Creates a new list from the given string.
@@ -89,7 +89,7 @@
/// <summary>
/// Returns the list of data items to retieve.
/// </summary>
- public List<FetchDataItem> DataListItems {
+ public IList<FetchDataItem> DataListItems {
get {
return this.fetchDataList;
}
Modified: NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreGroup.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreGroup.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/LocalStore/LocalStoreGroup.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -28,6 +28,11 @@
[Serializable]
public class LocalStoreGroup {
/// <summary>
+ /// Creates a new local store group.
+ /// </summary>
+ public LocalStoreGroup() { }
+
+ /// <summary>
/// Creates a new local store group with the given details.
/// </summary>
/// <param name="name">The group name for this instance.</param>
@@ -37,8 +42,10 @@
public LocalStoreGroup(string name, int groupId, int[] userIds, int[] groupIds) {
this.name = name;
this.groupId = groupId;
- this.userIds.AddRange(userIds);
- this.groupIds.AddRange(groupIds);
+
+ // These casts should always be valid in the constructor
+ ((List<int>) this.userIds).AddRange(userIds);
+ ((List<int>) this.groupIds).AddRange(groupIds);
}
private string name;
@@ -69,26 +76,32 @@
}
}
- private List<int> groupIds = new List<int>();
+ private IList<int> groupIds = new List<int>();
/// <summary>
/// The group Ids under this group.
/// </summary>
- public List<int> SubGroupIds {
+ public IList<int> SubGroupIds {
get {
return this.groupIds;
}
+ set {
+ this.groupIds = value;
+ }
}
- private List<int> userIds = new List<int>();
+ private IList<int> userIds = new List<int>();
/// <summary>
/// The user Ids under this group.
/// </summary>
- public List<int> UserIds {
+ public IList<int> UserIds {
get {
return this.userIds;
}
+ set {
+ this.userIds = value;
+ }
}
}
}
Modified: NMail/trunk/NMail/DataTypes/LocalStore/MailDomain.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/LocalStore/MailDomain.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/LocalStore/MailDomain.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -30,6 +30,16 @@
/// </summary>
[Serializable]
public class MailDomain {
+ /// <summary>
+ /// Creates a new mail domain.
+ /// </summary>
+ public MailDomain() { }
+
+ /// <summary>
+ /// Creates a new mail domain with the given Id and host.
+ /// </summary>
+ /// <param name="mailDomainId">The mail domain's Id.</param>
+ /// <param name="primaryHost">The primary host.</param>
public MailDomain(int mailDomainId, Host primaryHost) {
this.mailDomainId = mailDomainId;
this.primaryHost = primaryHost;
@@ -63,78 +73,87 @@
}
}
- private List<int> mailDomainUserIds = new List<int>();
+ private IList<int> mailDomainUserIds = new List<int>();
/// <summary>
/// A list of Ids for users that are members of this mail domain.
/// </summary>
- public List<int> UserIds {
+ public IList<int> UserIds {
get {
return this.mailDomainUserIds;
}
+ set {
+ this.mailDomainUserIds = value;
+ }
}
- private List<int> mailDomainGroupIds = new List<int>();
+ private IList<int> mailDomainGroupIds = new List<int>();
/// <summary>
/// A list of Ids for groups that are members of this mail domain.
/// </summary>
- public List<int> GroupIds {
+ public IList<int> GroupIds {
get {
return this.mailDomainGroupIds;
}
+ set {
+ this.mailDomainGroupIds = value;
+ }
}
- private List<WildcardHost> additionalHosts = new List<WildcardHost>();
+ private IList<WildcardHost> additionalHosts = new List<WildcardHost>();
/// <summary>
/// Other hosts that this domain accepts mail for.
/// </summary>
- public List<WildcardHost> AdditionalHosts {
+ public IList<WildcardHost> AdditionalHosts {
get {
return this.additionalHosts;
}
+ set {
+ this.additionalHosts = value;
+ }
}
- private List<ILocalStoreUserMap> mailboxMappings = new List<ILocalStoreUserMap>();
+ private IList<ILocalStoreUserMap> mailboxMappings = new List<ILocalStoreUserMap>();
/// <summary>
/// Gets the mailbox mappings for this domain.
/// </summary>
- public List<ILocalStoreUserMap> MailboxMappings {
+ public IList<ILocalStoreUserMap> MailboxMappings {
get {
return this.mailboxMappings;
}
}
- private List<ILocalStoreDeliveryAction> allowedActions = new List<ILocalStoreDeliveryAction>();
+ private IList<ILocalStoreDeliveryAction> allowedActions = new List<ILocalStoreDeliveryAction>();
/// <summary>
/// The actions that user's of this domain are allowed to use.
/// </summary>
- public List<ILocalStoreDeliveryAction> AllowedActions {
+ public IList<ILocalStoreDeliveryAction> AllowedActions {
get {
return this.allowedActions;
}
}
- private List<ILocalStoreRecipientValidator> allowedValidators = new List<ILocalStoreRecipientValidator>();
+ private IList<ILocalStoreRecipientValidator> allowedValidators = new List<ILocalStoreRecipientValidator>();
/// <summary>
/// The validators that user's of this domain are allowed to use.
/// </summary>
- public List<ILocalStoreRecipientValidator> AllowedValidators {
+ public IList<ILocalStoreRecipientValidator> AllowedValidators {
get {
return this.allowedValidators;
}
}
- private List<ILocalStoreDeliveryAction> defaultActions = new List<ILocalStoreDeliveryAction>();
+ private IList<ILocalStoreDeliveryAction> defaultActions = new List<ILocalStoreDeliveryAction>();
/// <summary>
/// The default set of actions to apply to incoming messages.
/// </summary>
- public List<ILocalStoreDeliveryAction> DefaultActions {
+ public IList<ILocalStoreDeliveryAction> DefaultActions {
get {
return this.defaultActions;
}
Modified: NMail/trunk/NMail/DataTypes/Message.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/Message.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/Message.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -113,7 +113,7 @@
/// <summary>
/// Gets the mime parts of this message part, if any.
/// </summary>
- public List<IMessageBodyPart> MimeParts {
+ public IList<IMessageBodyPart> MimeParts {
get {
if (!this.parsed) parseMime();
return this.data.MimeParts;
Modified: NMail/trunk/NMail/DataTypes/MultipartBodyPart.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/MultipartBodyPart.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/MultipartBodyPart.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -97,7 +97,7 @@
/// <summary>
/// Gets the mime parts for this body.
/// </summary>
- public List<IMessageBodyPart> MimeParts {
+ public IList<IMessageBodyPart> MimeParts {
get {
return this.mimeParts;
}
Modified: NMail/trunk/NMail/DataTypes/SimpleBodyPart.cs
===================================================================
--- NMail/trunk/NMail/DataTypes/SimpleBodyPart.cs 2007-03-04 10:11:20 UTC (rev 169)
+++ NMail/trunk/NMail/DataTypes/SimpleBodyPart.cs 2007-03-08 09:43:35 UTC (rev 170)
@@ -111,7 +111,7 @@
/// <summary>
/// Gets the mime parts of this message part. Always returns null.
/// </summary>
- public List<IMessageBodyPart> MimeParts {
+ public IList<IMessageBodyPart> MimeParts {
get {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|