[Csmail-patches] CVS: csmail/src/CSMail BodyPart.cs,1.6,1.7 ChangeLog,1.40,1.41 MimeBodyPart.cs,1.1,
Status: Pre-Alpha
Brought to you by:
mastergaurav
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; } } |