[Csmail-patches] CVS: csmail/src/CSMail BodyPart.cs,1.3,1.4 BodyPartList.cs,1.2,1.3 ChangeLog,1.29,1
Status: Pre-Alpha
Brought to you by:
mastergaurav
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(); |