csmail-patches Mailing List for CS Mail API (Page 3)
Status: Pre-Alpha
Brought to you by:
mastergaurav
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(36) |
Aug
(25) |
Sep
(49) |
Oct
(28) |
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gaurav V. <mas...@us...> - 2002-09-19 08:16:18
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv24603 Modified Files: BodyPartList.cs ChangeLog HeaderList.cs MimeMultipart.cs Log Message: 2002-09-17 * BodyPartList.cs : Added utility methods. Fairly complete. * MimeBodyPart.cs : ?? 2002-09-16 * BodyPartList.cs : Removing "MailTODO". * HeaderList.cs : GetHeaderByName(string) - Implemented * MimeMultipart.cs : Typo error. Index: BodyPartList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPartList.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BodyPartList.cs 13 Sep 2002 04:52:49 -0000 1.4 +++ BodyPartList.cs 19 Sep 2002 08:16:15 -0000 1.5 @@ -13,9 +13,9 @@ namespace CSMail { - // <summary> - // Container for a list of body parts. - // </summary> + /// <summary> + /// Container for a list of body parts. + /// </summary> public class BodyPartList : IEnumerable { private ArrayList parts; @@ -24,72 +24,118 @@ /// <summary> /// Initializes an instance of the BodyPartList. /// </summary> + /// <remarks> + /// The list is not read-only. + /// </remarks> public BodyPartList() { parts = new ArrayList(); isReadOnly = false; } - [MailTODO] + /// <summary> + /// Creates an instance of BodyPartList with given parts + /// and readonly option. + /// </summary> + /// <param name="parts">The body parts in the initial list.</param> + /// <param name="isReadOnly">Determines if the list is + /// readonly.</param> public BodyPartList(BodyPart[] parts, bool isReadOnly) { this.isReadOnly = isReadOnly; - throw new NotImplementedException(); + this.parts = new ArrayList(); + foreach(BodyPart current in parts) + { + if(current != null) + { + this.parts.Add(current); + } + } } /// <summary> /// Creates an instance with a specified entry. /// </summary> - [MailTODO] + /// <param name="part">Body part in the initial list.</param> + /// <remarks> + /// The list is not read-only. + /// </remarks> public BodyPartList(BodyPart part) { - throw new NotImplementedException(); + parts = new ArrayList(); + parts.Add(part); + this.isReadOnly = false; } /// <summary> /// Creates an instance using the list of parts provided. /// </summary> - [MailTODO] - public BodyPartList(BodyPart[] parts) - { - throw new NotImplementedException(); - } - - /// <summary> - /// Creates an instance using the list provided. - /// </summary> + /// <param name="parts">Body parts in the initial list.</param> /// <remarks> - /// Do I need this? Should I make it <c>ICloneable</c>? + /// The list is not read-only. /// </remarks> - [MailTODO] - public BodyPartList(BodyPartList parts) + public BodyPartList(BodyPart[] parts) : this(parts, false) { - this.isReadOnly = parts.IsReadOnly; - throw new NotImplementedException(); } - [MailTODO] + /// <summary> + /// Gets or sets the part at the given index. + /// </summary> + /// <param name="index">The index (zero based) under + /// consideration.</param> + /// <exception name="ArgumentOutOfRangeException"> + /// <c>index</c> is less than zero, + /// <p>-or-</p> + /// <c>index</c> is euqal to or greater than <see cref="Count"/>. + /// </exception> + /// <exception name="NotSupportedException"> + /// When trying to modify a read-only list. + /// </exception> public BodyPart this[int index] { get { - throw new NotImplementedException(); + if(index < 0 || index > this.parts.Count) + { + throw new ArgumentOutOfRangeException("[Index(int)] Index value beyond limits."); + } + return (BodyPart)parts[index]; } set { - throw new NotImplementedException(); + if(index < 0 || index > this.parts.Count) + { + throw new ArgumentOutOfRangeException("[Index(int)] Index value beyond limits."); + } + if(isReadOnly) + { + throw new NotSupportedException("[Index(int)] Cannot modify read only."); + } + parts[index] = value; } } - [MailTODO] + /// <summary> + /// Gets the body part with the specified contentID. + /// </summary> + /// <param name="contentID">The value of the "Content-ID" + /// header.</param> public BodyPart this[string contentID] { get { - throw new NotImplementedException(); + int index = IndexOf(contentID); + if(index >= 0) + { + return (BodyPart)parts[index]; + } + return null; } } + /// <summary> + /// Returns if the list is a read-only list. + /// </summary> public bool IsReadOnly { get @@ -109,15 +155,157 @@ } } + /// <summary> + /// Returns the associated enumerator. + /// </summary> + /// <returns> + /// The enumerator associated with the list. + /// </returns> public IEnumerator GetEnumerator() { return parts.GetEnumerator(); } + /// <summary> + /// Returns the index of body part with specified content-ID. + /// </summary> + /// <param name="contentID">The value of the "Content-ID" + /// header for the part.</param> + /// <returns> + /// Index at which the part is found, + /// -1 if not found. + /// </returns> + public int IndexOf(string contentID) + { + for(int i = 0; i < parts.Count; i++) + { + BodyPart cBody = (BodyPart)parts[i]; + Header found = cBody.Headers.GetHeaderByName("Content-ID", + true); + if(found != null) + { + if(String.Compare(contentID, found.Value, true) == 0) + return i; + } + } + return -1; + } + /** * Have to allow only Add(BodyPart body) etc. * No Add(object generic) sort of thing. * So, not deriving class from ArrayList. */ + + /// <summary> + /// Returns the index of the given part in the list. + /// </summary> + /// <param name="part">The part to look for in the list.</param> + /// <returns> + /// The index of the part in the list, + /// -1 if not found. + /// </returns> + public int IndexOf(BodyPart part) + { + return parts.IndexOf(part); + } + + /// <summary> + /// Adds a part to the list. + /// </summary> + /// <param name="part">Part to be added to the list.</param> + /// <returns> + /// The number of elements after adding.</returns> + /// <exception name="NotSupportedException"> + /// When trying to add to a read-only list. + /// </exception> + public int Add(BodyPart part) + { + if(isReadOnly) + { + throw new NotSupportedException("[Add(BodyPart)] Cannot modify read only."); + } + return parts.Add(part); + } + + /// <summary> + /// Adds a part at the given index. + /// </summary> + /// <param name="index">Index (zero based) at which + /// the part is to be added.</param> + /// <param name="part">Part to be added to the list.</param> + /// <exception name="NotSupportedException"> + /// When trying to insert to a read-only list. + /// </exception> + public void Insert(int index, BodyPart part) + { + if(isReadOnly) + { + throw new NotSupportedException("[Insert(int, BodyPart)] Cannot modify read only."); + } + parts.Insert(index, part); + } + + /// <summary> + /// Removes all parts from the list. + /// </summary> + /// <exception name="NotSupportedException"> + /// When trying to insert to a read-only list. + /// </exception> + public void Clear() + { + if(isReadOnly) + { + throw new NotSupportedException("[Clear()] Cannot modify read only."); + } + parts.Clear(); + } + + /// <summary> + /// Determines whether the given part exists in the list + /// or not. + /// </summary> + /// <returns> + /// <c>true</c> if the part exists in the list, + /// <c>false</c> otherwise. + /// </returns> + public bool Contains(BodyPart part) + { + return parts.Contains(part); + } + + /// <summary> + /// Tries to remove a part from the list. + /// </summary> + /// <param name="part">Part to be removed from the list.</param> + /// <exception name="NotSupportedException"> + /// When trying to insert to a read-only list. + /// </exception> + public void Remove(BodyPart part) + { + if(isReadOnly) + { + throw new NotSupportedException("[Remove(BodyPart)] Cannot modify read only."); + } + parts.Remove(part); + } + + /// <summary> + /// Tries to remove a part from the list at the + /// specified index. + /// </summary> + /// <param name="index">Index (zero based), the part at which + /// is to be removed from the list.</param> + /// <exception name="NotSupportedException"> + /// When trying to insert to a read-only list. + /// </exception> + public void RemoveAt(int index) + { + if(isReadOnly) + { + throw new NotSupportedException("[RemoveAt(int)] Cannot modify read only."); + } + parts.RemoveAt(index); + } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- ChangeLog 16 Sep 2002 11:22:47 -0000 1.42 +++ ChangeLog 19 Sep 2002 08:16:15 -0000 1.43 @@ -1,4 +1,15 @@ +2002-09-17 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * BodyPartList.cs : Added utility methods. Fairly complete. + * MimeBodyPart.cs : ?? + +2002-09-16 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * BodyPartList.cs : Removing "MailTODO". + * HeaderList.cs : GetHeaderByName(string) - Implemented + * MimeMultipart.cs : Typo error. + 2002-09-16 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * MessagingException.cs : "MailTODO" for Message { get; } Index: HeaderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/HeaderList.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HeaderList.cs 6 Sep 2002 11:52:29 -0000 1.4 +++ HeaderList.cs 19 Sep 2002 08:16:15 -0000 1.5 @@ -276,6 +276,26 @@ } /// <summary> + /// Returns a header by its name. + /// </summary> + /// <param name="name">Header name to look for.</param> + /// <param name="ignoreCase">Whether or not to ignore case during + /// search.</param> + /// <returns> + /// The header instance with the given name, + /// null if not found. + /// </returns> + public Header GetHeaderByName(string name, bool ignoreCase) + { + foreach(Header current in this) + { + if(String.Compare(current.Name, name, ignoreCase) == 0) + return current; + } + return null; + } + + /// <summary> /// Removes the first matching header. /// </summary> /// <param name="fullHeader">Header to look for.</param> Index: MimeMultipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeMultipart.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MimeMultipart.cs 13 Sep 2002 06:10:59 -0000 1.4 +++ MimeMultipart.cs 19 Sep 2002 08:16:15 -0000 1.5 @@ -44,7 +44,7 @@ public BodyPart GetBodyPart(int index) { if(index < 0 || index > BodyParts.Count) - throw new IndexOutOfRangeException("[GetBodyPart] Index value is beyong limits"); + throw new IndexOutOfRangeException("[GetBodyPart] Index value is beyond limits"); return BodyParts[index]; } |
From: Gaurav V. <mas...@us...> - 2002-09-16 11:22:50
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv17278 Modified Files: ChangeLog MessagingException.cs Added Files: SendFailedException.cs Log Message: 2002-09-16 * MessagingException.cs : "MailTODO" for Message { get; } * SendFailedException.cs : Added new class / exception. --- NEW FILE --- /** * Namespace: CSMail * Class: SendFailedException * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; namespace CSMail { /// <summary> /// Exception to hold details of when messages are not sent. /// </summary> /// <remarks> /// This exception is ought to be used by <see cref="Transport"/> /// <see cref="Service"/> providers. /// </remarks> public class SendFailedException : MessagingException { /// <summary> /// List of valid addresses to which the message was delivered. /// </summary> protected IAddressList validSent; /// <summary> /// List of valid addresses to which the message was not delivered. /// </summary> protected IAddressList validUnsent; /// <summary> /// List of invalid addresses. /// </summary> protected IAddressList invalid; /// <summary> /// Creates a default instance of the object. /// </summary> public SendFailedException(): base() { } /// <summary> /// Creates an instance with error message. /// </summary> /// <param name="message">The error message</param> public SendFailedException(string message): base(message) { } /// <summary> /// Creates an instance with error message and next chained message. /// </summary> /// <param name="message">The error message</param> /// <param name="next">The next message in the chain.</param> public SendFailedException(string message, Exception next): base(message, next) { } /// <summary> /// Creates an instance with given error message, /// next chained exception and lists of addresses. /// </summary> /// <param name="message">The error message</param> /// <param name="next">The next message in the chain.</param> /// <param name="validSent">List of valid addresses to which /// the message was delivered.</param> /// <param name="validUnsent">List of valid addresses to which /// the message was not delivered.</param> /// <param name="invalid">List of invalid addresses.</param> public SendFailedException(string message, Exception next, IAddressList validSent, IAddressList validUnsent, IAddressList invalid) : base(message, next) { this.validSent = validSent; this.validUnsent = validUnsent; this.invalid = invalid; } /// <summary> /// Returns the list of valid addresses to which /// the message was delivered. /// </summary> public IAddressList ValidSent { get { return validSent; } } /// <summary> /// Returns the list of valid addresses to which /// the message was not delivered. /// </summary> public IAddressList ValidUnsent { get { return validUnsent; } } /// <summary> /// Returns the list of invalid addresses. /// </summary> public IAddressList Invalid { get { return invalid; } } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- ChangeLog 13 Sep 2002 06:10:59 -0000 1.41 +++ ChangeLog 16 Sep 2002 11:22:47 -0000 1.42 @@ -1,4 +1,9 @@ +2002-09-16 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * MessagingException.cs : "MailTODO" for Message { get; } + * SendFailedException.cs : Added new class / exception. + 2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * MimeBodyPart.cs : ContentType - Implemented Index: MessagingException.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessagingException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MessagingException.cs 6 Sep 2002 11:52:29 -0000 1.3 +++ MessagingException.cs 16 Sep 2002 11:22:47 -0000 1.4 @@ -37,6 +37,7 @@ } } + [MailTODO] public override string Message { get |
From: Gaurav V. <mas...@us...> - 2002-09-13 06:11:02
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv5241 Modified Files: BodyPart.cs ChangeLog MimeBodyPart.cs MimeMultipart.cs Multipart.cs Log Message: 2002-09-13 * MimeBodyPart.cs : ContentType - Implemented : Description - Implemented : Disposition - Implemented : Filename - Implemented : ContentID - Implemented : ContentLanguage - Implemented : ContentMD5 - Implemented : Text - Implemented : TransferEncoding - Implemented * MimeMultipart.cs : * BodyPart.cs : Added property PartState, removed Boundary. * Multipart.cs : Added property PartState. Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BodyPart.cs 13 Sep 2002 04:52:49 -0000 1.6 +++ BodyPart.cs 13 Sep 2002 06:10:59 -0000 1.7 @@ -9,6 +9,7 @@ */ using System.IO; +using CSMail.Utils; namespace CSMail { @@ -21,11 +22,7 @@ public abstract class BodyPart: IPart { private Multipart parent; - - /// <summary> - /// Boundary for this part. - /// </summary> - protected string boundary; + private StateBag partState; /// <summary> /// Constructor to do some initialization @@ -33,7 +30,6 @@ public BodyPart() { parent = null; - boundary = null; } /// <summary> @@ -48,6 +44,18 @@ } } + protected StateBag PartState + { + get + { + if(partState == null) + { + partState = new StateBag(false); + } + return partState; + } + } + /// <summary> /// Gets or sets the parent <c>Multipart</c> associated. /// </summary> @@ -64,17 +72,6 @@ set { parent = value; - } - } - - /// <summary> - /// Returns the boundary for this part. - /// </summary> - public string Boundary - { - get - { - return boundary; } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- ChangeLog 13 Sep 2002 05:53:11 -0000 1.40 +++ ChangeLog 13 Sep 2002 06:10:59 -0000 1.41 @@ -1,6 +1,21 @@ 2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * MimeBodyPart.cs : ContentType - Implemented + : Description - Implemented + : Disposition - Implemented + : Filename - Implemented + : ContentID - Implemented + : ContentLanguage - Implemented + : ContentMD5 - Implemented + : Text - Implemented + : TransferEncoding - Implemented + * MimeMultipart.cs : + * BodyPart.cs : Added property PartState, removed Boundary. + * Multipart.cs : Added property PartState. + +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StateBag.cs, * StateItem.cs : Moved to CSMail.Utils. Index: MimeBodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeBodyPart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MimeBodyPart.cs 9 Sep 2002 09:37:54 -0000 1.1 +++ MimeBodyPart.cs 13 Sep 2002 06:10:59 -0000 1.2 @@ -70,121 +70,147 @@ } } - [MailTODO] public override ContentType ContentType { get { - throw new NotImplementedException(); + object o = PartState["ContentType"]; + if(o != null) + return (ContentType)o; + return null; } set { - throw new NotImplementedException(); + PartState["ContentType"] = value; } } - [MailTODO] public override string Description { get { - throw new NotImplementedException(); + object o = PartState["Description"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["Description"] = value; } } - [MailTODO] public override ContentDisposition Disposition { get { - throw new NotImplementedException(); + object o = PartState["Disposition"]; + if(o != null) + return (ContentDisposition)o; + return ContentDisposition.Inline; } set { - throw new NotImplementedException(); + if(!Enum.IsDefined(typeof(ContentDisposition), value)) + throw new ArgumentException("[Disposition] Value cannot be set"); + PartState["Disposition"] = value; } } - [MailTODO] public override string Filename { get { - throw new NotImplementedException(); + object o = PartState["Filename"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["Filename"] = value; } } - [MailTODO] public string ContentID { get { - throw new NotImplementedException(); + object o = PartState["ContentID"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["ContentID"] = value; } } - [MailTODO] public string ContentLanguage { get { - throw new NotImplementedException(); + object o = PartState["ContentLanguage"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["ContentLanguage"] = value; } } - [MailTODO] public string ContentMD5 { get { - throw new NotImplementedException(); + object o = PartState["ContentMD5"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["ContentMD5"] = value; } } - [MailTODO] public string Text { get { - throw new NotImplementedException(); + object o = PartState["Text"]; + if(o != null) + return (string)o; + return String.Empty; } set { - throw new NotImplementedException(); + PartState["Text"] = value; } } - [MailTODO] public TransferEncoding TransferEncoding { get { - throw new NotImplementedException(); + object o = PartState["TransferEncoding"]; + if(o != null) + return (TransferEncoding)o; + return TransferEncoding.Default; } set { - throw new NotImplementedException(); + PartState["TransferEncoding"] = value; } + } + + [MailTODO] + public virtual void UpdateHeaders() + { + throw new NotImplementedException(); } [MailTODO] Index: MimeMultipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeMultipart.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MimeMultipart.cs 13 Sep 2002 04:52:49 -0000 1.3 +++ MimeMultipart.cs 13 Sep 2002 06:10:59 -0000 1.4 @@ -10,6 +10,7 @@ using System; using System.IO; +using CSMail.Utils; namespace CSMail { Index: Multipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Multipart.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Multipart.cs 12 Sep 2002 07:13:25 -0000 1.4 +++ Multipart.cs 13 Sep 2002 06:10:59 -0000 1.5 @@ -9,6 +9,7 @@ */ using System.IO; +using CSMail.Utils; namespace CSMail { @@ -41,6 +42,8 @@ /// </summary> protected ContentType CType; + private StateBag partState; + /// <summary> /// Creates an instance with default settings. /// </summary> @@ -86,6 +89,18 @@ { ParseBodyParts(); return bodyParts; + } + } + + protected virtual StateBag PartState + { + get + { + if(partState == null) + { + partState = new StateBag(false); + } + return partState; } } |
From: Gaurav V. <mas...@us...> - 2002-09-13 05:54:09
|
Update of /cvsroot/csmail/csmail/src/CSMail.Utils In directory usw-pr-cvs1:/tmp/cvs-serv1365 Modified Files: ChangeLog Added Files: StateBag.cs StateItem.cs Log Message: 2002-09-13 * StateBag.cs : Added new class. * StateItem.cs : Added new class. --- NEW FILE --- /** * Namespace: CSMail * Class: StateBag * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; using System.Collections; using System.Collections.Specialized; namespace CSMail.Utils { public sealed class StateBag : IDictionary, ICollection, IEnumerable { private bool ignoreCase; private bool marked; private HybridDictionary bag; public StateBag(bool ignoreCase) { Initialize(ignoreCase); } public StateBag() { Initialize(false); } private void Initialize(bool ignoreCase) { this.ignoreCase = ignoreCase; marked = false; bag = new HybridDictionary(ignoreCase); } public int Count { get { return bag.Count; } } public object this[string key] { get { if(key == null || key.Length == 0) { throw new ArgumentException ("[this] Key_Cannot_Be_Null"); } object val = bag [key]; if(val is StateItem) { return ((StateItem) val).Value; } return null; } set { Add(key, value); } } object IDictionary.this[object key] { get { return this[(string) key]; } set { Add((string)key, value); } } public ICollection Keys { get { return bag.Keys; } } public ICollection Values { get { return bag.Values; } } public StateItem Add(string key, object value) { if (key == null || key.Length == 0) throw new ArgumentException ("[Add] Key_Cannot_Be_Null"); StateItem val = (StateItem)bag[key]; if(val == null) { if(value != null || marked) { val = new StateItem(value); bag.Add (key, val); } } else if(value == null && !marked) { bag.Remove (key); } else { val.Value = value; } if(val != null && marked) { val.IsDirty = true; } return val; } public void Clear() { bag.Clear(); } public IDictionaryEnumerator GetEnumerator() { return bag.GetEnumerator(); } public bool IsItemDirty(string key) { object o = bag[key]; if (o is StateItem) return ((StateItem) o).IsDirty; return false; } public void Remove(string key) { bag.Remove(key); } /// <summary> /// Undocumented /// </summary> public void SetItemDirty(string key, bool dirty) { if (bag[key] is StateItem) { ((StateItem) bag [key]).IsDirty = dirty; } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { Values.CopyTo(array, index); } bool ICollection.IsSynchronized { get { return false; } } object ICollection.SyncRoot { get { return this; } } void IDictionary.Add(object key, object value) { Add((string) key, value); } void IDictionary.Remove(object key) { Remove((string) key); } bool IDictionary.Contains(object key) { return bag.Contains((string) key); } bool IDictionary.IsFixedSize { get { return false; } } bool IDictionary.IsReadOnly { get { return false; } } } } --- NEW FILE --- /** * Namespace: CSMail * Class: StateItem * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail.Utils { public sealed class StateItem { private object val; private bool isDirty; private StateItem() { } internal StateItem(object value) { this.val = value; } public bool IsDirty { get { return isDirty; } set { isDirty = value; } } public object Value { get { return val; } set { this.val = value; } } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.Utils/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ChangeLog 30 Aug 2002 10:32:41 -0000 1.8 +++ ChangeLog 13 Sep 2002 05:54:06 -0000 1.9 @@ -1,4 +1,9 @@ +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * StateBag.cs : Added new class. + * StateItem.cs : Added new class. + 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Properties.cs : Changed value type to object. |
From: Gaurav V. <mas...@us...> - 2002-09-13 05:53:14
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv1154 Modified Files: ChangeLog Removed Files: StateItem.cs StateBag.cs Log Message: 2002-09-13 * StateBag.cs, * StateItem.cs : Moved to CSMail.Utils. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- ChangeLog 13 Sep 2002 05:50:55 -0000 1.39 +++ ChangeLog 13 Sep 2002 05:53:11 -0000 1.40 @@ -1,6 +1,11 @@ 2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StateBag.cs, + * StateItem.cs : Moved to CSMail.Utils. + +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StateBag.cs : Added new class. * StateItem.cs : Added new class. --- StateItem.cs DELETED --- --- StateBag.cs DELETED --- |
From: Gaurav V. <mas...@us...> - 2002-09-13 05:50:58
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv642 Modified Files: ChangeLog Added Files: StateBag.cs StateItem.cs Log Message: 2002-09-13 * StateBag.cs : Added new class. * StateItem.cs : Added new class. --- NEW FILE --- /** * Namespace: CSMail * Class: StateBag * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; using System.Collections; using System.Collections.Specialized; namespace CSMail { public sealed class StateBag : IDictionary, ICollection, IEnumerable { private bool ignoreCase; private bool marked; private HybridDictionary bag; public StateBag(bool ignoreCase) { Initialize(ignoreCase); } public StateBag() { Initialize(false); } private void Initialize(bool ignoreCase) { this.ignoreCase = ignoreCase; marked = false; bag = new HybridDictionary(ignoreCase); } public int Count { get { return bag.Count; } } public object this[string key] { get { if(key == null || key.Length == 0) { throw new ArgumentException ("[this] Key_Cannot_Be_Null"); } object val = bag [key]; if(val is StateItem) { return ((StateItem) val).Value; } return null; } set { Add(key, value); } } object IDictionary.this[object key] { get { return this[(string) key]; } set { Add((string)key, value); } } public ICollection Keys { get { return bag.Keys; } } public ICollection Values { get { return bag.Values; } } public StateItem Add(string key, object value) { if (key == null || key.Length == 0) throw new ArgumentException ("[Add] Key_Cannot_Be_Null"); StateItem val = (StateItem)bag[key]; if(val == null) { if(value != null || marked) { val = new StateItem(value); bag.Add (key, val); } } else if(value == null && !marked) { bag.Remove (key); } else { val.Value = value; } if(val != null && marked) { val.IsDirty = true; } return val; } public void Clear() { bag.Clear(); } public IDictionaryEnumerator GetEnumerator() { return bag.GetEnumerator(); } public bool IsItemDirty(string key) { object o = bag[key]; if (o is StateItem) return ((StateItem) o).IsDirty; return false; } public void Remove(string key) { bag.Remove(key); } /// <summary> /// Undocumented /// </summary> public void SetItemDirty(string key, bool dirty) { if (bag[key] is StateItem) { ((StateItem) bag [key]).IsDirty = dirty; } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { Values.CopyTo(array, index); } bool ICollection.IsSynchronized { get { return false; } } object ICollection.SyncRoot { get { return this; } } void IDictionary.Add(object key, object value) { Add((string) key, value); } void IDictionary.Remove(object key) { Remove((string) key); } bool IDictionary.Contains(object key) { return bag.Contains((string) key); } bool IDictionary.IsFixedSize { get { return false; } } bool IDictionary.IsReadOnly { get { return false; } } } } --- NEW FILE --- /** * Namespace: CSMail * Class: StateItem * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public sealed class StateItem { private object val; private bool isDirty; private StateItem() { } internal StateItem(object value) { this.val = value; } public bool IsDirty { get { return isDirty; } set { isDirty = value; } } public object Value { get { return val; } set { this.val = value; } } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- ChangeLog 13 Sep 2002 04:55:02 -0000 1.38 +++ ChangeLog 13 Sep 2002 05:50:55 -0000 1.39 @@ -1,6 +1,11 @@ 2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StateBag.cs : Added new class. + * StateItem.cs : Added new class. + +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * BodyPart.cs : Wait, why should a BodyPart have a separate item as boundary. Just thought, it's a parameter to ContentType. |
From: Gaurav V. <mas...@us...> - 2002-09-13 04:55:05
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv22499 Modified Files: ChangeLog Log Message: 2002-09-13 * BodyPart.cs : Wait, why should a BodyPart have a separate item as boundary. Just thought, it's a parameter to ContentType. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- ChangeLog 13 Sep 2002 04:52:49 -0000 1.37 +++ ChangeLog 13 Sep 2002 04:55:02 -0000 1.38 @@ -1,6 +1,12 @@ 2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * BodyPart.cs : Wait, why should a BodyPart have a + separate item as boundary. Just thought, + it's a parameter to ContentType. + +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * MimeMultipart.cs : GetBodyPart(int) - Implemented : GetBodyPart(string) - Implemented * BodyPart.cs : Added support for boundary |
From: Gaurav V. <mas...@us...> - 2002-09-13 04:52:52
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv21991 Modified Files: BodyPart.cs BodyPartList.cs ChangeLog MimeMultipart.cs Log Message: 2002-09-13 * MimeMultipart.cs : GetBodyPart(int) - Implemented : GetBodyPart(string) - Implemented * BodyPart.cs : Added support for boundary * BodyPartList.cs : Stubbed new ctors. : Now implements IEnumerable : Stubbed few more methods, properties. Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BodyPart.cs 9 Sep 2002 09:37:54 -0000 1.5 +++ BodyPart.cs 13 Sep 2002 04:52:49 -0000 1.6 @@ -23,11 +23,17 @@ private Multipart parent; /// <summary> + /// Boundary for this part. + /// </summary> + protected string boundary; + + /// <summary> /// Constructor to do some initialization /// </summary> public BodyPart() { - parent = null; + parent = null; + boundary = null; } /// <summary> @@ -58,6 +64,17 @@ set { parent = value; + } + } + + /// <summary> + /// Returns the boundary for this part. + /// </summary> + public string Boundary + { + get + { + return boundary; } } Index: BodyPartList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPartList.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BodyPartList.cs 5 Sep 2002 05:24:21 -0000 1.3 +++ BodyPartList.cs 13 Sep 2002 04:52:49 -0000 1.4 @@ -13,12 +13,13 @@ namespace CSMail { - /// <summary> - /// Container for a list of body parts. - /// </summary> - public class BodyPartList + // <summary> + // Container for a list of body parts. + // </summary> + public class BodyPartList : IEnumerable { private ArrayList parts; + private bool isReadOnly; /// <summary> /// Initializes an instance of the BodyPartList. @@ -26,6 +27,14 @@ public BodyPartList() { parts = new ArrayList(); + isReadOnly = false; + } + + [MailTODO] + public BodyPartList(BodyPart[] parts, bool isReadOnly) + { + this.isReadOnly = isReadOnly; + throw new NotImplementedException(); } /// <summary> @@ -55,21 +64,56 @@ [MailTODO] public BodyPartList(BodyPartList parts) { + this.isReadOnly = parts.IsReadOnly; throw new NotImplementedException(); } + [MailTODO] + public BodyPart this[int index] + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + [MailTODO] + public BodyPart this[string contentID] + { + get + { + throw new NotImplementedException(); + } + } + + public bool IsReadOnly + { + get + { + return isReadOnly; + } + } + /// <summary> /// Returns the number of parts in the list. /// </summary> - [MailTODO] public int Count { get { - throw new NotImplementedException(); + return parts.Count; } } - + + public IEnumerator GetEnumerator() + { + return parts.GetEnumerator(); + } + /** * Have to allow only Add(BodyPart body) etc. * No Add(object generic) sort of thing. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- ChangeLog 12 Sep 2002 07:13:25 -0000 1.36 +++ ChangeLog 13 Sep 2002 04:52:49 -0000 1.37 @@ -1,4 +1,13 @@ +2002-09-13 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * MimeMultipart.cs : GetBodyPart(int) - Implemented + : GetBodyPart(string) - Implemented + * BodyPart.cs : Added support for boundary + * BodyPartList.cs : Stubbed new ctors. + : Now implements IEnumerable + : Stubbed few more methods, properties. + 2002-09-12 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * ContentType.cs : SubType - Writable Index: MimeMultipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeMultipart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MimeMultipart.cs 12 Sep 2002 07:13:25 -0000 1.2 +++ MimeMultipart.cs 13 Sep 2002 04:52:49 -0000 1.3 @@ -40,16 +40,16 @@ } } - [MailTODO] public BodyPart GetBodyPart(int index) { - throw new NotImplementedException(); + if(index < 0 || index > BodyParts.Count) + throw new IndexOutOfRangeException("[GetBodyPart] Index value is beyong limits"); + return BodyParts[index]; } - [MailTODO] public BodyPart GetBodyPart(string contentID) { - throw new NotImplementedException(); + return BodyParts[contentID]; } /// <summary> |
From: Gaurav V. <mas...@us...> - 2002-09-12 07:13:29
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv3731/csmail/src/CSMail Modified Files: ChangeLog ContentType.cs MimeMultipart.cs Multipart.cs Log Message: 2002-09-12 * ContentType.cs : SubType - Writable : PrimaryType - Writable * Multipart.cs : bodyParts - Protected : ParseBodyParts() - Added * MimeMultipart.cs : ctor()'s - Implemented : SubType {get; set;} - Implemented Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- ChangeLog 10 Sep 2002 10:43:37 -0000 1.35 +++ ChangeLog 12 Sep 2002 07:13:25 -0000 1.36 @@ -1,4 +1,13 @@ +2002-09-12 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * ContentType.cs : SubType - Writable + : PrimaryType - Writable + * Multipart.cs : bodyParts - Protected + : ParseBodyParts() - Added + * MimeMultipart.cs : ctor()'s - Implemented + : SubType {get; set;} - Implemented + 2002-09-10 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Service.cs : Close() - Implemented Index: ContentType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ContentType.cs 5 Sep 2002 05:17:49 -0000 1.2 +++ ContentType.cs 12 Sep 2002 07:13:25 -0000 1.3 @@ -61,6 +61,10 @@ return primaryType; return String.Empty; } + set + { + primaryType = value; + } } /// <summary> @@ -76,6 +80,10 @@ if(subType != null) return subType; return String.Empty; + } + set + { + subType = value; } } Index: MimeMultipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeMultipart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MimeMultipart.cs 9 Sep 2002 09:37:54 -0000 1.1 +++ MimeMultipart.cs 12 Sep 2002 07:13:25 -0000 1.2 @@ -15,48 +15,58 @@ { public class MimeMultipart : Multipart { - [MailTODO] - public MimeMultipart() + protected bool isParsed; + + public MimeMultipart(): this("mixed") { - throw new NotImplementedException(); } - [MailTODO] public MimeMultipart(string subPart) { - throw new NotImplementedException(); + isParsed = true; + CType = new ContentType("multipart", subPart); + // Have to set a new Boundary Value; } - [MailTODO] public string SubType { get { - throw new NotImplementedException(); + return CType.SubType; } set { - throw new NotImplementedException(); + CType.SubType = value; } } [MailTODO] - public int Count + public BodyPart GetBodyPart(int index) { - get - { - throw new NotImplementedException(); - } + throw new NotImplementedException(); } [MailTODO] - public BodyPart GetBodyPart(int index) + public BodyPart GetBodyPart(string contentID) { throw new NotImplementedException(); } + /// <summary> + /// See remarks + /// </summary> + /// <remarks> + /// I have to get raw data (stream) from somewhere. + /// Not this makes me think over the issue of + /// a DataSource. Do I need it now? + /// But that will mean looking into the + /// whole of Activation framework and understanding it. + /// Now, how does Java-Mail get the DataSource + /// when <c>default constructor</c> or + /// <c>ctor(string)</c> is called? + /// </remarks> [MailTODO] - public BodyPart GetBodyPart(string contentID) + protected override void ParseBodyParts() { throw new NotImplementedException(); } Index: Multipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Multipart.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Multipart.cs 6 Sep 2002 11:52:29 -0000 1.3 +++ Multipart.cs 12 Sep 2002 07:13:25 -0000 1.4 @@ -30,7 +30,11 @@ public abstract class Multipart { private IPart parent; - private BodyPartList bodyParts; + + /// <summary> + /// Encapsulates all the parts of this multipart. + /// </summary> + protected BodyPartList bodyParts; /// <summary> /// The associated content type. @@ -80,6 +84,7 @@ { get { + ParseBodyParts(); return bodyParts; } } @@ -89,5 +94,14 @@ /// </summary> /// <param name="writer">The stream to write to.</param> public abstract void WriteTo(StreamWriter writer); + + /// <summary> + /// Parse the raw data to generate bodyparts. + /// </summary> + /// <remarks> + /// I have to get some stream from somewhere. + /// But from where and how? + /// </remarks> + protected abstract void ParseBodyParts(); } } |
From: Gaurav V. <mas...@us...> - 2002-09-10 10:43:41
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv19506 Modified Files: ChangeLog Service.cs Session.cs Log Message: 2002-09-10 * Service.cs : Close() - Implemented : OnConnection(...) - Removed TODO. * Session.cs : GetServiceInstance(...) - Started off? Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- ChangeLog 9 Sep 2002 11:07:22 -0000 1.34 +++ ChangeLog 10 Sep 2002 10:43:37 -0000 1.35 @@ -1,4 +1,11 @@ +2002-09-10 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Service.cs : Close() - Implemented + : OnConnection(...) - Removed TODO. + * Session.cs : GetServiceInstance(...) + - Started off? + 2002-09-09 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * MimeMessage.cs : Stubbed new class. Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Service.cs 6 Sep 2002 11:52:29 -0000 1.6 +++ Service.cs 10 Sep 2002 10:43:37 -0000 1.7 @@ -97,10 +97,10 @@ /// <summary> /// Closes an open connection. /// </summary> - [MailTODO] public virtual void Close() { - throw new NotImplementedException(); + this.connected = false; + OnConnection(new ConnectionEventArgs(ConnectionEventType.Closed)); } /// <summary> @@ -216,13 +216,11 @@ /// Raises the <see cref="Connection"/> event. /// </summary> /// <param name="e">The required arguments to raise the event.</param> - [MailTODO] public void OnConnection(ConnectionEventArgs e) { ConnectionEventHandler ceh = (ConnectionEventHandler)Events[ConnectionEvent]; if(ceh != null) ceh(this, e); - throw new NotImplementedException(); } } } Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Session.cs 3 Sep 2002 12:49:49 -0000 1.15 +++ Session.cs 10 Sep 2002 10:43:37 -0000 1.16 @@ -12,6 +12,7 @@ using System.Collections; using System.IO; using CSMail.Utils; +using System.Reflection; namespace CSMail { @@ -114,7 +115,6 @@ [MailTODO] private object GetServiceInstance(URLName url, Provider provider) { - throw new NotImplementedException(); /** * First, try to load using "Assembly.Load", * and if you are unable to do so (during testing) @@ -123,6 +123,8 @@ * as that of value of "Provider.ClassName" * If even that fails, then throw an exception */ + Assembly toLoad = Assembly.Load(provider.AssemblyName); + throw new NotImplementedException(); } private Session(Properties properties, Authenticator authenticator) |
From: Gaurav V. <mas...@us...> - 2002-09-10 04:48:55
|
Update of /cvsroot/csmail/csmail In directory usw-pr-cvs1:/tmp/cvs-serv17509 Modified Files: ChangeLog Added Files: Release-Notes Log Message: 2002-09-10 * Release-Notes : Added file --- NEW FILE --- Release Notes Version 1.0-pre-alpha --------------------- * A total of 68 objects being compiled. * Major work in Service (Store and Transport), Folder, Message done. * Mime support underway. MimeBodyPart, MimeMultipart, MimeMessage stubbed. * Header/List, IAddress/List and its implementers done. * All major delegates done. **WARNING** - All code is without any test. Use them at your own risk. - Several methods will throw "NotImplementedException". Contributors to this release: - Idea and API Development: => Gaurav Vaish => Ajay Dwivedi => Jeffery Stedfast - Coding stuff: => Gaurav Vaish Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ChangeLog 4 Sep 2002 07:30:47 -0000 1.6 +++ ChangeLog 10 Sep 2002 04:48:52 -0000 1.7 @@ -1,4 +1,8 @@ +2002-09-10 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Release-Notes: Added file. + 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * tools : Added directory. |
From: Gaurav V. <mas...@us...> - 2002-09-10 04:27:26
|
Update of /cvsroot/csmail/csmail/src In directory usw-pr-cvs1:/tmp/cvs-serv13216 Modified Files: CSMail.build Log Message: 2002-09-10 * makefile: New way to make doc. * CSMail.build: Added target msgs. Refined targets "build" and "clean" Index: CSMail.build =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.build,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CSMail.build 4 Sep 2002 06:31:14 -0000 1.3 +++ CSMail.build 10 Sep 2002 04:27:24 -0000 1.4 @@ -4,9 +4,18 @@ <project name="CSMail" default="build"> <property name="debug" value="false"/> + <property name="version" value="1.0-pre-alpha"/> + <property name="website" value="http://csmail.sourceforge.net"/> + + <target name="msgs"> + <echo message="${performing} CSMail library..."/> + <echo message=" Version: ${version}"/> + <echo message=" Website: ${website}"/> + </target> <target name="build"> - <echo message="Building the CSMail library..."/> + <property name="performing" value="Building"/> + <call target="msgs"/> <mkdir dir="../lib"/> <csc target="library" output="../lib/CSMail.dll" debug="${debug}"> <sources> @@ -17,7 +26,8 @@ </target> <target name="clean"> - <echo message="Cleaning the CSMail library..."/> + <property name="performing" value="Cleaning"/> + <call target="msgs"/> <delete file="../lib/CSMail.dll" failonerror="false"/> <delete dir="../lib" failonerror="false"/> </target> |
From: Gaurav V. <mas...@us...> - 2002-09-09 11:07:25
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv23986 Modified Files: ChangeLog Message.cs Added Files: MimeMessage.cs Log Message: 2002-09-09 * MimeMessage.cs : Stubbed new class. * Message.cs : Modified API. Removed AddHeader(s) etc. --- NEW FILE --- /** * Namespace: CSMail * Class: MimeMessage * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; using System.IO; namespace CSMail { public class MimeMessage : Message, IMimePart, IPart { [MailTODO] public MimeMessage() { throw new NotImplementedException(); } public override Multipart Content { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override ContentType ContentType { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override MessageFlags Flags { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override EMailAddressList From { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override DateTime ReceivedDate { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override IAddressList Recipients { get { throw new NotImplementedException(); } } public override DateTime SentDate { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override string Subject { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override string Description { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override ContentDisposition Disposition { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override string Filename { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override int Size { get { throw new NotImplementedException(); } } public override HeaderList Headers { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public string ContentID { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public string ContentLanguage { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public string ContentMD5 { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public string Text { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public TransferEncoding TransferEncoding { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public override void AddRecipient(RecipientType type, EMailAddress email) { throw new NotImplementedException(); } public override void AddRecipients(RecipientType type, EMailAddressList emails) { throw new NotImplementedException(); } public override void AddRecipient(NewsAddress address) { throw new NotImplementedException(); } public override void AddRecipients(NewsAddressList address) { throw new NotImplementedException(); } public override Message GetReplyMessage(bool toAll) { throw new NotImplementedException(); } public override IAddressList GetRecipients(RecipientType type) { throw new NotImplementedException(); } public override void SaveChanges() { throw new NotImplementedException(); } public override void Write(TextWriter writer) { throw new NotImplementedException(); } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- ChangeLog 9 Sep 2002 09:37:54 -0000 1.33 +++ ChangeLog 9 Sep 2002 11:07:22 -0000 1.34 @@ -1,6 +1,10 @@ 2002-09-09 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * MimeMessage.cs : Stubbed new class. + +2002-09-09 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * MimeBodyPart.cs : Stubbed new class. * MimeMultipart.cs : Stubbed new class. * BodyPart.cs : Size { get; set; } - Removed { set; } Index: Message.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Message.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Message.cs 6 Sep 2002 11:52:29 -0000 1.7 +++ Message.cs 9 Sep 2002 11:07:22 -0000 1.8 @@ -58,12 +58,12 @@ public abstract DateTime SentDate { get; set; } public abstract string Subject { get; set; } - public abstract void AddFrom(EMailAddress address); - public abstract void AddFrom(EMailAddressList address); + //public abstract void AddFrom(EMailAddress address); + //public abstract void AddFrom(EMailAddressList address); public abstract void AddRecipient(RecipientType type, EMailAddress email); public abstract void AddRecipients(RecipientType type, EMailAddressList emails); - public abstract void AddRecipient(NewsAddress email); - public abstract void AddRecipients(NewsAddressList email); + public abstract void AddRecipient(NewsAddress address); + public abstract void AddRecipients(NewsAddressList address); public abstract Message GetReplyMessage(bool toAll); public abstract IAddressList GetRecipients(RecipientType type); public abstract void SaveChanges(); @@ -74,10 +74,10 @@ public abstract ContentDisposition Disposition { get; set; } public abstract string Filename { get; set; } public abstract HeaderList Headers { get; set; } - public abstract int Size { get; set; } + public abstract int Size { get; } - public abstract int AddHeader(Header header); - public abstract int AddHeaders(HeaderList headers); + //public abstract int AddHeader(Header header); + //public abstract int AddHeaders(HeaderList headers); public abstract void Write(TextWriter writer); public virtual Folder Folder |
From: Gaurav V. <mas...@us...> - 2002-09-09 09:37:57
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv16680 Modified Files: BodyPart.cs ChangeLog IPart.cs Added Files: MimeBodyPart.cs MimeMultipart.cs Log Message: 2002-09-09 * MimeBodyPart.cs : Stubbed new class. * MimeMultipart.cs : Stubbed new class. * BodyPart.cs : Size { get; set; } - Removed { set; } * IPart.cs : Size { get; set; } - Removed { set; } : AddHeader(Header) : AddHeaders(HeaderList) - Removed. --- NEW FILE --- /** * Namespace: CSMail * Class: MimeBodyPart * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; using System.IO; namespace CSMail { public class MimeBodyPart : BodyPart, IMimePart { protected HeaderList headers; protected byte[] content; public MimeBodyPart() { headers = new HeaderList(); } [MailTODO] public MimeBodyPart(StreamReader reader) { throw new NotImplementedException(); } public MimeBodyPart(HeaderList headers, byte[] content) { this.headers = headers; this.content = content; } [MailTODO] public override int Size { get { throw new NotImplementedException(); } } [MailTODO] public override HeaderList Headers { get { return this.headers; } set { this.headers = value; } } [MailTODO] public override Multipart Content { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public override ContentType ContentType { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public override string Description { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public override ContentDisposition Disposition { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public override string Filename { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public string ContentID { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public string ContentLanguage { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public string ContentMD5 { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public string Text { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public TransferEncoding TransferEncoding { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public override void Write(TextWriter writer) { throw new NotImplementedException(); } } } --- NEW FILE --- /** * Namespace: CSMail * Class: MimeMultipart * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; using System.IO; namespace CSMail { public class MimeMultipart : Multipart { [MailTODO] public MimeMultipart() { throw new NotImplementedException(); } [MailTODO] public MimeMultipart(string subPart) { throw new NotImplementedException(); } [MailTODO] public string SubType { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } [MailTODO] public int Count { get { throw new NotImplementedException(); } } [MailTODO] public BodyPart GetBodyPart(int index) { throw new NotImplementedException(); } [MailTODO] public BodyPart GetBodyPart(string contentID) { throw new NotImplementedException(); } [MailTODO] protected void UpdateHeaders() { throw new NotImplementedException(); } [MailTODO] public override void WriteTo(StreamWriter writer) { throw new NotImplementedException(); } [MailTODO] protected MimeBodyPart CreateMimeBodyPart(StreamReader reader) { throw new NotImplementedException(); } [MailTODO] protected MimeBodyPart CreateMimeBodyPart(HeaderList headers, byte[] content) { throw new NotImplementedException(); } [MailTODO] protected MimeBodyPart CreateHeaders(StreamReader reader) { throw new NotImplementedException(); } [MailTODO] protected void Parse() { throw new NotImplementedException(); } } } Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BodyPart.cs 5 Sep 2002 05:24:21 -0000 1.4 +++ BodyPart.cs 9 Sep 2002 09:37:54 -0000 1.5 @@ -91,10 +91,11 @@ /// </summary> public abstract HeaderList Headers { get; set; } /// <summary> - /// When implemented by a class, gets or sets the size. + /// When implemented by a class, gets the siz of content. /// </summary> - public abstract int Size { get; set; } + public abstract int Size { get; } +/** /// <summary> /// When implemented by a class, adds an header for this part. /// </summary> @@ -103,6 +104,7 @@ /// When implemented by a class, adds headers for this part. /// </summary> public abstract int AddHeaders(HeaderList headers); +*/ /// <summary> /// When implemented by a class, writes the content to the writer. /// </summary> Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- ChangeLog 6 Sep 2002 11:52:29 -0000 1.32 +++ ChangeLog 9 Sep 2002 09:37:54 -0000 1.33 @@ -1,4 +1,14 @@ +2002-09-09 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * MimeBodyPart.cs : Stubbed new class. + * MimeMultipart.cs : Stubbed new class. + * BodyPart.cs : Size { get; set; } - Removed { set; } + * IPart.cs : Size { get; set; } - Removed { set; } + : AddHeader(Header) + : AddHeaders(HeaderList) + - Removed. + 2002-09-06 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Message.cs : IsSet(MessageFlags) Index: IPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IPart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- IPart.cs 5 Sep 2002 05:17:49 -0000 1.2 +++ IPart.cs 9 Sep 2002 09:37:54 -0000 1.3 @@ -43,10 +43,11 @@ /// </summary> HeaderList Headers { get; set; } /// <summary> - /// When implemented, gets or sets the size of the part. + /// When implemented, gets the size of the part. /// </summary> - int Size { get; set; } + int Size { get; } +/** /// <summary> /// When implemented, adds a header to the part. /// </summary> @@ -55,6 +56,7 @@ /// When implemented, adds headers to the part. /// </summary> int AddHeaders(HeaderList headers); +*/ /// <summary> /// When implemented, writes the content. /// </summary> |
From: Gaurav V. <mas...@us...> - 2002-09-09 06:24:38
|
Update of /cvsroot/csmail/csmail In directory usw-pr-cvs1:/tmp/cvs-serv3458 Modified Files: .cvsignore Log Message: 2002-09-09 * .cvsignore: Ignores ndoc. Index: .cvsignore =================================================================== RCS file: /cvsroot/csmail/csmail/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 20 Jun 2002 02:26:18 -0000 1.1 +++ .cvsignore 9 Sep 2002 06:24:35 -0000 1.2 @@ -1,3 +1,4 @@ +ndoc lib *~ .*.swp |
From: Gaurav V. <mas...@us...> - 2002-09-09 06:24:01
|
Update of /cvsroot/csmail/csmail/src/CSMail.Utils In directory usw-pr-cvs1:/tmp/cvs-serv3091/src/CSMail.Utils Modified Files: Properties.cs Log Message: 2002-09-09 * src/makfile: Making "doc" in new style. * src/CSMail.Utils/Properties.cs: Partial documentation. Index: Properties.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.Utils/Properties.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Properties.cs 30 Aug 2002 10:32:41 -0000 1.5 +++ Properties.cs 9 Sep 2002 06:23:58 -0000 1.6 @@ -16,8 +16,10 @@ namespace CSMail.Utils { /// <summary> + /// <code> /// key = value /// key : value + /// </code> /// </summary> public class Properties : Hashtable { |
From: Gaurav V. <mas...@us...> - 2002-09-09 06:24:00
|
Update of /cvsroot/csmail/csmail/src In directory usw-pr-cvs1:/tmp/cvs-serv3091/src Modified Files: makefile Log Message: 2002-09-09 * src/makfile: Making "doc" in new style. * src/CSMail.Utils/Properties.cs: Partial documentation. Index: makefile =================================================================== RCS file: /cvsroot/csmail/csmail/src/makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- makefile 4 Sep 2002 06:31:14 -0000 1.4 +++ makefile 9 Sep 2002 06:23:58 -0000 1.5 @@ -4,6 +4,8 @@ CSC = csc.exe /nologo NOWARN = /nowarn:1591 TLIB = /target:library +DOC = /doc:../lib/CSMail.xml +OUT = /out:../lib/CSMail.dll all: lib @@ -15,7 +17,8 @@ @$(NANT) -buildfile:$(BUILD_FILE) build doc: - $(CSC) $(NOWARN) $(TLIB) /out:../lib/CSMail.dll /doc:../lib/CSMail.xml CSMail\\*.cs CSMail.Utils\\*.cs + $(CSC) $(NOWARN) $(TLIB) $(OUT) $(DOC) CSMail\\*.cs CSMail.Utils\\*.cs + # @$(NANT) -buildfile:$(BUILD_FILE) doc |
From: Gaurav V. <mas...@us...> - 2002-09-09 06:23:04
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv2841 Modified Files: ConnectionEventHandler.cs FolderEventArgs.cs FolderEventHandler.cs IllegalStateException.cs InternetAddress.cs InternetAddressList.cs MessageDeliveredEventArgs.cs MessageRemovedException.cs StoreMessageEventHandler.cs Log Message: 2002-09-09 * *.cs -- Documentation, documentation, documentation! Index: ConnectionEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ConnectionEventHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConnectionEventHandler.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ConnectionEventHandler.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -10,5 +10,12 @@ namespace CSMail { + /// <summary> + /// Represents the method that will handle + /// <c>Service.Connection</c> event of a <c>Service</c>. + /// </summary> + /// <seealso cref="ConnectionEventArgs"/> + /// <seealso cref="ConnectionEventType"/> + /// <seealso cref="Service"/> public delegate void ConnectionEventHandler(object sender, ConnectionEventArgs e); -} \ No newline at end of file +} Index: FolderEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderEventArgs.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FolderEventArgs.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ FolderEventArgs.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -12,12 +12,32 @@ namespace CSMail { + /// <summary> + /// Arguments for a folder event. + /// </summary> + /// <seealso cref="FolderEventHandler"/> + /// <seealso cref="FolderEventType"/> public class FolderEventArgs { private FolderEventType eventType; private Folder folder; private Folder newFolder; + /// <summary> + /// Initiates the instance of the object with given event type. + /// </summary> + /// <exception cref="ArgumentException">If the + /// <c>eventType</c> is <c>FolderType.Renamed</c> + /// or is not from a value defined in + /// <see>FolderEventType</see>. + /// </exception> + /// <remarks> + /// Use this contructor when a folder event occurs, except for + /// when a folder is renamed. + /// </remarks> + /// <param name="folder">Folder on which the event has + /// occured.</param> + /// <param name="eventType">The type of event occured.</param> public FolderEventArgs(Folder folder, FolderEventType eventType) { if(eventType == FolderEventType.Renamed || !Enum.IsDefined(typeof(FolderEventType), eventType)) @@ -28,6 +48,14 @@ this.folder = folder; } + /// <summary> + /// Initiates the instance with event type as folder renaming. + /// </summary> + /// <remarks> + /// Use this contstructor when the folder has been named. + /// </remarks> + /// <param name="folder">The folder before renaming.</param> + /// <param name="newFolder">The folder after renaming.</param> public FolderEventArgs(Folder folder, Folder newFolder) { this.folder = folder; @@ -35,6 +63,9 @@ eventType = FolderEventType.Renamed; } + /// <summary> + /// Returns the type of the event occured. + /// </summary> public FolderEventType EventType { get @@ -43,6 +74,12 @@ } } + /// <summary> + /// Returns the associated folder. + /// </summary> + /// <remarks> + /// Returns the old folder during folder renaming. + /// </remarks> public Folder Folder { get @@ -51,6 +88,13 @@ } } + /// <summary> + /// Returns the new folder associated. + /// </summary> + /// <remarks> + /// Returns a <c>null</c> if the even type is not + /// <c>FolderEventType.Renamed</c> . + /// </remarks> public Folder NewFolder { get Index: FolderEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderEventHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FolderEventHandler.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ FolderEventHandler.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -10,5 +10,12 @@ namespace CSMail { + /// <summary> + /// Represents the method that will handle + /// <c>Store.Folder</c> event of a <c>Store</c>. + /// </summary> + /// <seealso cref="FolderEventArgs"/> + /// <seealso cref="FolderEventType"/> + /// <seealso cref="Store"/> public delegate void FolderEventHandler(object sender, FolderEventArgs e); -} \ No newline at end of file +} Index: IllegalStateException.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IllegalStateException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IllegalStateException.cs 28 Aug 2002 10:17:12 -0000 1.1 +++ IllegalStateException.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -12,12 +12,27 @@ namespace CSMail { + /// <summary> + /// Execption thrown while accessing a <see>Folder</see> + /// in a wrong mode. + /// </summary> + /// <example> + /// An exception is thrown while trying to retrieve the + /// <see>FolderOpenMode</see> of a closed <c>Folder</c>. + /// </example> public class IllegalStateException : Exception { + /// <summary> + /// Default constructor. With no message. + /// </summary> public IllegalStateException() : base() { } + /// <summary> + /// Contructor with descriptive message, giving reasons + /// for why the exception was thrown. + /// </summary> public IllegalStateException(string message) : base(message) { } Index: InternetAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/InternetAddress.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- InternetAddress.cs 3 Sep 2002 12:38:45 -0000 1.5 +++ InternetAddress.cs 9 Sep 2002 06:23:01 -0000 1.6 @@ -18,13 +18,31 @@ namespace CSMail { - public class InternetAddress + /// <summary> + /// Class to represent a URL. + /// </summary> + /// <remarks> + /// It is supposed to understand a URL of the type + /// <code> + /// prot://[user[:pass]@]hostname[:port]/filepath[#ref] + /// </code> + /// but it currently understands only + /// <code> + /// prot://hostname + /// </code> + /// </remarks> + public class InternetAddress : IAddress { private string hostname; private string protocol; private int[] ip; private bool isIP; + /// <summary> + /// Initialization with a hostname and specified protocol. + /// </summary> + /// <param name="hostname">The hostname.</param> + /// <param name="protocol">The protocol.</param> public InternetAddress(string hostname, string protocol) { hostname = hostname.Trim(); @@ -36,6 +54,10 @@ } } + /// <summary> + /// Initialization with a URI string. + /// </summary> + /// <param name="fullURI">Complete URI to parse.</param> [MailTODO] public InternetAddress(string fullURI) { @@ -43,10 +65,14 @@ } /// <summary> - /// Currently only IP_V4 formats are supported. To support - /// the IP_V6 format IPs, I have to first go through the - /// documentations. + /// Initialization with a given IP address and the specified + /// protocol. /// </summary> + /// <remarks> + /// Currently only IP_V4 formats are supported. + /// To support the IP_V6 format IPs, I have to first + /// go through the documentations. + /// </remarks> public InternetAddress(int[] ip, string protocol) { if(!ValidIP4(ip)) @@ -64,6 +90,9 @@ this.isIP = true; } + /// <summary> + /// Returns the hostname. + /// </summary> public string Hostname { get @@ -72,6 +101,14 @@ } } + /// <summary> + /// Checks if the provided <see>Hostname</see> + /// is a valid IP address or not. + /// </summary> + /// <remarks> + /// It does not check for the existence of + /// such an IP, but only for its validity. + /// </remarks> public bool IsIP { get @@ -79,7 +116,22 @@ return isIP; } } - + + /// <summary> + /// Returns the address type, which is + /// <c>AddressType.InternetAddress</c> + /// </summary> + public AddressType AddressType + { + get + { + return AddressType.InternetAddress; + } + } + + /// <summary> + /// Returns the associated protocol. + /// </summary> public string Protocol { get @@ -88,6 +140,13 @@ } } + /// <summary> + /// Returns the IP. + /// </summary> + /// <remarks> + /// Returns <c>null</c> is the hostname does not + /// represent a valid IP address. + /// </remarks> public int[] getIP { get @@ -137,7 +196,45 @@ } return true; } - + + /// <summary> + /// Checks for equality with another address. + /// </summary> + /// <param name="address">Address to compare to.</param> + /// <returns><c>true</c> if the two represent same URI, + /// <c>false</c> otherwise. + /// </returns> + bool IAddress.Equals(IAddress address) + { + if(address is InternetAddress) + { + return Equals((InternetAddress)address); + } + return false; + } + + /// <summary> + /// Checks for equality with another address. + /// </summary> + /// <param name="address">Address to compare to.</param> + /// <returns><c>true</c> if the two represent same URI, + /// <c>false</c> otherwise. + /// </returns> + [MailTODO] + public bool Equals(InternetAddress address) + { + throw new NotImplementedException(); + } + + /// <summary> + /// Returns string repesentation of the URI. + /// </summary> + /// <remarks> + /// The returned value is of the form: + /// <code> + /// protocol://[user[:pass]@]host[:port]/file[#ref] + /// </code> + /// </remarks> public override string ToString() { string retVal; Index: InternetAddressList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/InternetAddressList.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InternetAddressList.cs 4 Sep 2002 06:35:42 -0000 1.4 +++ InternetAddressList.cs 9 Sep 2002 06:23:01 -0000 1.5 @@ -14,14 +14,25 @@ namespace CSMail { + /// <summary> + /// Represents a collection of InternetAddress-es. + /// </summary> + /// <seealso cref="InternetAddress"/> public class InternetAddressList : IAddressList, IEnumerable { private ArrayList addresses = new ArrayList(); + /// <summary> + /// Creates an empty list. + /// </summary> public InternetAddressList() { } + /// <summary> + /// Creates a list with given initial address list. + /// </summary> + /// <param name="addresses">Initial list of addresses.</param> public InternetAddressList(InternetAddress[] addresses) { if(addresses != null) @@ -36,6 +47,10 @@ } } + /// <summary> + /// Creates a list with given initial address list. + /// </summary> + /// <param name="addresses">Initial list of addresses.</param> public InternetAddressList(InternetAddressList addresses) { if(addresses != null) @@ -47,6 +62,9 @@ } } + /// <summary> + /// Returns the number of addresses in the list. + /// </summary> public int Count { get @@ -55,6 +73,14 @@ } } + /// <summary> + /// Returns an address at a specified index. + /// </summary> + /// <param name="index">The index at which the value + /// is to be retrieved.</param> + /// <remarks> + /// Returns null is <c>index < 0 || index >= Count</c> + /// </remarks> public InternetAddress this[int index] { get @@ -65,11 +91,23 @@ } } + /// <summary> + /// Adds an address to the list. + /// </summary> + /// <param name="address">Address to be added.</param> + /// <returns>The number of address in the list after + /// adding new address.</returns> public int Add(InternetAddress address) { return addresses.Add(address); } + /// <summary> + /// Adds a set of addresss to the list. + /// </summary> + /// <param name="address">Addresses to be added.</param> + /// <returns>The number of address in the list after + /// adding new addresses.</returns> public int Add(InternetAddressList address) { foreach(InternetAddress current in address) @@ -82,16 +120,33 @@ return addresses.Count; } + /// <summary> + /// Adds an address at the specified index. + /// </summary> + /// <param name="index">Index at which new address is + /// to be inserted.</param> + /// <param name="address">The address to be inserted.</param> public void AddAt(int index, InternetAddress address) { addresses.Insert(index, address); } + /// <summary> + /// Returns an address at the given index. + /// </summary> + /// <param name="index">Index under consideration.</param> + /// <returns>Address at the given index.</returns> public InternetAddress GetAddress(int index) { - return (InternetAddress)addresses[index]; + return this[index]; } + /// <summary> + /// Adds an address to the list. + /// </summary> + /// <param name="address">Address to be added.</param> + /// <returns>The number of address in the list after + /// adding new address.</returns> int IAddressList.Add(IAddress address) { if(address is InternetAddress) @@ -101,38 +156,76 @@ return addresses.Count; } + /// <summary> + /// Adds an address at the specified index. + /// </summary> + /// <param name="index">Index at which new address is + /// to be inserted.</param> + /// <param name="address">The address to be inserted.</param> void IAddressList.AddAt(int index, IAddress address) { if(address is InternetAddress) AddAt(index, (InternetAddress)address); } + /// <summary> + /// Returns an address at the given index. + /// </summary> + /// <param name="index">Index under consideration.</param> + /// <returns>Address at the given index.</returns> IAddress IAddressList.GetAddress(int index) { return (IAddress)GetAddress(index); } + /// <summary> + /// Removes an address from the list. + /// </summary> + /// <param name="address">Address to be removed.</param> void IAddressList.Remove(IAddress address) { if(address is InternetAddress) Remove((InternetAddress)address); } + /// <summary> + /// Removes an address from the list. + /// </summary> + /// <param name="address">Address to be removed.</param> public void Remove(InternetAddress address) { addresses.Remove(address); } + /// <summary> + /// Clears the list. + /// </summary> public void Clear() { addresses.Clear(); } + /// <summary> + /// Returns the index of the address in the list. + /// </summary> + /// <param name="address">The address under consideration.</param> + /// <returns>The index (zero based) of the address, + /// -1 if not found.</returns> public int IndexOf(InternetAddress address) { return addresses.IndexOf(address); } + /// <summary> + /// Search for a URI by its string representation. + /// </summary> + /// <param name="address">The address under consideration.</param> + /// <param name="ignoreCase">Whether to ignore case during + /// comparision or not.</param> + /// <returns> + /// The index at which the URI exists in the list, + /// -1 if not found. + /// </returns> public int FindByValue(string address, bool ignoreCase) { int i; @@ -151,6 +244,8 @@ return -1; } + /// <summary> + /// </summary> public void RemoveAt(int index) { if(index >= 0 && index < Count) @@ -159,11 +254,15 @@ } } + /// <summary> + /// </summary> public void RemoveFirst(string address, bool ignoreCase) { RemoveAt(FindByValue(address, ignoreCase)); } + /// <summary> + /// </summary> public void Remove(string[] addresses, bool ignoreCase) { ArrayList delete = new ArrayList(); @@ -189,6 +288,8 @@ } } + /// <summary> + /// </summary> public IEnumerator GetEnumerator() { return addresses.GetEnumerator(); Index: MessageDeliveredEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageDeliveredEventArgs.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageDeliveredEventArgs.cs 3 Sep 2002 04:17:00 -0000 1.1 +++ MessageDeliveredEventArgs.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -10,6 +10,14 @@ namespace CSMail { + /// <summary> + /// Represents the method that will handle + /// <c>Transport.MessageDelivered</c> event of a + /// <c>Transport</c>. + /// </summary> + /// <seealso cref="MessageDeliveredEventHandler"/> + /// <seealso cref="MessageDeliveryStatus"/> + /// <seealso cref="Transport"/> public class MessageDeliveredEventArgs { private MessageDeliveryStatus status; @@ -19,6 +27,27 @@ private IAddressList validUnsent; private IAddressList invalid; + /// <summary> + /// Initiates the object with specified values. + /// </summary> + /// <param name="transport">Associated transport.</param> + /// <param name="status">The delivery status.</param> + /// <param name="msg">The associated message.</param> + /// <param name="validSent">List of valid addresses to + /// which the message has been delivered.</param> + /// <param name="validUnsent">List of valid addresses to + /// which the message has not been sent, if any.</param> + /// <param name="invalid">List of invalid addresses, + /// if any.</param> + /// <remarks> + /// Should <c>Transport</c> be an argument in the constructor, + /// or should it be the <c>sender</c> in + /// <see>MessageDeliveredEventHandler</see>? + /// </remarks> + /// <seealso cref="MessageDeliveredEventHandler"/> + /// <seealso cref="MessageDeliveryStatus"/> + /// <seealso cref="Message"/> + /// <seealso cref="IAddressList"/> public MessageDeliveredEventArgs(Transport transport, MessageDeliveryStatus status, Message msg, @@ -34,6 +63,9 @@ this.invalid = invalid; } + /// <summary> + /// Returns the delivery status. + /// </summary> public MessageDeliveryStatus DeliveryStatus { get @@ -42,6 +74,9 @@ } } + /// <summary> + /// Returns the associated transport. + /// </summary> public Transport Transport { get @@ -50,7 +85,10 @@ } } - public Message msg + /// <summary> + /// Returns the associated message. + /// </summary> + public Message Message { get { @@ -58,6 +96,10 @@ } } + /// <summary> + /// Returns the list of valid addresses to which + /// the message was delivered. + /// </summary> public IAddressList ValidSent { get @@ -66,6 +108,10 @@ } } + /// <summary> + /// Returns the list of valid addresses to which + /// the message failed to be delivered. + /// </summary> public IAddressList ValidUnsent { get @@ -74,6 +120,9 @@ } } + /// <summary> + /// Returns the list of invalid addresses. + /// </summary> public IAddressList Invalid { get Index: MessageRemovedException.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageRemovedException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageRemovedException.cs 28 Aug 2002 10:17:12 -0000 1.1 +++ MessageRemovedException.cs 9 Sep 2002 06:23:01 -0000 1.2 @@ -12,12 +12,21 @@ namespace CSMail { + /// <summary> + /// Thrown while trying to retrieve an expunged message from a folder. + /// </summary> public class MessageRemovedException : Exception { + /// <summary> + /// Default constructor. + /// </summary> public MessageRemovedException() : base() { } + /// <summary> + /// Contructor with description of the error. + /// </summary> public MessageRemovedException(string message) : base(message) { } Index: StoreMessageEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageEventHandler.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StoreMessageEventHandler.cs 5 Sep 2002 05:24:21 -0000 1.3 +++ StoreMessageEventHandler.cs 9 Sep 2002 06:23:01 -0000 1.4 @@ -11,10 +11,12 @@ namespace CSMail { /// <summary> - /// Delegate to handle all the message-events related to a store. + /// Represents the message that will handle the + /// <c>StoreMessage</c> event of a <c>Store</c>. /// </summary> /// <param name="sender">Sender of the message.</param> /// <param name="e">The arguments associated with the raised event.</param> /// <seealso cref="StoreMessageEventArgs"/> + /// <seealso cref="StoreMessageType"/> public delegate void StoreMessageEventHandler(object sender, StoreMessageEventArgs e); } |
From: Gaurav V. <mas...@us...> - 2002-09-06 11:52:32
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv20543 Modified Files: ChangeLog Folder.cs HeaderList.cs MailEventHandler.cs Message.cs MessagingException.cs Multipart.cs NewsAddress.cs Parameter.cs Provider.cs Service.cs Store.cs TODO Log Message: 2002-09-06 * Message.cs : IsSet(MessageFlags) - Now allows multiple flags to be set. : IsExpunged { get; } - Can only get now. : isExpunged - Changed to protected. * Parameter.cs : ToString - Implemented * Service.cs : OnConnection() - Partial implementation. * HeaderList.cs : Add(Header[]) - Fixed null element bug. : RemoveAt(int) - Fixed index bug. : Clear() - Implemented. * <Rest>.cs : Documentation Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- ChangeLog 6 Sep 2002 09:30:27 -0000 1.31 +++ ChangeLog 6 Sep 2002 11:52:29 -0000 1.32 @@ -1,6 +1,18 @@ 2002-09-06 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Message.cs : IsSet(MessageFlags) + - Now allows multiple flags to be set. + : IsExpunged { get; } - Can only get now. + : isExpunged - Changed to protected. + * Parameter.cs : ToString - Implemented + * Service.cs : OnConnection() - Partial implementation. + * HeaderList.cs : Add(Header[]) - Fixed null element bug. + : RemoveAt(int) - Fixed index bug. + : Clear() - Implemented. + +2002-09-06 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * EMailAddressList.cs : GetAddress(int) - Fixed index bug. : Add(EMailAddress[]) - Fixed null element bug. : ctor(EMailAddress[])- Fixed null element bug. Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Folder.cs 6 Sep 2002 09:30:27 -0000 1.6 +++ Folder.cs 6 Sep 2002 11:52:29 -0000 1.7 @@ -62,13 +62,6 @@ /// messages (with their order defined) held within a folder /// should/do not change unless they are deleted by an explicit /// <see cref="Expunge"/>. - /// <p> - /// On exiting a folder, it is suggested that - /// <see cref="SaveChanges"/> method is called so that any changes are - /// not lost. Preferably, call it in a destructor or if you make your - /// implementation <c>IDisposable</c>, then in the <c>Dispose</c> - /// method. - /// </p> /// </remarks> public abstract class Folder //: IEnumerable { Index: HeaderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/HeaderList.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HeaderList.cs 6 Sep 2002 09:30:27 -0000 1.3 +++ HeaderList.cs 6 Sep 2002 11:52:29 -0000 1.4 @@ -71,6 +71,14 @@ } /// <summary> + /// Empties the list. + /// </summary> + public void Clear() + { + headers.Clear(); + } + + /// <summary> /// Returns the number of headers in the list. /// </summary> public int Count @@ -111,26 +119,54 @@ /// </summary> /// <param name="header">Header to be added.</param> /// <returns>Total number of elements in the list - /// after adding the new header.</returns> + /// after adding the header.</returns> public int Add(Header header) { return headers.Add(header); } + /// <summary> + /// Add a set of headers to the list. + /// </summary> + /// <param name="headers">Headers to be added.</param> + /// <returns>Total number of elements in the list + /// after adding the headers.</returns> public int Add(Header[] headers) { foreach(Header current in headers) { - this.headers.Add(current); + if(current != null) + { + this.headers.Add(current); + } } return this.headers.Count; } + /// <summary> + /// Returns the index of the header in the list. + /// </summary> + /// <param name="header">Header under consideration.</param> + /// <returns>The index (zero based) of the header + /// in the list. -1 if it does not exist.</returns> public int IndexOf(Header header) { return headers.IndexOf(header); } + /// <summary> + /// Search for a header-value with or without ignoring case. + /// </summary> + /// <remarks> + /// The value is matched against as that returned by + /// <b>Header::ToString()</b> + /// </remarks> + /// <param name="fullHeader">Value to look for.</param> + /// <param name="ignoreCase">Whether or not to ignore case.</param> + /// <returns> + /// The index of the header if found, -1 if not found or + /// if <c>fullHeader</c> is null or empty. + /// </returns> public int IndexOf(string fullHeader, bool ignoreCase) { if(fullHeader == null || fullHeader == "") @@ -150,20 +186,45 @@ return -1; } + /// <summary> + /// Removes the header from the list, if found. + /// </summary> + /// <param name="header">Header to be removed.</param> public void Remove(Header header) { headers.Remove(header); } + /// <summary> + /// Removes the header at the given index. + /// </summary> + /// <param name="index">Index at which value is to + /// be removed.</param> + /// <remarks> + /// If index < 0 or if index >= Count, no action + /// is taken. + /// </remarks> public void RemoveAt(int index) { - if(index < 0 || index > headers.Count) + if(index < 0 || index >= headers.Count) { return; } headers.RemoveAt(index); } + /// <summary> + /// Checks for existence of a header. + /// </summary> + /// <remarks> + /// The value is matched against as that returned by + /// <b>Header::ToString()</b> + /// </remarks> + /// <param name="fullHeader">Value to look for.</param> + /// <param name="ignoreCase">Whether or not to ignore case.</param> + /// <returns> + /// <c>true</c> if header is found, <c>false</c> otherwise. + /// </returns> public bool Exists(string fullHeader, bool ignoreCase) { if(fullHeader == null || fullHeader == "") @@ -181,11 +242,23 @@ return false; } + /// <summary> + /// Checks for existence of a header. + /// </summary> + /// <param name="header">Header to look for.</param> + /// <returns> + /// <c>true</c> if header is found, <c>false</c> otherwise. + /// </returns> public bool Exists(Header header) { return headers.Contains(header); } + /// <summary> + /// Removes all matching headers. + /// </summary> + /// <param name="name">Header to look for.</param> + /// <param name="ignoreCase">Whether or not to ignore case.</param> public void RemoveAll(string name, bool ignoreCase) { ArrayList delete = new ArrayList(); @@ -202,11 +275,30 @@ } } + /// <summary> + /// Removes the first matching header. + /// </summary> + /// <param name="fullHeader">Header to look for.</param> + /// <param name="ignoreCase">Whether or not to ignore case.</param> public void Remove(string fullHeader, bool ignoreCase) { RemoveAt(IndexOf(fullHeader, ignoreCase)); } + /// <summary> + /// Returns the string representation for the list. + /// </summary> + /// <returns>The string representation.</returns> + /// <remarks> + /// The value returned is a concatenation of the values + /// returned by all the headers in the list. Specifially, + /// the returned value is of the the form: + /// <code> + /// Name1: Value11\r\n + /// Name1: Value12\r\n + /// Name2: Value2\r\n + /// </code> + /// </remarks> public override string ToString() { string retVal = ""; Index: MailEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MailEventHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MailEventHandler.cs 2 Sep 2002 13:07:54 -0000 1.1 +++ MailEventHandler.cs 6 Sep 2002 11:52:29 -0000 1.2 @@ -10,6 +10,5 @@ namespace CSMail { - public delegate void MailEventHandler(object sender, - MailEventArgs e); + public delegate void MailEventHandler(object sender, MailEventArgs e); } Index: Message.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Message.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Message.cs 4 Sep 2002 06:35:42 -0000 1.6 +++ Message.cs 6 Sep 2002 11:52:29 -0000 1.7 @@ -13,6 +13,9 @@ namespace CSMail { + /// <summary> + /// Abstract class that models a message. + /// </summary> public abstract class Message: IPart { /// <summary> @@ -30,7 +33,7 @@ /// <summary> /// Has this been message expunged from the folder? /// </summary> - private bool isExpunged; + protected bool isExpunged; protected Message() { @@ -91,10 +94,6 @@ { return isExpunged; } - set - { - isExpunged = value; - } } public virtual IAddressList ReplyTo @@ -107,9 +106,7 @@ public bool IsSet(MessageFlags flag) { - if(!Enum.IsDefined(typeof(MessageFlags), flag)) - throw new ArgumentException("[IsSet] Illegal value to check"); - return ((flag & Flags) == flag); + return ((flag & Flags) != 0x0000); } } } Index: MessagingException.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessagingException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MessagingException.cs 6 Sep 2002 09:30:27 -0000 1.2 +++ MessagingException.cs 6 Sep 2002 11:52:29 -0000 1.3 @@ -44,5 +44,13 @@ throw new NotImplementedException(); } } + + public string BaseMessage + { + get + { + return base.Message; + } + } } } Index: Multipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Multipart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Multipart.cs 4 Sep 2002 07:06:08 -0000 1.2 +++ Multipart.cs 6 Sep 2002 11:52:29 -0000 1.3 @@ -12,19 +12,43 @@ namespace CSMail { + /// <summary> + /// Class that holds multiple bodyparts. + /// </summary> + /// <remarks> + /// A multipart provides mechanism to retrieve all + /// the parts within a part, recursively. + /// <p class="il"> + /// The content type of such a part is necessarily "multipart/*". + /// The various possible values include "multipart/mixed", + /// "multipart/signed", "mutlipart/alternative", + /// "multipart/related" etc. + /// </p> + /// </remarks> + /// <seealso cref="BodyPartList"/> + /// <seealso cref="BodyPart"/> public abstract class Multipart { private IPart parent; private BodyPartList bodyParts; + /// <summary> + /// The associated content type. + /// </summary> protected ContentType CType; + /// <summary> + /// Creates an instance with default settings. + /// </summary> protected Multipart() { this.CType = new ContentType("multipart", "mixed"); this.bodyParts = new BodyPartList(); } + /// <summary> + /// Returns the content type of the multipart. + /// </summary> public ContentType ContentType { get @@ -33,6 +57,9 @@ } } + /// <summary> + /// Returns the parent of this part. + /// </summary> public IPart Parent { get @@ -45,6 +72,10 @@ } } + /// <summary> + /// Returns the list of all the body-parts + /// contained in the multipart. + /// </summary> public BodyPartList BodyParts { get @@ -53,6 +84,10 @@ } } + /// <summary> + /// When implemented, writes the content to the stream. + /// </summary> + /// <param name="writer">The stream to write to.</param> public abstract void WriteTo(StreamWriter writer); } } Index: NewsAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/NewsAddress.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- NewsAddress.cs 20 Jun 2002 10:34:55 -0000 1.1 +++ NewsAddress.cs 6 Sep 2002 11:52:29 -0000 1.2 @@ -13,17 +13,32 @@ namespace CSMail { + /// <summary> + /// Class that encapsulated news address. + /// </summary> public class NewsAddress: IAddress { private string hostname; private ArrayList groups = new ArrayList(); + /// <summary> + /// Initializes the instance with a given hostname + /// and group to be connect to. + /// </summary> + /// <param name="host">Hostname to be connected to.</param> + /// <param name="group">Newsgroup to be connected to.</param> public NewsAddress(string host, string group) { hostname = host; groups.Add(group); } + /// <summary> + /// Initializes the instance with a given hostname + /// and a list groups to be connect to. + /// </summary> + /// <param name="host">Hostname to be connected to.</param> + /// <param name="groups">Newsgroups to be connected to.</param> public NewsAddress(string host, string[] groups) { if(groups == null || groups.Length == 0) @@ -37,6 +52,12 @@ } } + /// <summary> + /// The type of the address. + /// </summary> + /// <remarks> + /// It is necessarily <b>AddressType.NewsAddress</b> + /// </remarks> public AddressType AddressType { get @@ -45,6 +66,9 @@ } } + /// <summary> + /// Returns the associated hostname. + /// </summary> public string Hostname { get @@ -53,6 +77,13 @@ } } + /// <summary> + /// Returns the associated newsgroup. + /// </summary> + /// <remarks> + /// Incase a list of groups was provided, returns + /// the first group in the list. + /// </remarks> public string Group { get @@ -65,6 +96,15 @@ } } + /// <summary> + /// Returns the associated list of the groups as an array + /// of string. + /// </summary> + /// <remarks> + /// Returns a new copy list. As such, changing any values + /// after retrieving the list will not affect the + /// list stored here. + /// </remarks> public string[] Groups { get @@ -82,26 +122,53 @@ } } + /// <summary> + /// Adds a newsgroup to the list. + /// </summary> + /// <param name="group">Newsgroup to added.</param> + /// <returns>The number of elements in the final list.</returns> public int Add(string group) { return groups.Add(group); } + /// <summary> + /// Removes a newsgroup from the list. + /// </summary> + /// <param name="group">Newsgroup to be removed.</param> public void Remove(string group) { groups.Remove(group); } + /// <summary> + /// Check for existence of a newsgroup in the list. + /// </summary> + /// <remarks> + /// Currently the check is <b>case sensitive</b>. + /// </remarks> public bool Contains(string group) { return groups.Contains(group); } + /// <summary> + /// Returns the hashcode for the instance. + /// </summary> + /// <returns>The hashcode</returns> public override int GetHashCode() { return hostname.GetHashCode() + (Group == null ? 0xFFFF : Group.GetHashCode()); } + /// <summary> + /// Checks for the equality with an object. + /// </summary> + /// <param name="obj">Object to be compared to.</param> + /// <returns> + /// <c>true</c> if the two instances represent the same hostname + /// and newsgroups, <c>false</c> otherwise. + /// </returns> public override bool Equals(object obj) { if(obj is NewsAddress) @@ -111,6 +178,14 @@ return false; } + /// <summary> + /// Checks for the equality with another address. + /// </summary> + /// <param name="address">Address to be compared with.</param> + /// <returns> + /// <c>true</c> if the two instances represent the same hostname + /// and newsgroups, <c>false</c> otherwise. + /// </returns> public bool Equals(IAddress address) { if(address is NewsAddress) @@ -120,6 +195,14 @@ return false; } + /// <summary> + /// Checks for the equality with another address. + /// </summary> + /// <param name="address">Address to be compared with.</param> + /// <returns> + /// <c>true</c> if the two instances represent the same hostname + /// and newsgroups, <c>false</c> otherwise. + /// </returns> public bool Equals(NewsAddress address) { if(address.hostname == hostname && Groups != null && address.Groups != null Index: Parameter.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Parameter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Parameter.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ Parameter.cs 6 Sep 2002 11:52:29 -0000 1.2 @@ -10,17 +10,29 @@ namespace CSMail { + /// <summary> + /// Class that handles a parameter. + /// </summary> public class Parameter { private string name; private string value; + /// <summary> + /// Initialized the instance with given parameter name + /// and its value. + /// </summary> + /// <param name="name">Parameter name.</param> + /// <param name="value">The value of the paramter.</param> public Parameter(string name, string value) { this.name = name; this.value = value; } + /// <summary> + /// Returns the parameter name. + /// </summary> public string Name { get @@ -29,12 +41,32 @@ } } + /// <summary> + /// Returns the parameter value. + /// </summary> public string Value { get { return value; } + } + + /// <summary> + /// Returns the string representation of the paramter. + /// </summary> + /// <remarks> + /// The returned value is of the form: + /// <code> + /// <name>=<value> + /// </code> + /// </remarks> + public override string ToString() + { + string retVal = name; + retVal += "="; + retVal += value; + return retVal; } } } Index: Provider.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Provider.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Provider.cs 4 Sep 2002 06:35:42 -0000 1.6 +++ Provider.cs 6 Sep 2002 11:52:29 -0000 1.7 @@ -33,14 +33,14 @@ this.version = version; } - /// <summary> + /// <remarks> /// Format of rawline: /// protocol = <proto>; type = <type>; class = <class>; /// vendor = <vendor>; version = <version>; /// assembly = <assembly> /// Note that they may appear in any order. Vendor and version /// may be missing. '=' may be replaced by a ':' - /// </summary> + /// </remarks> internal Provider(string rawLine) { rawLine = rawLine.Trim(); Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Service.cs 3 Sep 2002 12:38:45 -0000 1.5 +++ Service.cs 6 Sep 2002 11:52:29 -0000 1.6 @@ -13,23 +13,50 @@ namespace CSMail { + /// <summary> + /// Mother class (abstract) for all the services. + /// </summary> + /// <seealso cref="Store"/> + /// <seealso cref="Transport"/> public abstract class Service { + /// <summary> + /// Flag to denote the connectivity status. + /// </summary> protected bool connected; + /// <summary> + /// Flag to denote the debug staus. + /// </summary> protected bool debug; + /// <summary> + /// The session associated with the service instance. + /// </summary> protected Session session; + /// <summary> + /// The URL associated with the service instance. + /// </summary> protected URLName url; private static readonly object ConnectionEvent = new object(); private EventHandlerList events; + /// <summary> + /// Initializes the instance with the session and urlname. + /// </summary> + /// <param name="session">Session to which this instance + /// is connected to.</param> + /// <param name="url">URL related to the current instance.</param> protected Service(Session session, URLName url) { this.session = session; this.url = url; } + /// <summary> + /// Returns the list of events. + /// </summary> + /// <seealso cref="EventHandlerList"/> protected EventHandlerList Events { get @@ -42,6 +69,9 @@ } } + /// <summary> + /// Returns the associated URL. + /// </summary> public URLName URL { get @@ -50,6 +80,12 @@ } } + /// <summary> + /// Returns the connectivity status. + /// </summary> + /// <remarks> + /// Returns <c>true</c> if connected, false otherwise. + /// </remarks> public bool Connected { get @@ -58,22 +94,43 @@ } } + /// <summary> + /// Closes an open connection. + /// </summary> [MailTODO] public virtual void Close() { throw new NotImplementedException(); } + /// <summary> + /// Attempts to make a connection. + /// </summary> public virtual void Connect() { Connect(null, null, null); } + /// <summary> + /// Attemps to make a connection to given address, and + /// specified username and passoword. + /// </summary> + /// <param name="hostname">Host to connect to.</param> + /// <param name="username">Username for authentication.</param> + /// <param name="password">Password for authentication.</param> public virtual void Connect(InternetAddress hostname, string username, string password) { Connect(hostname, -1, username, password); } + /// <summary> + /// Attempts to make a connection to given host at specified port, + /// with authentication. + /// </summary> + /// <param name="host">Host to connect to.</param> + /// <param name="port">Port at which connection is attempted.</param> + /// <param name="username">Username for authentication.</param> + /// <param name="password">Password for authentication.</param> [MailTODO] public virtual void Connect(InternetAddress host, int port, string username, string password) { @@ -140,6 +197,9 @@ throw new NotImplementedException(); } + /// <summary> + /// Occurs whenever connection status is changed. + /// </summary> public event ConnectionEventHandler Connection { add @@ -150,6 +210,19 @@ { Events.RemoveHandler(ConnectionEvent, value); } + } + + /// <summary> + /// Raises the <see cref="Connection"/> event. + /// </summary> + /// <param name="e">The required arguments to raise the event.</param> + [MailTODO] + public void OnConnection(ConnectionEventArgs e) + { + ConnectionEventHandler ceh = (ConnectionEventHandler)Events[ConnectionEvent]; + if(ceh != null) + ceh(this, e); + throw new NotImplementedException(); } } } Index: Store.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Store.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Store.cs 30 Aug 2002 12:39:33 -0000 1.5 +++ Store.cs 6 Sep 2002 11:52:29 -0000 1.6 @@ -52,12 +52,24 @@ [MailTODO] public void OnStoreMessage(StoreMessageEventArgs e) { + if(Events != null) + { + StoreMessageEventHandler smeh = (StoreMessageEventHandler)Events[StoreMessageEvent]; + if(smeh != null) + smeh(this, e); + } throw new NotImplementedException(); } [MailTODO] public void OnFolder(FolderEventArgs e) { + if(Events != null) + { + FolderEventHandler feh = (FolderEventHandler)Events[FolderEvent]; + if(feh != null) + feh(this, e); + } throw new NotImplementedException(); } } Index: TODO =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TODO 6 Sep 2002 09:08:28 -0000 1.2 +++ TODO 6 Sep 2002 11:52:29 -0000 1.3 @@ -7,6 +7,7 @@ * Done a lot! ;-) * BodyPartList -- Complete the class! + * ProviderList -- Complete the class! * InternetAddress -- Support for IP_V6. * MimeBodyPart, MimeMessage -- Implements IMimePart |
From: Gaurav V. <mas...@us...> - 2002-09-06 09:30:30
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv16186 Modified Files: AssemblyInfo.cs ChangeLog ConnectionEventArgs.cs Constants.cs EMailAddress.cs EMailAddressList.cs Folder.cs Header.cs HeaderList.cs MessagingException.cs Transport.cs Log Message: 2002-09-06 * EMailAddressList.cs : GetAddress(int) - Fixed index bug. : Add(EMailAddress[]) - Fixed null element bug. : ctor(EMailAddress[])- Fixed null element bug. : ctor(EMailAddressList) - Fixed null element bug. : this[int] - Fixed null element bug. * TODO : Added file. * AsseemblyInfo.cs : Added attribute "AssemblyFileVersion". * HeaderList.cs : ctor(Header[]) - Fixed null element bug. : ctor(HeaderList) - Fixed null element bug. * MessagingException.cs : Transformed into a linked list. * <Rest>.cs : Documenting Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/AssemblyInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AssemblyInfo.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ AssemblyInfo.cs 6 Sep 2002 09:30:27 -0000 1.2 @@ -1,3 +1,12 @@ +/** + * Assembly: CSMail + * + * Author: Gaurav Vaish + * Maintainer: mastergaurav AT users DOT sf DOT net + * + * (C) Gaurav Vaish (2002) + */ + using System.Reflection; using System.Runtime.CompilerServices; @@ -11,6 +20,8 @@ [assembly: AssemblyTrademark("CS-Mail")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.0.*")] + +[assembly: AssemblyFileVersion("1.0")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyName("")] Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- ChangeLog 5 Sep 2002 05:24:21 -0000 1.30 +++ ChangeLog 6 Sep 2002 09:30:27 -0000 1.31 @@ -1,4 +1,19 @@ +2002-09-06 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * EMailAddressList.cs : GetAddress(int) - Fixed index bug. + : Add(EMailAddress[]) - Fixed null element bug. + : ctor(EMailAddress[])- Fixed null element bug. + : ctor(EMailAddressList) + - Fixed null element bug. + : this[int] - Fixed null element bug. + * TODO : Added file. + * AsseemblyInfo.cs : Added attribute "AssemblyFileVersion". + * HeaderList.cs : ctor(Header[]) - Fixed null element bug. + : ctor(HeaderList) - Fixed null element bug. + * MessagingException.cs : Transformed into a linked list. + * <Rest>.cs : Documenting + 2002-09-05 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * BodyPart.cs, Index: ConnectionEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ConnectionEventArgs.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConnectionEventArgs.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ConnectionEventArgs.cs 6 Sep 2002 09:30:27 -0000 1.2 @@ -10,15 +10,25 @@ namespace CSMail { + /// <summary> + /// Class that holds arguments to a connection event. + /// </summary> public class ConnectionEventArgs { private ConnectionEventType eventType; + /// <summary> + /// Creates an instance of with required arguments. + /// </summary> + /// <param name="eventType">The type of the connection event.</param> public ConnectionEventArgs(ConnectionEventType eventType) { this.eventType = eventType; } - + + /// <summary> + /// Returns the type of the connection event. + /// </summary> public ConnectionEventType EventType { get Index: Constants.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Constants.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Constants.cs 29 Aug 2002 11:32:31 -0000 1.1 +++ Constants.cs 6 Sep 2002 09:30:27 -0000 1.2 @@ -10,17 +10,46 @@ namespace CSMail { + /// <summary> + /// Constants to be used widely in CSMail. + /// </summary> public class Constants { + /// <summary> + /// File that stores the list of providers. + /// </summary> + /// <seealso cref="Provider"/> public const string ProviderFile = "CSMail.providers"; + /// <summary> + /// File that stores the list of default providers. + /// </summary> + /// <seealso cref="Provider"/> public const string ProviderFileDefault = "CSMail.providers.default"; + /// <summary> + /// File that stores the address maps. + /// </summary> public const string AddressMapFile = "CSMail.adress.map"; + /// <summary> + /// File that stores the default address maps. + /// </summary> public const string AddressMapFileDefault = "CSMail.adress.map.default"; + /// <summary> + /// The default port number for POP3 protocol + /// </summary> public const int Pop3PortDefault = 110; + /// <summary> + /// The default port number for IMAP protocol + /// </summary> public const int ImapPortDefault = 143; + /// <summary> + /// The default port number for SMTP protocol + /// </summary> public const int SmtpPortDefault = 25; + /// <summary> + /// The default port number for NNTP protocol + /// </summary> public const int NntpPortDefault = 119; } } Index: EMailAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/EMailAddress.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EMailAddress.cs 5 Sep 2002 05:17:49 -0000 1.3 +++ EMailAddress.cs 6 Sep 2002 09:30:27 -0000 1.4 @@ -27,23 +27,34 @@ private string name; /// <summary> - /// Creates an instance of using userid and hostname. + /// Creates an instance using userid and hostname. /// </summary> /// <remarks> /// The associated string representation would be /// <c>user</c>@<c>host</c> /// </remarks> + /// <param name="user">userid of the email address.</param> + /// <param name="host">hostname of the email address.</param> public EMailAddress(string user, string host) { this.user = user; this.host = host; } + /// <summary> + /// Creates an instance using visible name, userid and hostname. + /// </summary> + /// <param name="name">Visible name of the user.</param> + /// <param name="user">user part of the email address.</param> + /// <param name="host">host part of the email address.</param> public EMailAddress(string name, string user, string host): this(user, host) { this.name = name; } + /// <summary> + /// Returns the user part of the email address. + /// </summary> public string User { get @@ -52,6 +63,9 @@ } } + /// <summary> + /// Returns the host part of the email address. + /// </summary> public string Host { get @@ -60,6 +74,9 @@ } } + /// <summary> + /// Returns the full name of the user. + /// </summary> public string Name { get @@ -68,6 +85,10 @@ } } + /// <summary> + /// Returns the address type. + /// </summary> + /// <seealso cref="AddressType"/> public AddressType AddressType { get @@ -76,6 +97,19 @@ } } + /// <summary> + /// Checks for equality with another address. + /// </summary> + /// <param name="address">Address to be compared with.</param> + /// <returns><c>true</c> if they are same, <c>false</c> + /// otherwise.</returns> + /// <remarks> + /// Two email addresses are equal if they share common + /// <c>user</c> and <c>host</c> parts. Comparision is currently + /// case sensitive, which I think <b>is a bug!</b> But right now, + /// I am too clumsy to correct this... will work on it later. + /// But have submitted the bug in the bug-tracker system! + /// </remarks> public bool Equals(IAddress address) { if(address is EMailAddress) @@ -87,6 +121,19 @@ return false; } + /// <summary> + /// Checks for equality with another object. + /// </summary> + /// <param name="address">Address to be compared with.</param> + /// <returns><c>true</c> if they are same, <c>false</c> + /// otherwise.</returns> + /// <remarks> + /// Two email addresses are equal if they share common + /// <c>user</c> and <c>host</c> parts. Comparision is currently + /// case sensitive, which I think <b>is a bug!</b> But right now, + /// I am too clumsy to correct this... will work on it later. + /// But have submitted the bug in the bug-tracker system! + /// </remarks> public override bool Equals(object address) { if(address is EMailAddress) @@ -98,6 +145,16 @@ return false; } + /// <summary> + /// Checking equality of two email addresses. + /// </summary> + /// <param name="left">Address on the left side of operator.</param> + /// <param name="right">Address on the right side of operator.</param> + /// <returns> + /// <c>true</c> if they are same, <c>false</c> otherwise. + /// <p>Note that a true is returned if both left as well as right are + /// <c>null</c>. Am I right in this logic?</p> + /// </returns> public static bool operator == (EMailAddress left, EMailAddress right) { if(left == null && right == null) @@ -111,17 +168,52 @@ return false; } + /// <summary> + /// Checking inequality of two email addresses. + /// </summary> + /// <param name="left">Address on the left side of operator.</param> + /// <param name="right">Address on the right side of operator.</param> + /// <returns> + /// <c>false</c> if they are same, <c>true</c> otherwise. + /// <p>Note that a false is returned if both left as well as right are + /// <c>null</c>. Am I right in this logic?</p> + /// </returns> public static bool operator != (EMailAddress left, EMailAddress right) { return !(left == right); } + /// <summary> + /// Returns a hashcode for this object. + /// </summary> + /// <returns> + /// The hashcode for the object. + /// </returns> public override int GetHashCode() { string em = user.ToLower() + "@" + host.ToLower(); return em.GetHashCode(); } + /// <summary> + /// Returns the string representation of the email address. + /// </summary> + /// <remarks> + /// The returned value is of the form: + /// <code> + /// Full Name <user@host> + /// </code> + /// or + /// <code> + /// user@host + /// </code> + /// if no name has been provided. Note that the value returned + /// can be directly used in any of the message headers, + /// like "From" etc. + /// </remarks> + /// <returns> + /// String representation. + /// </returns> public override string ToString() { string retVal = String.Empty; Index: EMailAddressList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/EMailAddressList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EMailAddressList.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ EMailAddressList.cs 6 Sep 2002 09:30:27 -0000 1.2 @@ -8,49 +8,95 @@ * (C) Gaurav Vaish (2002) */ +using System; using System.Collections; namespace CSMail { + /// <summary> + /// Class to store a list of email addresses. + /// </summary> + /// <seealso cref="EMailAddress"/> + /// <seealso cref="IAddressList"/> public class EMailAddressList: IAddressList, IEnumerable { private ArrayList emails; + /// <summary> + /// Creates an empty instance. + /// </summary> public EMailAddressList() { emails = new ArrayList(); } + /// <summary> + /// Creates an instance with given addresses. + /// </summary> + /// <param name="addresses">E-Mail addresses to be + /// filled in the initial list.</param> public EMailAddressList(EMailAddress[] addresses) { emails = new ArrayList(); foreach(EMailAddress current in addresses) { - emails.Add(current); + if(current != null) + { + emails.Add(current); + } } } + /// <summary> + /// Creates an instance with given addresses. + /// </summary> + /// <param name="addresses">E-Mail addresses to be + /// filled in the initial list.</param> public EMailAddressList(EMailAddressList addresses) { emails = new ArrayList(); foreach(EMailAddress current in addresses) { - emails.Add(current); + if(current != null) + { + emails.Add(current); + } } } + /// <summary> + /// Gets or sets an address at the specified index. + /// </summary> + /// <param name="index">The numerical index of the value + /// under consideration.</param> public EMailAddress this[int index] { get { + if(index < 0 || index >= Count) + return null; return (EMailAddress)emails[index]; } set { + if(index < 0 || index >= Count) + throw new IndexOutOfRangeException("[this] Index value is beyond limits"); emails[index] = value; } } + /// <summary> + /// Adds an address. + /// </summary> + /// <remarks> + /// This is an implementation for the method given in + /// the interface <c>IAddressList</c>. The address will + /// be added only if it is of type <c>EMailAddress</c>. + /// </remarks> + /// <param name="address">Address to be added to the list.</param> + /// <returns>The number of elements in the list after addition. + /// -1 if the element was not added. + /// </returns> int IAddressList.Add(IAddress address) { if(address is EMailAddress) @@ -58,12 +104,26 @@ return -1; } + /// <summary> + /// Adds an address at the specified position in the list. + /// </summary> + /// <remarks> + /// This is an implementation for the method given in + /// the interface <c>IAddressList</c>. The address will + /// be added only if it is of type <c>EMailAddress</c>. + /// </remarks> + /// <param name="index">Index (zero based) at which the address + /// is to be added in the list.</param> + /// <param name="address">The address to be added</param> void IAddressList.AddAt(int index, IAddress address) { if(address is EMailAddress) AddAt(index, (EMailAddress)address); } + /// <summary> + /// Returns the number of addresses in the list. + /// </summary> public int Count { get @@ -72,69 +132,154 @@ } } + /// <summary> + /// Clears the list. + /// </summary> public void Clear() { emails.Clear(); } + /// <summary> + /// Returns the address at the specified index. + /// </summary> + /// <remarks> + /// The returned address is necessarily an <c>EMailAddress</c>. + /// <p>If <c>index</c> is outside the limits, a <c>null</c> is + /// returned.</p> + /// <p>Should I throw an exception + /// <code> + /// if(index < 0 || index >= Count) + /// </code> ?</p> + /// </remarks> + /// <param name="index">The index of the element to be retrieved.</param> + /// <returns>The address at the specified index.</returns> IAddress IAddressList.GetAddress(int index) { return GetAddress(index); } + /// <summary> + /// Removes an address from the list. + /// </summary> + /// <remarks> + /// Removal is done only if the address is an EMailAddress. + /// </remarks> + /// <param name="address">Address to be removed.</param> void IAddressList.Remove(IAddress address) { if(address is EMailAddress) Remove((EMailAddress)address); } + /// <summary> + /// Adds an email address to the list. + /// </summary> + /// <param name="address">Address to be added.</param> + /// <returns>The number of elements in the list after + /// addition of the new address.</returns> public int Add(EMailAddress address) { return emails.Add(address); } + /// <summary> + /// Adds email addresses to the list. + /// </summary> + /// <param name="addresses">Addresses to be added.</param> + /// <returns>The number of elements in the list after + /// addition of all the elements.</returns> public int Add(EMailAddress[] addresses) { foreach(EMailAddress current in addresses) { - emails.Add(current); + if(current != null) + { + emails.Add(current); + } } return emails.Count; } + /// <summary> + /// Returns the index of an email address in the list. + /// </summary> + /// <param name="address">EMail address under consideration.</param> + /// <returns>The index (zero based) of the address. -1 if + /// not found in the list.</returns> public int IndexOf(EMailAddress address) { return emails.IndexOf(address); } + /// <summary> + /// Adds an address at the specified index. + /// </summary> + /// <param name="index">Index at which the address is to be + /// added.</param> + /// <param name="address">Address to be added.</param> public void AddAt(int index, EMailAddress address) { emails.Insert(index, address); } + /// <summary> + /// Returns the address at the specified index. + /// </summary> + /// <remarks> + /// If <c>index</c> is outside the bounds, a <c>null</c> + /// is returned.<br/> + /// Should I throw an "<c>IndexOutOfRange</c>" exception? + /// </remarks> + /// <param name="index">The index of the address.</param> + /// <returns>EMail address at the given index.</returns> public EMailAddress GetAddress(int index) { + if(index < 0 || index >= Count) + return null; return (EMailAddress)emails[index]; } + /// <summary> + /// Removes an address from the list. + /// </summary> + /// <param name="address">Address to be removed.</param> public void Remove(EMailAddress address) { emails.Remove(address); } + /// <summary> + /// Removes an element at the given index. + /// </summary> + /// <param name="index">Index where the value is to be + /// deleted.</param> public void RemoveAt(int index) { emails.RemoveAt(index); } + /// <summary> + /// Returns the enumerator for this list. + /// </summary> + /// <returns>The list enumerator.</returns> public IEnumerator GetEnumerator() { return emails.GetEnumerator(); } /// <summary> - /// Returns a string of comma separataed addresses. + /// Returns the string representation of the list. /// </summary> + /// <remarks> + /// The returned value is a comma separated list of + /// the email addresses in the list. An example of + /// the returned value would be: + /// <example> + /// Master Gaurav <mas...@us...>, + /// <so...@du...> + /// </example> + /// </remarks> public override string ToString() { string retVal = ""; @@ -146,4 +291,4 @@ return retVal; } } -} \ No newline at end of file +} Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Folder.cs 4 Sep 2002 06:35:42 -0000 1.5 +++ Folder.cs 6 Sep 2002 09:30:27 -0000 1.6 @@ -16,11 +16,75 @@ namespace CSMail { + /// <summary> + /// Abstract class that models a folder. Implementation + /// provided by the providers. + /// </summary> + /// <remarks> + /// This class is an abstract class with implementation furnished + /// by the providers. + /// <p>Folders can of various types. See + /// <see cref="FolderType"/> for more details. + /// </p> + /// <p> + /// What a folder stands for may have totally different meanings + /// when applied to different protocols and providers. An example + /// would be: it refers to a "real" folder for an IMAP provider, + /// while it may refer to a newsgroup for an NNTP provider. + /// </p> + /// <p> + /// It is also possible that folder may not physically exists. + /// To know whether it actually exists, use <see cref="Exists"/> + /// property. To create a folder, use <see cref="Create"/> member. + /// However, actual creation will depend upon whether you have + /// sufficient permissions to create a folder and/or such a method + /// is applicable to the protocol. + /// </p> + /// <!-- + /// <p> + /// The only places where you can get a folder are: + /// <code> + /// <see cref="Store.DefaultFolder"/> + /// <see cref="Store.this[string]"/> + /// <see cref="Store.this[URLName]"/> + /// </code> + /// </p> + /// --> + /// <p> + /// While deleting a message in a folder, the message is not deleted + /// until an explicit <see cref="Expunge"/> is called. + /// </p> + /// <p> + /// <b>Important (for providers as well as users):</b> + /// </p> + /// Folders are not to be cached by Store. Hence, retrieving folder + /// should/will yield different object each time. Whereas, the + /// messages (with their order defined) held within a folder + /// should/do not change unless they are deleted by an explicit + /// <see cref="Expunge"/>. + /// <p> + /// On exiting a folder, it is suggested that + /// <see cref="SaveChanges"/> method is called so that any changes are + /// not lost. Preferably, call it in a destructor or if you make your + /// implementation <c>IDisposable</c>, then in the <c>Dispose</c> + /// method. + /// </p> + /// </remarks> public abstract class Folder //: IEnumerable { + /// <summary> + /// Store with this folder. + /// </summary> protected Store store; protected FolderOpenMode mode; + /* I need it to for queue management + * I saw a class "EventQueue" in the java-mail (tm) + * jar file and the only place I could find its use + * is in Folder, while managing ConnectionEvent-s. + * I have put it, but now I can't find it's use. + * May be I will remove it some time. + */ private object lockObj; protected Folder(Store store) @@ -62,15 +126,15 @@ { get { - return getMessageCount(MessageFlags.Recent); + return GetMessageCount(MessageFlags.Recent); } } - + public int UnreadMessageCount { get { - return getMessageCount(MessageFlags.Seen); + return GetMessageCount(MessageFlags.Seen); } } @@ -78,11 +142,11 @@ { get { - return getMessageCount(MessageFlags.Deleted); + return GetMessageCount(MessageFlags.Deleted); } } - private int getMessageCount(MessageFlags flag) + private int GetMessageCount(MessageFlags flag) { if(!IsOpen) { @@ -136,7 +200,7 @@ /* [MailTODO] - ~Folder() + public virtual ~Folder() { throw new NotImplementedException(); } Index: Header.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Header.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Header.cs 25 Jul 2002 11:24:14 -0000 1.2 +++ Header.cs 6 Sep 2002 09:30:27 -0000 1.3 @@ -10,11 +10,30 @@ namespace CSMail { + /// <summary> + /// Class to store headers. + /// </summary> + /// <remarks> + /// Some headers have only one value associated. By one value, + /// I mean that it can occur only once. Like "Subject". Whereas, + /// some headers can occur multiple times, like "Received" header + /// in mail protocols (SMTP, POP3, IMAP). + /// <p> + /// This class does not check for such validities. It is left + /// to the deployment tools to check for such things and ensure + /// that the rules are properly followed. + /// </p> + /// </remarks> public class Header { private string name; private string[] values; + /// <summary> + /// Creates an instance with specified header name and its value. + /// </summary> + /// <param name="name">Header name</param> + /// <param name="value">Header value</param> public Header(string name, string value) { this.name = name; @@ -22,6 +41,11 @@ values[0] = value; } + /// <summary> + /// Creates an instance with specified header name and its values. + /// </summary> + /// <param name="name">Header name</param> + /// <param name="values">Header values</param> public Header(string name, string[] values) { this.name = name; @@ -33,6 +57,9 @@ } } + /// <summary> + /// Returns the header name. + /// </summary> public string Name { get @@ -41,6 +68,13 @@ } } + /// <summary> + /// Returns the header value. + /// </summary> + /// <remarks> + /// Incase, there are more than one values, + /// the first value is returned. + /// </remarks> public string Value { get @@ -51,6 +85,9 @@ } } + /// <summary> + /// Returns all the values. + /// </summary> public string[] Values { get @@ -60,14 +97,17 @@ } /// <summary> + /// Returns string representation of the header. + /// </summary> + /// <remarks> /// Returns all the values in the form of: - /// <c> + /// <code> /// Name: Value_1\r\n /// Name: Value_2\r\n - /// </c> + /// </code> /// This can be very useful while creation of headers like "Received" /// in SMTP protocol. - /// </summary> + /// </remarks> public override string ToString() { string retVal = ""; Index: HeaderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/HeaderList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HeaderList.cs 25 Jul 2002 11:24:14 -0000 1.2 +++ HeaderList.cs 6 Sep 2002 09:30:27 -0000 1.3 @@ -14,35 +14,65 @@ namespace CSMail { + /// <summary> + /// Class to encapsulate a list of headers. + /// </summary> public class HeaderList: IEnumerable { private ArrayList headers = new ArrayList(); + /// <summary> + /// Creates an empty list. + /// </summary> public HeaderList() { } + /// <summary> + /// Creates a list with a header. + /// </summary> + /// <param name="header">The one header in the initial + /// list.</param> public HeaderList(Header header) { headers.Add(header); } + /// <summary> + /// Creates a list with a given set of headers. + /// </summary> + /// <param name="headers">Initial set of headers + /// to be inserted in the list.</param> public HeaderList(Header[] headers) { foreach(Header current in headers) { - this.headers.Add(current); + if(current != null) + { + this.headers.Add(current); + } } } + /// <summary> + /// Creates a list with a given set of headers. + /// </summary> + /// <param name="headers">Initial set of headers + /// to be inserted in the list.</param> public HeaderList(HeaderList headers) { foreach(Header current in headers) { - this.headers.Add(current); + if(current != null) + { + this.headers.Add(current); + } } } + /// <summary> + /// Returns the number of headers in the list. + /// </summary> public int Count { get @@ -51,6 +81,11 @@ } } + /// <summary> + /// Gets / sets the header at specified index. + /// </summary> + /// <param name="index">The index (zero based), + /// the value at which is to be sought.</param> public Header this[int index] { get @@ -63,11 +98,20 @@ } } + /// <summary> + /// Returns an enumerator for the list for iteration. + /// </summary> public IEnumerator GetEnumerator() { return headers.GetEnumerator(); } + /// <summary> + /// Add a header to the list. + /// </summary> + /// <param name="header">Header to be added.</param> + /// <returns>Total number of elements in the list + /// after adding the new header.</returns> public int Add(Header header) { return headers.Add(header); Index: MessagingException.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessagingException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessagingException.cs 3 Sep 2002 12:41:17 -0000 1.1 +++ MessagingException.cs 6 Sep 2002 09:30:27 -0000 1.2 @@ -14,12 +14,35 @@ { public class MessagingException : Exception { + private Exception next; + public MessagingException() : base() { } public MessagingException(string message) : base(message) { + } + + public MessagingException(string message, Exception next) : base(message) + { + this.next = next; + } + + public Exception Next + { + get + { + return next; + } + } + + public override string Message + { + get + { + throw new NotImplementedException(); + } } } } Index: Transport.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Transport.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Transport.cs 5 Sep 2002 05:24:21 -0000 1.3 +++ Transport.cs 6 Sep 2002 09:30:27 -0000 1.4 @@ -34,7 +34,13 @@ /// <summary> /// Sends the message. /// </summary> + /// <remarks> + /// It is important to note that this method internally calls + /// the <c>SendMessage</c> method, and hence heavily depends + /// on the provider. + /// </remarks> /// <param name="message">The message to be sent.</param> + /// <see cref="SendMessage"/> [MailTODO] public static void Send(Message message) { @@ -44,9 +50,15 @@ /// <summary> /// Send the message to the specified addresslist. /// </summary> - /// <param name="message">Message to be sent.</param> + /// <remarks> + /// It is important to note that this method internally calls + /// the <c>SendMessage</c> method, and hence heavily depends + /// on the provider. + /// </remarks> /// <param name="addresses">Addresses to where the messages /// would be sent.</param> + /// <param name="message">The message to be sent.</param> + /// <see cref="SendMessage"/> [MailTODO] public static void Send(Message message, IAddressList addresses) { |
From: Gaurav V. <mas...@us...> - 2002-09-06 09:08:31
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv10340 Modified Files: TODO Log Message: 2002-09-06 * TODO -- Some more things TO DO! Index: TODO =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TODO 6 Sep 2002 07:33:31 -0000 1.1 +++ TODO 6 Sep 2002 09:08:28 -0000 1.2 @@ -1,8 +1,14 @@ Similar to Java-Mail (tm): - * MessagingException - * SendFailedException + * MessagingException -- Linked list + * SendFailedException -- Encapsulation of MessagingException Additions / Innovations: * Done a lot! ;-) + * BodyPartList -- Complete the class! + * InternetAddress -- Support for IP_V6. + * MimeBodyPart, + MimeMessage -- Implements IMimePart + * Some other? -- Implements IXXXXPart + * MimeMultipart -- Extends Multipart |
From: Gaurav V. <mas...@us...> - 2002-09-06 07:33:34
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv15349 Added Files: TODO Log Message: 2002-09-06 * TODO: New file added. Contains the list of work to be done. --- NEW FILE --- Similar to Java-Mail (tm): * MessagingException * SendFailedException Additions / Innovations: * Done a lot! ;-) |
From: Gaurav V. <mas...@us...> - 2002-09-05 05:24:23
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv10718 Modified Files: BodyPart.cs BodyPartList.cs ChangeLog StoreMessageEventArgs.cs StoreMessageEventHandler.cs Transport.cs URLName.cs Log Message: 2002-09-05 * BodyPart.cs, * BodyPartList.cs, * StoreMessageEventArgs.cs, * StoreMessageEventHandler.cs, * Transport.cs, * URLName.cs : On documentation spree. Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BodyPart.cs 4 Sep 2002 07:06:08 -0000 1.3 +++ BodyPart.cs 5 Sep 2002 05:24:21 -0000 1.4 @@ -12,14 +12,28 @@ namespace CSMail { + /// <summary> + /// The abstract class models a <c>Part</c> within + /// a <c>Multipart</c>. + /// </summary> + /// <seealso cref="Multipart"/> + /// <seealso cref="IPart"/> public abstract class BodyPart: IPart { private Multipart parent; - + + /// <summary> + /// Constructor to do some initialization + /// </summary> public BodyPart() { + parent = null; } - + + /// <summary> + /// Returns the parent <c>Multipart</c> for this + /// part, if any. Returns null otherwise. + /// </summary> public Multipart Parent { get @@ -27,8 +41,15 @@ return parent; } } - - internal Multipart ParentProperty + + /// <summary> + /// Gets or sets the parent <c>Multipart</c> associated. + /// </summary> + /// <remarks> + /// This property is available only to the assembly and the + /// children of this class, so that it can be used by them. + /// </remarks> + protected internal Multipart ParentProperty { get { @@ -39,17 +60,56 @@ parent = value; } } - + + /// <summary> + /// When implemented by a class, gets or sets the content + /// for this part. + /// </summary> public abstract Multipart Content { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the content type + /// associated with this part. + /// </summary> public abstract ContentType ContentType { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the description + /// for this part. + /// </summary> public abstract string Description { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the + /// content-disposition for this part. + /// </summary> public abstract ContentDisposition Disposition { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the filename + /// associated with this part, if any. + /// </summary> public abstract string Filename { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the headers. + /// </summary> public abstract HeaderList Headers { get; set; } + /// <summary> + /// When implemented by a class, gets or sets the size. + /// </summary> public abstract int Size { get; set; } - + + /// <summary> + /// When implemented by a class, adds an header for this part. + /// </summary> public abstract int AddHeader(Header header); + /// <summary> + /// When implemented by a class, adds headers for this part. + /// </summary> public abstract int AddHeaders(HeaderList headers); + /// <summary> + /// When implemented by a class, writes the content to the writer. + /// </summary> + /// <remarks> + /// I wonder shouldn't a <c>StreamWriter</c> be preffer over a + /// <c>TextWriter</c>? + /// </remarks> public abstract void Write(TextWriter writer); } } Index: BodyPartList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPartList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BodyPartList.cs 4 Sep 2002 07:06:08 -0000 1.2 +++ BodyPartList.cs 5 Sep 2002 05:24:21 -0000 1.3 @@ -13,30 +13,54 @@ namespace CSMail { + /// <summary> + /// Container for a list of body parts. + /// </summary> public class BodyPartList { private ArrayList parts; + /// <summary> + /// Initializes an instance of the BodyPartList. + /// </summary> public BodyPartList() { parts = new ArrayList(); } + /// <summary> + /// Creates an instance with a specified entry. + /// </summary> + [MailTODO] public BodyPartList(BodyPart part) { - //TODO + throw new NotImplementedException(); } + /// <summary> + /// Creates an instance using the list of parts provided. + /// </summary> + [MailTODO] public BodyPartList(BodyPart[] parts) { - //TODO + throw new NotImplementedException(); } + /// <summary> + /// Creates an instance using the list provided. + /// </summary> + /// <remarks> + /// Do I need this? Should I make it <c>ICloneable</c>? + /// </remarks> + [MailTODO] public BodyPartList(BodyPartList parts) { - //TODO + throw new NotImplementedException(); } + /// <summary> + /// Returns the number of parts in the list. + /// </summary> [MailTODO] public int Count { Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ChangeLog 5 Sep 2002 05:17:49 -0000 1.29 +++ ChangeLog 5 Sep 2002 05:24:21 -0000 1.30 @@ -1,4 +1,14 @@ +2002-09-05 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * BodyPart.cs, + * BodyPartList.cs, + * StoreMessageEventArgs.cs, + * StoreMessageEventHandler.cs, + * Transport.cs, + * URLName.cs + : On documentation spree. + 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * ContentDisposition.cs, Index: StoreMessageEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StoreMessageEventArgs.cs 30 Aug 2002 11:14:43 -0000 1.2 +++ StoreMessageEventArgs.cs 5 Sep 2002 05:24:21 -0000 1.3 @@ -12,17 +12,30 @@ namespace CSMail { + /// <summary> + /// Class that handles arguments to a <c>StoreEvent</c>. + /// </summary> + /// <seealso cref="StoreMessageEventHandler"/> public class StoreMessageEventArgs { private StoreMessageType type; private string message; + /// <summary> + /// Creates an instance of the object. + /// </summary> + /// <param name="type">The type of message issuued.</param> + /// <param name="message">The message issuzed.</param> + /// <seealso cref="StoreMessageType"/> public StoreMessageEventArgs(StoreMessageType type, string message) { this.type = type; this.message = message; } + /// <summary> + /// Returns the type of the message. + /// </summary> public StoreMessageType MessageType { get @@ -31,6 +44,9 @@ } } + /// <summary> + /// Returns the actual message issued. + /// </summary> public string Message { get Index: StoreMessageEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageEventHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StoreMessageEventHandler.cs 30 Aug 2002 12:17:23 -0000 1.2 +++ StoreMessageEventHandler.cs 5 Sep 2002 05:24:21 -0000 1.3 @@ -10,5 +10,11 @@ namespace CSMail { + /// <summary> + /// Delegate to handle all the message-events related to a store. + /// </summary> + /// <param name="sender">Sender of the message.</param> + /// <param name="e">The arguments associated with the raised event.</param> + /// <seealso cref="StoreMessageEventArgs"/> public delegate void StoreMessageEventHandler(object sender, StoreMessageEventArgs e); } Index: Transport.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Transport.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Transport.cs 3 Sep 2002 04:17:00 -0000 1.2 +++ Transport.cs 5 Sep 2002 05:24:21 -0000 1.3 @@ -12,25 +12,58 @@ namespace CSMail { + /// <summary> + /// Abstract class modelling the transport service. + /// </summary> + /// <seealso cref="Service"/> public abstract class Transport : Service { + /// <summary> + /// Creates an instance of transport service. + /// </summary> + /// <param name="session">Session associated with the service.</param> + /// <param name="urlname">The associated URL.</param> + /// <seealso cref="Session"/> + /// <seealso cref="URLName"/> + /// <seealso cref="Service"/> protected Transport(Session session, URLName urlname) : base(session, urlname) { } + /// <summary> + /// Sends the message. + /// </summary> + /// <param name="message">The message to be sent.</param> [MailTODO] public static void Send(Message message) { throw new NotImplementedException(); } + /// <summary> + /// Send the message to the specified addresslist. + /// </summary> + /// <param name="message">Message to be sent.</param> + /// <param name="addresses">Addresses to where the messages + /// would be sent.</param> [MailTODO] public static void Send(Message message, IAddressList addresses) { throw new NotImplementedException(); } + /// <summary> + /// When implemented, sends the message to the specified addresslist. + /// </summary> + /// <remarks> + /// This auxiliary method provides option to the implementation (of + /// the transport service) to send message that may need some + /// customization, like may be adding some custom headers etc. + /// </remarks> + /// <param name="msg">Message to be sent.</param> + /// <param name="addresses">Addresses to where the messages + /// would be sent.</param> public abstract void SendMessage(Message msg, IAddressList addresses); } } Index: URLName.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/URLName.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- URLName.cs 4 Sep 2002 06:35:42 -0000 1.4 +++ URLName.cs 5 Sep 2002 05:24:21 -0000 1.5 @@ -13,6 +13,13 @@ namespace CSMail { + /// <summary> + /// Class to handle a URI. + /// </summary> + /// <remarks> + /// It does not handle creation of any connection. It only models + /// the various parts of a URI, hence the name URLName. + /// </remarks> public class URLName { private string protocol; @@ -23,12 +30,40 @@ private string file; private string fullUrl; + /// <summary> + /// Creates an instance of URLName by parsing the string. + /// </summary> + /// <remarks> + /// The <c>url</c> supplied must be of the form: + /// <code> + /// protocol://[user[:pass@]]host[:port]/file + /// </code> + /// where protocol may be "smtp", "pop3", "imap", "nntp" etc, + /// while "file" is (generally) the name of the folder to be + /// looked for. It may also correspond a newsgroup when the + /// protocol is "nntp". + /// </remarks> + /// <param name="url">The URL to be parsed.</param> public URLName(string url) { ParseURL(url); fullUrl = url; } + /// <summary> + /// Creates an instance of URLName building from the various + /// components required. + /// </summary> + /// <param name="protocol">The protocol under consideration.</param> + /// <param name="host">The hostname where connections would be made to, + /// if required.</param> + /// <param name="port">Port number at which the data transaction + /// will occur.</param> + /// <param name="user">Username for authentication.</param> + /// <param name="pass">Password for authentication.</param> + /// <param name="file">Filename sought. It may refer to a folder when + /// dealing with mail protocols or a newsgroup name when dealing + /// with news protocols.</param> public URLName(string protocol, string host, int port, string user, string pass, string file) { this.protocol = protocol; @@ -59,6 +94,9 @@ fullUrl += file; } + /// <summary> + /// Returns the protocol associated. + /// </summary> public string Protocol { get @@ -67,6 +105,9 @@ } } + /// <summary> + /// Returns the hostname. + /// </summary> public string Hostname { get @@ -75,6 +116,9 @@ } } + /// <summary> + /// Returns the port number. + /// </summary> public int Port { get @@ -83,6 +127,9 @@ } } + /// <summary> + /// Returns the username. + /// </summary> public string Username { get @@ -91,6 +138,9 @@ } } + /// <summary> + /// Returns the password. + /// </summary> public string Password { get @@ -99,6 +149,9 @@ } } + /// <summary> + /// Returns the filename. + /// </summary> public string File { get @@ -117,6 +170,10 @@ throw new NotImplementedException(); } + /// <summary> + /// Tests for equality with an object. + /// </summary> + /// <param name="obj">Object to be compared with.</param> public override bool Equals(object obj) { if(obj is URLName) @@ -126,6 +183,10 @@ return false; } + /// <summary> + /// Tests for equality with another URLName object. + /// </summary> + /// <param name="url">URL to be compared with.</param> public bool Equals(URLName url) { if(url.Protocol == protocol && url.Hostname == host && url.Port == port && @@ -136,6 +197,9 @@ return false; } + /// <summary> + /// Returns the hashcode for the instance. + /// </summary> public override int GetHashCode() { return fullUrl.GetHashCode(); |
From: Gaurav V. <mas...@us...> - 2002-09-05 05:17:52
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv9467 Modified Files: ContentDisposition.cs ContentType.cs EMailAddress.cs FolderOpenMode.cs IAddress.cs IAddressList.cs IEncode.cs IMimePart.cs IPart.cs MessageSortStyle.cs TransferEncoding.cs ChangeLog Log Message: 2002-09-04 * ContentDisposition.cs, * ContentType.cs, * EMailAddress.cs, * FolderOpenMode.cs, * IAddress.cs, * IAddressList.cs, * IEncode.cs, * IMimePart.cs, * IPart.cs, * MessageSortStyle.cs, * TransferEncoding.cs : On documentation spree. Index: ContentDisposition.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentDisposition.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ContentDisposition.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ContentDisposition.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,9 +10,18 @@ namespace CSMail { + /// <summary> + /// The "Content-Disposition" options. + /// </summary> public enum ContentDisposition { + /// <summary> + /// The current part is an attachment. + /// </summary> Attachment, + /// <summary> + /// The current part is an inline content. + /// </summary> Inline } } Index: ContentType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ContentType.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ContentType.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -12,25 +12,47 @@ namespace CSMail { + /// <summary> + /// Class that encapsulates the "Content-Type" header + /// </summary> + /// <remarks> + /// Note that this header may be applied to any part + /// as well as to the message as a whole. + /// </remarks> public class ContentType { private string primaryType; private string subType; private ParameterList parameters; + /// <summary> + /// Create an instance with the primary as the <c>PrimaryType</c> + /// and sub as the <c>SubType</c> + /// </summary> public ContentType(string primary, string sub) { primaryType = primary; subType = sub; } + /// <summary> + /// Create an instance with the primary as the <c>PrimaryType</c> + /// and sub as the <c>SubType</c>, and a list of associated + /// parameters. + /// </summary> public ContentType(string primary, string sub, ParameterList parameters) { primaryType = primary; subType = sub; this.parameters = parameters; } - + + /// <summary> + /// Gets the primary type of the content. + /// </summary> + /// <remarks> + /// Returns an empty string, if a <b>null</b> was set + /// </remarks> public string PrimaryType { get @@ -40,7 +62,13 @@ return String.Empty; } } - + + /// <summary> + /// Returns the sub-type of the content. + /// </summary> + /// <remarks> + /// Returns an empty string, if a <b>null</b> was set + /// </remarks> public string SubType { get @@ -50,7 +78,10 @@ return String.Empty; } } - + + /// <summary> + /// Returns the parameters. + /// </summary> public ParameterList Parameters { get @@ -58,7 +89,14 @@ return parameters; } } - + + /// <summary> + /// Checks for the equality with an object. + /// </summary> + /// <remarks> + /// <c>obj</c> may be of type <c>ContentType</c> or + /// <c>string</c>. + /// </remarks> public override bool Equals(object obj) { if(obj is ContentType) @@ -71,7 +109,10 @@ } return false; } - + + /// <summary> + /// Checks for the equality. + /// </summary> public bool Equals(ContentType cType) { if(cType != null) @@ -80,12 +121,25 @@ } return false; } - + + /// <summary> + /// Checks for the equality with a string representation + /// of the object. + /// </summary> public bool Equals(string cType) { return (cType.Equals(this.ToString())); } + /// <summary> + /// Convert to string representation. + /// </summary> + /// <remarks> + /// The returned value is of the form: + /// <code> + /// PrimaryType/SubType; Parameters.ToString() + /// </code> + /// </remarks> public override string ToString() { string retVal; @@ -100,7 +154,10 @@ } return retVal; } - + + /// <summary> + /// Get the hash-code of the current instance. + /// </summary> public override int GetHashCode() { return (primaryType.GetHashCode() + subType.GetHashCode()); Index: EMailAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/EMailAddress.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EMailAddress.cs 30 Aug 2002 10:31:26 -0000 1.2 +++ EMailAddress.cs 5 Sep 2002 05:17:49 -0000 1.3 @@ -12,12 +12,27 @@ namespace CSMail { + /// <summary> + /// Class to represent an email address. + /// </summary> + /// <remarks> + /// Note that an email address must have a userid and hostname + /// to be a valid email address, besides the userid and hostname + /// being themselves a valid string. + /// </remarks> public class EMailAddress: IAddress { private string user; private string host; private string name; + /// <summary> + /// Creates an instance of using userid and hostname. + /// </summary> + /// <remarks> + /// The associated string representation would be + /// <c>user</c>@<c>host</c> + /// </remarks> public EMailAddress(string user, string host) { this.user = user; @@ -122,4 +137,4 @@ return retVal; } } -} \ No newline at end of file +} Index: FolderOpenMode.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderOpenMode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FolderOpenMode.cs 4 Sep 2002 09:59:18 -0000 1.3 +++ FolderOpenMode.cs 5 Sep 2002 05:17:49 -0000 1.4 @@ -21,7 +21,7 @@ { /// <summary> /// Default mode of opening a folder. - /// <summary> + /// </summary> /// <remarks> /// Though it is implementation dependent, but a /// <code>ReadOnly</code> mode corresponding to this @@ -44,7 +44,7 @@ /// raise an exception. Also, any changes made to the folder, /// if the exceptions are caught internally and not allowed to /// propagate, are lost. - /// </summary> + /// </remarks> ReadOnly, /// <summary> /// The folder can not be used for writing. Index: IAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IAddress.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IAddress.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IAddress.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,10 +10,20 @@ namespace CSMail { + /// <summary> + /// IAddress interface + /// </summary> public interface IAddress { + /// <summary> + /// When implemented, returns the type of address it is holding. + /// </summary> + /// <seealso cref="CSMail.AddressType"/> AddressType AddressType { get; } - + + /// <summary> + /// When implemented, tests for equality of two addresses. + /// </summary> bool Equals(IAddress address); } } Index: IAddressList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IAddressList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IAddressList.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IAddressList.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,15 +10,39 @@ namespace CSMail { + /// <summary> + /// Interface to handle collection of addresses. + /// </summary> public interface IAddressList { + /// <summary> + /// When implemented, returns the number of addresses in the list. + /// </summary> int Count { get; } + /// <summary> + /// When implemented, adds the address to the list. + /// </summary> int Add(IAddress address); + /// <summary> + /// When implemented, adds the address at a given index. + /// </summary> void AddAt(int index, IAddress address); + /// <summary> + /// When implemented, clears the list. + /// </summary> void Clear(); + /// <summary> + /// When implemented, returns the address as the given index. + /// </summary> IAddress GetAddress(int index); + /// <summary> + /// When implemented, removes an address from the list. + /// </summary> void Remove(IAddress iaddress); + /// <summary> + /// When implemented, removes the address at a given index from the list. + /// </summary> void RemoveAt(int index); } } Index: IEncode.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IEncode.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IEncode.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IEncode.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,17 +10,45 @@ namespace CSMail { + /// <summary> + /// Interface for retrieving encoding or decoding data. + /// </summary> public interface IEncode { + /// <summary> + /// When implemented, returns the content type associated. + /// </summary> string ContentType { get; } /** * I think, I should replace them with a stream (reader) */ + /// <summary> + /// When implemented, returns the decoded data (as should be + /// visible to the end user). + /// </summary> + /// <remarks> + /// I guess, I should replace <code>string</code> with + /// <code>StreamReader</code> + /// </remarks> string DecodedData { get; } + /// <summary> + /// When implemented, returns the encoded data (as should be + /// available for transferring over the network). + /// </summary> + /// <remarks> + /// I guess, I should replace <code>string</code> with + /// <code>StreamReader</code> + /// </remarks> string EncodedData { get; } + /// <summary> + /// When implemented, gets or sets the transfer encoding scheme. + /// </summary> TransferEncoding TransferEncoding { get; set; } + /// <summary> + /// When implemented, gets or sets the content disposition. + /// </summary> ContentDisposition ContentDisposition { get; set; } } } Index: IMimePart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IMimePart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IMimePart.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IMimePart.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,13 +10,37 @@ namespace CSMail { + /// <summary> + /// Interface to handle "Mime" encoded messages. + /// </summary> public interface IMimePart: IPart { + /// <summary> + /// When implemented, gets or sets the content id associated. + /// </summary> string ContentID { get; set; } + /// <summary> + /// When implemented, gets or sets the content language associated. + /// </summary> string ContentLanguage { get; set; } + /// <summary> + /// When implemented, gets or sets the content-MD5 associated. + /// </summary> string ContentMD5 { get; set; } + //HeaderList Headers { get; set; } + /// <summary> + /// When implemented, gets or sets the actual text. + /// </summary> + /// <remarks> + /// Since the actual text may be very long, I think it should + /// better be replaced by either a <code>StreamReader</code> + /// or a simple <code>byte[]</code>. + /// </remarks> string Text { get; set; } + /// <summary> + /// When implemented, gets or sets the transfer encoding scheme. + /// </summary> TransferEncoding TransferEncoding { get; set; } } } Index: IPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IPart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IPart.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IPart.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -13,18 +13,55 @@ namespace CSMail { + /// <summary> + /// Interface to the parts of a message. + /// </summary> public interface IPart { + /// <summary> + /// When implemented, gets or sets the content of the part. + /// </summary> Multipart Content { get; set; } + /// <summary> + /// When implemented, gets or sets the content type of the part. + /// </summary> ContentType ContentType { get; set; } + /// <summary> + /// When implemented, gets or sets the description for this part. + /// </summary> string Description { get; set; } + /// <summary> + /// When implemented, gets or sets the content disposition. + /// </summary> ContentDisposition Disposition { get; set; } + /// <summary> + /// When implemented, gets or sets the filename associated. + /// </summary> string Filename { get; set; } + /// <summary> + /// When implemented, gets or sets the headers. + /// </summary> HeaderList Headers { get; set; } + /// <summary> + /// When implemented, gets or sets the size of the part. + /// </summary> int Size { get; set; } - + + /// <summary> + /// When implemented, adds a header to the part. + /// </summary> int AddHeader(Header header); + /// <summary> + /// When implemented, adds headers to the part. + /// </summary> int AddHeaders(HeaderList headers); + /// <summary> + /// When implemented, writes the content. + /// </summary> + /// <remarks> + /// Should <code>TextWriter</code> be replaced by + /// <code>StreamWriter</code>? + /// </remarks> void Write(TextWriter writer); } } Index: MessageSortStyle.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageSortStyle.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageSortStyle.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ MessageSortStyle.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,12 +10,30 @@ namespace CSMail { + /// <summary> + /// The criterion for sorting messages (for viewing). + /// </summary> public enum MessageSortStyle { + /// <summary> + /// Use the implementation defaults. + /// </summary> Default, + /// <summary> + /// Sort using "From" header (alphabetically). + /// </summary> From, + /// <summary> + /// Sort using the size of the message. + /// </summary> Size, + /// <summary> + /// Sort by date (which - arrival or sent?) + /// </summary> Date, + /// <summary> + /// Sort by the subject (alphabetically) + /// </summary> Subject } } Index: TransferEncoding.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/TransferEncoding.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TransferEncoding.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ TransferEncoding.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,15 +10,42 @@ namespace CSMail { + /// <summary> + /// The "Transfer-Encoding" values. + /// </summary> public enum TransferEncoding { + /// <summary> + /// Default encoding. + /// </summary> Default, + /// <summary> + /// Encoded using "7-bit" encoding scheme. + /// </summary> Bit7, + /// <summary> + /// Encoded using "8-bit" encoding scheme. + /// </summary> Bit8, + /// <summary> + /// Encoded using "quoted-printable" scheme. + /// </summary> QuotedPrintable, + /// <summary> + /// Encoded using "base64" scheme. + /// </summary> Base64, + /// <summary> + /// Encoded using "binary" scheme. + /// </summary> Binary, + /// <summary> + /// The content is uuencode-d. + /// </summary> UUEncode, + /// <summary> + /// Any used defined encoding method. + /// </summary> UserDefined } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- ChangeLog 4 Sep 2002 09:59:18 -0000 1.28 +++ ChangeLog 5 Sep 2002 05:17:49 -0000 1.29 @@ -1,6 +1,21 @@ 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * ContentDisposition.cs, + * ContentType.cs, + * EMailAddress.cs, + * FolderOpenMode.cs, + * IAddress.cs, + * IAddressList.cs, + * IEncode.cs, + * IMimePart.cs, + * IPart.cs, + * MessageSortStyle.cs, + * TransferEncoding.cs + : On documentation spree. + +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * AddressType.cs, * ConnectionEventType.cs, * FolderEventType.cs, |
From: Gaurav V. <mas...@us...> - 2002-09-04 09:59:21
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv5786 Modified Files: AddressType.cs ChangeLog ConnectionEventType.cs FolderEventType.cs FolderOpenMode.cs FolderType.cs MessageDeliveryStatus.cs MessageFlags.cs ProviderSearchType.cs ProviderType.cs RecipientType.cs StoreMessageType.cs StoreSearchType.cs Log Message: 2002-09-04 * AddressType.cs, * ConnectionEventType.cs, * FolderEventType.cs, * FolderOpenStyle.cs, * FolderType.cs, * MessageDeliveryStatus.cs, * MessageFlags.cs, * ProviderSearchType.cs, * ProviderType.cs, * RecipientType.cs, * StoreMessageType.cs, * StoreSearchType.cs : On documentation spree. Index: AddressType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/AddressType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AddressType.cs 20 Jun 2002 02:43:23 -0000 1.1 +++ AddressType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -11,10 +11,27 @@ namespace CSMail { + /// <summary> + /// Denotes the type of address. + /// </summary> + /// <remarks> + /// Useful during resolution of addresses while dispatching messages. + /// The messages would be dispatched using protocols as set for the + /// respective type. + /// </remarks> public enum AddressType { + /// <summary> + /// Denotes that the address is an email. + /// </summary> EmailAddress, + /// <summary> + /// Denotes that the address is a URL. + /// </summary> InternetAddress, + /// <summary> + /// Denotes that the address is a newsgroup. + /// </summary> NewsAddress } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ChangeLog 4 Sep 2002 07:06:08 -0000 1.27 +++ ChangeLog 4 Sep 2002 09:59:18 -0000 1.28 @@ -1,6 +1,22 @@ 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * AddressType.cs, + * ConnectionEventType.cs, + * FolderEventType.cs, + * FolderOpenStyle.cs, + * FolderType.cs, + * MessageDeliveryStatus.cs, + * MessageFlags.cs, + * ProviderSearchType.cs, + * ProviderType.cs, + * RecipientType.cs, + * StoreMessageType.cs, + * StoreSearchType.cs + : On documentation spree. + +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * BodyPart.cs : ParentProperty - Not virtual, internal * Multipart.cs : Part => Parent : Several methods - Stubbed Index: ConnectionEventType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ConnectionEventType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConnectionEventType.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ConnectionEventType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -12,10 +12,22 @@ namespace CSMail { + /// <summary> + /// Denotes the type of event occured with a connection. + /// </summary> public enum ConnectionEventType { + /// <summary> + /// Denotes that the connection was opened. + /// </summary> Opened, + /// <summary> + /// Denotes that the connection was closed. + /// </summary> Closed, + /// <summary> + /// Denotes that the connection got disconnected (killed or timed-out). + /// </summary> Disconnected } } Index: FolderEventType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderEventType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FolderEventType.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ FolderEventType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -10,10 +10,25 @@ namespace CSMail { + /// <summary> + /// Denotes the event related to a folder. + /// </summary> + /// <remarks> + /// Useful when handling an folder event. + /// </remarks> public enum FolderEventType { + /// <summary> + /// Specifies that the folder has been created. + /// </summary> Created, + /// <summary> + /// Specifies that the folder has been deleted. + /// </summary> Deleted, + /// <summary> + /// Specifies that the folder has been renamed. + /// </summary> Renamed } } Index: FolderOpenMode.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderOpenMode.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FolderOpenMode.cs 28 Aug 2002 10:17:12 -0000 1.2 +++ FolderOpenMode.cs 4 Sep 2002 09:59:18 -0000 1.3 @@ -10,11 +10,45 @@ namespace CSMail { + /// <summary> + /// Denotes the mode in which folder has been opened + /// </summary> + /// <remarks> + /// Opening folder in a <code>ReadOnly</code> mode and + /// then trying to write on it would raise an exception. + /// </remarks> public enum FolderOpenMode { + /// <summary> + /// Default mode of opening a folder. + /// <summary> + /// <remarks> + /// Though it is implementation dependent, but a + /// <code>ReadOnly</code> mode corresponding to this + /// would be preferred. + /// </remarks> Default, + /// <summary> + /// The mode is indeterminate. + /// </summary> + /// <remarks> + /// As such, trying to read from or write to the folder + /// would raise an exception. + /// </remarks> NotSet, + /// <summary> + /// The folder can not be used for writing. + /// </summary> + /// <remarks> + /// Trying to write to a folder opened using this mode should + /// raise an exception. Also, any changes made to the folder, + /// if the exceptions are caught internally and not allowed to + /// propagate, are lost. + /// </summary> ReadOnly, + /// <summary> + /// The folder can not be used for writing. + /// </summary> ReadWrite } } Index: FolderType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FolderType.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ FolderType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -10,10 +10,26 @@ namespace CSMail { + /// <summary> + /// Denotes the type of folder. + /// </summary> + /// <remarks> + /// A folder can be used to store messages, other folders + /// or may be even both. Use this to denote what can it hold. + /// </remarks> public enum FolderType { + /// <summary> + /// Folder can hold only other folders. + /// </summary> Folders, + /// <summary> + /// Folder can hold only messages. + /// </summary> Messages, + /// <summary> + /// Folder can hold both messages as well as other folders. + /// </summary> Both } } Index: MessageDeliveryStatus.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageDeliveryStatus.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageDeliveryStatus.cs 3 Sep 2002 04:17:00 -0000 1.1 +++ MessageDeliveryStatus.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -10,11 +10,31 @@ namespace CSMail { + /// <summary> + /// The status of a message after it has been set + /// for delivery. + /// </summary> public enum MessageDeliveryStatus { + /// <summary> + /// The status is unknown! + /// </summary> Unknown, + /// <summary> + /// The message has been delivered. + /// </summary> Delivered, + /// <summary> + /// The message has been delivered partially. + /// </summary> + /// <remarks> + /// The left out part may be the process queue, + /// or something wrong might have happened! + /// </remarks> PartiallyDelivered, + /// <summary> + /// The message has not been delievered. + /// </summary> NotDelivered } } Index: MessageFlags.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageFlags.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MessageFlags.cs 28 Aug 2002 10:17:12 -0000 1.2 +++ MessageFlags.cs 4 Sep 2002 09:59:18 -0000 1.3 @@ -12,16 +12,46 @@ namespace CSMail { + /// <summary> + /// Various flags associated with a message. + /// </summary> [Flags] public enum MessageFlags { + /// <summary> + /// No flag is set. + /// </summary> None = 0x0000, + /// <summary> + /// The message has been answered. + /// </summary> Answered = 0x0001 << 0, + /// <summary> + /// The message has been marked for deletion + /// (but may not be expunged yet). + /// </summary> Deleted = 0x0001 << 1, + /// <summary> + /// The message is a draft. + /// </summary> Draft = 0x0001 << 2, + /// <summary> + /// The message has been flagged. + /// </summary> Flagged = 0x0001 << 3, + /// <summary> + /// The message is a newly arrived message (hence, + /// necessarily not <code>Seen</code>). + /// </summary> Recent = 0x0001 << 4, + /// <summary> + /// The message has been read (hence, necessarily not + /// <code>Recent</code>). + /// </summary> Seen = 0x0001 << 5, + /// <summary> + /// Any user defined flags. + /// </summary> UserDefined = 0x0001 << 15, } } Index: ProviderSearchType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderSearchType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ProviderSearchType.cs 30 Aug 2002 10:31:26 -0000 1.3 +++ ProviderSearchType.cs 4 Sep 2002 09:59:18 -0000 1.4 @@ -10,9 +10,18 @@ namespace CSMail { + /// <summary> + /// Criterion while looking up for a provider. + /// </summary> public enum ProviderSearchType { + /// <summary> + /// Search using class-name as the key. + /// </summary> ClassName, + /// <summary> + /// Search using protocol as the key. + /// </summary> Protocol } } Index: ProviderType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ProviderType.cs 29 Aug 2002 11:32:31 -0000 1.2 +++ ProviderType.cs 4 Sep 2002 09:59:18 -0000 1.3 @@ -10,10 +10,27 @@ namespace CSMail { + /// <summary> + /// What service are you providing. + /// </summary> public enum ProviderType { + /// <summary> + /// The provider type is not set. + /// </summary> + /// <remarks> + /// As such, the name of the provider cannot be + /// added to the list of the various providers + /// available. + /// </remarks> NotSet, + /// <summary> + /// The provider is a provider for "Store" service. + /// </summary> Store, + /// <summary> + /// The provider is a provider for "Transport" service. + /// </summary> Transport } -} \ No newline at end of file +} Index: RecipientType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/RecipientType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RecipientType.cs 20 Jun 2002 03:57:59 -0000 1.3 +++ RecipientType.cs 4 Sep 2002 09:59:18 -0000 1.4 @@ -12,13 +12,36 @@ namespace CSMail { + /// <summary> + /// Where should the recipient's address go. + /// </summary> [Flags] public enum RecipientType: short { + /// <summary> + /// Mark the address(es) to go in the "To" header. + /// </summary> To = 0x0001, + /// <summary> + /// Mark the address(es) to go in to "Cc" header. + /// </summary> Cc = 0x0002, + /// <summary> + /// Mark the address(es) to go in to "Bcc" header. + /// </summary> Bcc = 0x0004, + /// <summary> + /// Mark the address(es) to go be sent to a newsgroup. + /// </summary> NewsGroup = 0x0010, + /// <summary> + /// Address(es) are set for all the types. + /// </summary> + /// <remarks> + /// But wait, how can an email in "To" and a newsgroup be + /// same. I must be wrong. Anyway, if "All" is set, you + /// should know how to parse the recipient list. + /// </remarks> All = To | Cc | Bcc | NewsGroup } } Index: StoreMessageType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StoreMessageType.cs 30 Aug 2002 11:11:18 -0000 1.1 +++ StoreMessageType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -10,10 +10,28 @@ namespace CSMail { + /// <summary> + /// The type of message emitted by a store. + /// </summary> public enum StoreMessageType { + /// <summary> + /// The type is indeterminate. + /// </summary> + /// <remarks> + /// The implementing class may choose to default + /// it to any of <code>Alert</code> or <code>Notice</code> + /// when actually delivering the message, or optionally + /// raise an exception. + /// </remarks> NotSet, + /// <summary> + /// The message emitted is an alert. + /// </summary> Alert, + /// <summary> + /// The message emitted is a notice. + /// </summary> Notice } } Index: StoreSearchType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreSearchType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StoreSearchType.cs 30 Aug 2002 10:31:27 -0000 1.1 +++ StoreSearchType.cs 4 Sep 2002 09:59:18 -0000 1.2 @@ -10,10 +10,33 @@ namespace CSMail { + /// <summary> + /// Denotes the criterion for a store (class). + /// </summary> + /// <remarks> + /// It is useful when we are trying to look for a class in the + /// list of available stores. This defines what parameter are + /// we looking for during search. + /// </remarks> public enum StoreSearchType { + /// <summary> + /// Search key is the class-name. + /// </summary> ClassName, + /// <summary> + /// Search key is the index. + /// </summary> + /// <remarks> + /// Used very rarely, since you don't know in which order + /// will the classes be read (from the configuration file). + /// <br/> + /// Use this only when you know what you are doing. + /// </remarks> Index, + /// <summary> + /// Search key is the full URL. + /// </summary> URLName } } |