[Csmail-patches] CVS: csmail/src/CSMail AddressType.cs,1.2,1.3 BodyPart.cs,1.7,1.8 BodyPartList.cs,1
Status: Pre-Alpha
Brought to you by:
mastergaurav
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv1982 Modified Files: AddressType.cs BodyPart.cs BodyPartList.cs ChangeLog ContentType.cs Folder.cs MimeMultipart.cs ParameterList.cs Log Message: 2002-09-26 * AddressType.cs, BodyPart.cs, BodyPartList.cs, Folder.cs : Minor documentation changes. * ContentType.cs : Forgot to initialize "parameters" in ctor(string,string) * ParameterList.cs : ctor() - Implemented * MimeMultipart.cs : ctor(StreamReader) - Implemented : ParseBodyParts() - More implementation Index: AddressType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/AddressType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AddressType.cs 4 Sep 2002 09:59:18 -0000 1.2 +++ AddressType.cs 26 Sep 2002 09:47:10 -0000 1.3 @@ -12,13 +12,18 @@ namespace CSMail { /// <summary> - /// Denotes the type of address. + /// Denotes the type of address for the classes + /// implementing <see cref="T:CSMail.IAddress"/>. /// </summary> /// <remarks> /// Useful during resolution of addresses while dispatching messages. /// The messages would be dispatched using protocols as set for the /// respective type. /// </remarks> + /// <seealso cref="T:CSMail.IAddress"/> + /// <seealso cref="T:CSMail.EMailAddress"/> + /// <seealso cref="T:CSMail.InternetAddress"/> + /// <seealso cref="T:CSMail.NewsAddress"/> public enum AddressType { /// <summary> Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- BodyPart.cs 13 Sep 2002 06:10:59 -0000 1.7 +++ BodyPart.cs 26 Sep 2002 09:47:10 -0000 1.8 @@ -14,18 +14,19 @@ namespace CSMail { /// <summary> - /// The abstract class models a <c>Part</c> within - /// a <c>Multipart</c>. + /// The abstract class models a + /// <see cref="T:CSMail.IPart"/> within a + /// <see cref="T:CSMail.Multipart"/>. /// </summary> - /// <seealso cref="Multipart"/> - /// <seealso cref="IPart"/> + /// <seealso cref="T:CSMail.Multipart"/> + /// <seealso cref="T:CSMail.IPart"/> public abstract class BodyPart: IPart { private Multipart parent; private StateBag partState; /// <summary> - /// Constructor to do some initialization + /// Creates an instance of body part with no parent. /// </summary> public BodyPart() { @@ -33,8 +34,8 @@ } /// <summary> - /// Returns the parent <c>Multipart</c> for this - /// part, if any. Returns null otherwise. + /// Returns the parent <see cref="T:CSMail.Multipart"/> + /// for this part, if any. Returns null otherwise. /// </summary> public Multipart Parent { @@ -57,8 +58,8 @@ } /// <summary> - /// Gets or sets the parent <c>Multipart</c> associated. - /// </summary> + /// Gets or sets the parent <see cref="T:CSMail.Multipart"/> + /// 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. @@ -123,8 +124,8 @@ /// 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>? + /// I wonder shouldn't a <see cref="T:System.IO.StreamWriter"/> + /// be preferred over a <see cref="T:System.IO.TextWriter"/>? /// </remarks> public abstract void Write(TextWriter writer); } Index: BodyPartList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPartList.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BodyPartList.cs 19 Sep 2002 08:16:15 -0000 1.5 +++ BodyPartList.cs 26 Sep 2002 09:47:10 -0000 1.6 @@ -14,7 +14,7 @@ namespace CSMail { /// <summary> - /// Container for a list of body parts. + /// Container for a list of <see cref="T:CSMail.BodyPart"/>. /// </summary> public class BodyPartList : IEnumerable { @@ -39,7 +39,9 @@ /// </summary> /// <param name="parts">The body parts in the initial list.</param> /// <param name="isReadOnly">Determines if the list is - /// readonly.</param> + /// readonly. <see langword="true"/> if it is read only, + /// <see langword="false"/> otherwise. + /// </param> public BodyPartList(BodyPart[] parts, bool isReadOnly) { this.isReadOnly = isReadOnly; @@ -58,7 +60,7 @@ /// </summary> /// <param name="part">Body part in the initial list.</param> /// <remarks> - /// The list is not read-only. + /// The list is not <see cref="P:CSMail.BodyPartList.IsReadOnly"/>. /// </remarks> public BodyPartList(BodyPart part) { @@ -72,7 +74,7 @@ /// </summary> /// <param name="parts">Body parts in the initial list.</param> /// <remarks> - /// The list is not read-only. + /// The list is not <see cref="P:CSMail.BodyPartList.IsReadOnly"/>. /// </remarks> public BodyPartList(BodyPart[] parts) : this(parts, false) { @@ -84,9 +86,14 @@ /// <param name="index">The index (zero based) under /// consideration.</param> /// <exception name="ArgumentOutOfRangeException"> + /// <para> /// <c>index</c> is less than zero, - /// <p>-or-</p> - /// <c>index</c> is euqal to or greater than <see cref="Count"/>. + /// </para> + /// <para>-or-</para> + /// <para> + /// <c>index</c> is euqal to or greater than + /// <see cref="P:CSMail.BodyPartList.Count"/>. + /// </para> /// </exception> /// <exception name="NotSupportedException"> /// When trying to modify a read-only list. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- ChangeLog 24 Sep 2002 08:34:52 -0000 1.46 +++ ChangeLog 26 Sep 2002 09:47:10 -0000 1.47 @@ -1,4 +1,14 @@ +2002-09-26 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * AddressType.cs, BodyPart.cs, BodyPartList.cs, Folder.cs + : Minor documentation changes. + * ContentType.cs : Forgot to initialize "parameters" in + ctor(string,string) + * ParameterList.cs : ctor() - Implemented + * MimeMultipart.cs : ctor(StreamReader) - Implemented + : ParseBodyParts() - More implementation + 2002-09-24 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * HeaderList.cs : this[string] { get; set; } - Stubbed Index: ContentType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ContentType.cs 12 Sep 2002 07:13:25 -0000 1.3 +++ ContentType.cs 26 Sep 2002 09:47:10 -0000 1.4 @@ -33,18 +33,26 @@ { primaryType = primary; subType = sub; + parameters = new ParameterList(); } /// <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. + /// Create an instance with the + /// <paramref name="primary"/> as the <see cref="PrimaryType"/> + /// and <paramref name="sub"/> as the <see cref="SubType"/>, + /// and a list of associated parameters. /// </summary> public ContentType(string primary, string sub, ParameterList parameters) { primaryType = primary; subType = sub; - this.parameters = parameters; + if(parameters != null) + { + this.parameters = parameters; + } else + { + this.parameters = new ParameterList(); + } } /// <summary> Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Folder.cs 6 Sep 2002 11:52:29 -0000 1.7 +++ Folder.cs 26 Sep 2002 09:47:10 -0000 1.8 @@ -24,7 +24,7 @@ /// 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. + /// <see cref="T:CSMail.FolderType"/> for more details. /// </p> /// <p> /// What a folder stands for may have totally different meanings Index: MimeMultipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MimeMultipart.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- MimeMultipart.cs 24 Sep 2002 08:34:52 -0000 1.7 +++ MimeMultipart.cs 26 Sep 2002 09:47:10 -0000 1.8 @@ -17,24 +17,63 @@ public class MimeMultipart : Multipart { protected bool isParsed; + + protected StreamReader reader = null; + /// <summary> + /// Creates an instance of MimeMultipart object, whose + /// content-type is "multipart/mixed". + /// </summary> + /// <remarks> + /// <para> + /// This constructor is useful for the providers and + /// other developers who need to create a new part + /// and then slowly fill it with content. + /// </para> + /// <para> + /// It is important to note that a unique boundary value + /// for this part is automatically generated when the + /// instance is created using this constructor or the other + /// where subpart is provided. + /// </para> + /// </remarks> public MimeMultipart(): this("mixed") { } + /// <summary> + /// Creates an instance of MimeMultipart object, with + /// given <see cref="P:CSMail.MimeMultipart.SubType"/> + /// </summary> + /// <remarks> + /// <para> + /// This constructor is useful for the providers and + /// other developers who need to create a new part + /// and then slowly fill it with content. + /// </para> + /// <para> + /// It is important to note that a unique boundary value + /// for this part is automatically generated when the + /// instance is created using this constructor or the other + /// where subpart is provided. + /// </para> + /// </remarks> + /// <param name="subType">The <see cref="SubType"/> for + /// the <see cref="P:CSMail.Multipart.ContentType"/> + /// </param> [MailTODO] - public MimeMultipart(string subPart) + public MimeMultipart(string subType) { isParsed = true; - CType = new ContentType("multipart", subPart); - // Have to set a new Boundary Value; - throw new NotImplementedException(); + CType = new ContentType("multipart", subType); + CType.Parameters["Boundary"] = "\"--" + UniqueValueGenerator.GenerateBoundary() + "\""; } - [MailTODO] public MimeMultipart(StreamReader reader) { - throw new NotImplementedException(); + isParsed = false; + this.reader = reader; + ParseBodyParts(); } public string SubType @@ -66,16 +105,9 @@ /// </summary> /// <remarks> /// <para> - /// I have to get raw data (stream) from somewhere. - /// Now this makes me think over the issue of - /// a DataSource. Do I need it now? - /// </para> - /// <para> - /// 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? + /// This method is used only in conjuction with + /// <see cref="M:CSMail.MimeMultipart.#ctor(StreamReader)"/> + /// constructor. /// </para> /// </remarks> [MailTODO] @@ -86,7 +118,7 @@ throw new NotImplementedException(); } } - + [MailTODO] public override void WriteTo(StreamWriter writer) { Index: ParameterList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ParameterList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParameterList.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ ParameterList.cs 26 Sep 2002 09:47:10 -0000 1.2 @@ -16,6 +16,11 @@ { private Hashtable parameters; + public ParameterList() + { + parameters = new Hashtable(); + } + public ParameterList(Parameter parameter) { parameters = new Hashtable(); |