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