csmail-patches Mailing List for CS Mail API (Page 4)
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-04 07:32:08
|
Update of /cvsroot/csmail/csmail/tools In directory usw-pr-cvs1:/tmp/cvs-serv31663 Added Files: ChangeLog Log Message: 2002-09-04 * ChangeLog : Added new file --- NEW FILE --- |
From: Gaurav V. <mas...@us...> - 2002-09-04 07:30:50
|
Update of /cvsroot/csmail/csmail In directory usw-pr-cvs1:/tmp/cvs-serv31393 Modified Files: ChangeLog Log Message: 2002-09-04 * tools : Added directory. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ChangeLog 4 Sep 2002 06:30:27 -0000 1.5 +++ ChangeLog 4 Sep 2002 07:30:47 -0000 1.6 @@ -1,6 +1,10 @@ 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * tools : Added directory. + +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * makefile : Added target "doc" 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> |
From: Gaurav V. <mas...@us...> - 2002-09-04 07:30:08
|
Update of /cvsroot/csmail/csmail/tools In directory usw-pr-cvs1:/tmp/cvs-serv31218/tools Log Message: Directory /cvsroot/csmail/csmail/tools added to the repository |
From: Gaurav V. <mas...@us...> - 2002-09-04 07:06:13
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv24609 Modified Files: BodyPart.cs BodyPartList.cs ChangeLog Multipart.cs Log Message: 2002-09-04 * BodyPart.cs : ParentProperty - Not virtual, internal * Multipart.cs : Part => Parent : Several methods - Stubbed Looks like I am through with it. Completed? * BodyPartList.cs : Count { get; } - Stubbed Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BodyPart.cs 4 Sep 2002 06:35:42 -0000 1.2 +++ BodyPart.cs 4 Sep 2002 07:06:08 -0000 1.3 @@ -28,7 +28,7 @@ } } - protected virtual Multipart ParentProperty + internal Multipart ParentProperty { get { Index: BodyPartList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPartList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BodyPartList.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ BodyPartList.cs 4 Sep 2002 07:06:08 -0000 1.2 @@ -8,25 +8,48 @@ * (C) Gaurav Vaish (2002) */ +using System; using System.Collections; namespace CSMail { public class BodyPartList { + private ArrayList parts; + + public BodyPartList() + { + parts = new ArrayList(); + } + public BodyPartList(BodyPart part) { //TODO } - + public BodyPartList(BodyPart[] parts) { //TODO } - + public BodyPartList(BodyPartList parts) { //TODO } + + [MailTODO] + public int Count + { + get + { + throw new NotImplementedException(); + } + } + + /** + * Have to allow only Add(BodyPart body) etc. + * No Add(object generic) sort of thing. + * So, not deriving class from ArrayList. + */ } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- ChangeLog 4 Sep 2002 06:35:42 -0000 1.26 +++ ChangeLog 4 Sep 2002 07:06:08 -0000 1.27 @@ -1,6 +1,14 @@ 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 + Looks like I am through with it. Completed? + * BodyPartList.cs : Count { get; } - Stubbed + +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * BodyPart.cs : ParentProperty - Marked "virtual" * Folder.cs : URL { get; } - Removed MailTODO * Message.cs : IsExpunged {get; set;} - Implemented Index: Multipart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Multipart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Multipart.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ Multipart.cs 4 Sep 2002 07:06:08 -0000 1.2 @@ -8,22 +8,51 @@ * (C) Gaurav Vaish (2002) */ +using System.IO; + namespace CSMail { public abstract class Multipart { - private IPart part; + private IPart parent; + private BodyPartList bodyParts; + + protected ContentType CType; + + protected Multipart() + { + this.CType = new ContentType("multipart", "mixed"); + this.bodyParts = new BodyPartList(); + } + + public ContentType ContentType + { + get + { + return CType; + } + } - public IPart Part + public IPart Parent { get { - return part; + return parent; } set { - part = value; + parent = value; } } + + public BodyPartList BodyParts + { + get + { + return bodyParts; + } + } + + public abstract void WriteTo(StreamWriter writer); } } |
From: Gaurav V. <mas...@us...> - 2002-09-04 06:35:45
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv16952 Modified Files: BodyPart.cs ChangeLog Folder.cs InternetAddressList.cs Message.cs Provider.cs URLName.cs Log Message: 2002-09-04 * BodyPart.cs : ParentProperty - Marked "virtual" * Folder.cs : URL { get; } - Removed MailTODO * Message.cs : IsExpunged {get; set;} - Implemented : Folder { get; } - Implemented : ReplyTo { set; } - Removed : ReplyTo { get; } - Marked "virtual" - Implemented Index: BodyPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/BodyPart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BodyPart.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ BodyPart.cs 4 Sep 2002 06:35:42 -0000 1.2 @@ -28,7 +28,7 @@ } } - protected Multipart ParentProperty + protected virtual Multipart ParentProperty { get { Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ChangeLog 3 Sep 2002 12:49:49 -0000 1.25 +++ ChangeLog 4 Sep 2002 06:35:42 -0000 1.26 @@ -1,4 +1,14 @@ +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * BodyPart.cs : ParentProperty - Marked "virtual" + * Folder.cs : URL { get; } - Removed MailTODO + * Message.cs : IsExpunged {get; set;} - Implemented + : Folder { get; } - Implemented + : ReplyTo { set; } - Removed + : ReplyTo { get; } - Marked "virtual" + - Implemented + 2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Session.cs : GetStore, GetTransport - Completed Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Folder.cs 3 Sep 2002 12:38:45 -0000 1.4 +++ Folder.cs 4 Sep 2002 06:35:42 -0000 1.5 @@ -112,7 +112,6 @@ } } - [MailTODO] public URLName URL { get Index: InternetAddressList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/InternetAddressList.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- InternetAddressList.cs 28 Aug 2002 10:17:12 -0000 1.3 +++ InternetAddressList.cs 4 Sep 2002 06:35:42 -0000 1.4 @@ -197,7 +197,7 @@ /// <summary> /// Returns a CRLF separated list of Addresses. /// Do I need to take care of anything??? - /// </summray> + /// </summary> public override string ToString() { string retVal = String.Empty; Index: Message.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Message.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Message.cs 20 Jun 2002 03:57:59 -0000 1.5 +++ Message.cs 4 Sep 2002 06:35:42 -0000 1.6 @@ -15,21 +15,35 @@ { public abstract class Message: IPart { + /// <summary> + /// Folder that contains this message. + /// </summary> protected Folder folder; + /// <summary> + /// The message number in the folder. + /// </summary> protected int index; + /// <summary> + /// Session associated with this message + /// </summary> protected Session session; + /// <summary> + /// Has this been message expunged from the folder? + /// </summary> + private bool isExpunged; protected Message() { + this.isExpunged = false; } - protected Message(Folder folder, int index) + protected Message(Folder folder, int index) : this() { this.folder = folder; this.index = index; } - protected Message(Session session) + protected Message(Session session) : this() { this.session = session; } @@ -63,45 +77,39 @@ public abstract int AddHeaders(HeaderList headers); public abstract void Write(TextWriter writer); - [MailTODO] public virtual Folder Folder { get { - throw new NotImplementedException(); + return folder; } } - [MailTODO] public bool IsExpunged { get { - throw new NotImplementedException(); + return isExpunged; } set { - throw new NotImplementedException(); + isExpunged = value; } } - [MailTODO] - public IAddressList ReplyTo + public virtual IAddressList ReplyTo { get { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); + return (IAddressList)From; } } - [MailTODO] public bool IsSet(MessageFlags flag) { - throw new NotImplementedException(); + if(!Enum.IsDefined(typeof(MessageFlags), flag)) + throw new ArgumentException("[IsSet] Illegal value to check"); + return ((flag & Flags) == flag); } } } Index: Provider.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Provider.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Provider.cs 30 Aug 2002 08:41:28 -0000 1.5 +++ Provider.cs 4 Sep 2002 06:35:42 -0000 1.6 @@ -35,9 +35,9 @@ /// <summary> /// Format of rawline: - /// protocol = <proto>; type = <type>; class = <class>; - /// vendor = <vendor>; version = <version>; - /// assembly = <assembly> + /// 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> Index: URLName.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/URLName.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- URLName.cs 3 Sep 2002 12:38:45 -0000 1.3 +++ URLName.cs 4 Sep 2002 06:35:42 -0000 1.4 @@ -107,11 +107,11 @@ } } - [MailTODO] /// <summary> /// The URL is to be of the form: /// protocol://[user[:pass@]]host[:port]/file /// </summary> + [MailTODO] private void ParseURL(string url) { throw new NotImplementedException(); |
From: Gaurav V. <mas...@us...> - 2002-09-04 06:31:17
|
Update of /cvsroot/csmail/csmail/src In directory usw-pr-cvs1:/tmp/cvs-serv15906 Modified Files: CSMail.build ChangeLog makefile Log Message: 2002-09-04 * makefile : Added target "doc" * CSMail.build : Added target "doc" Index: CSMail.build =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.build,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CSMail.build 20 Jun 2002 11:15:44 -0000 1.2 +++ CSMail.build 4 Sep 2002 06:31:14 -0000 1.3 @@ -21,4 +21,16 @@ <delete file="../lib/CSMail.dll" failonerror="false"/> <delete dir="../lib" failonerror="false"/> </target> + + <target name="doc"> + <echo message="Generating the CSMail library documentation..."/> + <mkdir dir="../lib"/> + <csc target="library" output="../lib/CSMail.dll" debug="${debug}" doc="../lib/CSMail.xml"> + <arg value="/nowarn:1591"/> <!-- Missing XML comment --> + <sources> + <includes name="CSMail/*.cs"/> + <includes name="CSMail.Utils/*.cs"/> + </sources> + </csc> + </target> </project> Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ChangeLog 20 Jun 2002 11:02:12 -0000 1.2 +++ ChangeLog 4 Sep 2002 06:31:14 -0000 1.3 @@ -1,4 +1,9 @@ +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * makefile : Added target "doc" + * CSMail.build : Added target "doc" + 2002-06-20 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Added directory CSMail.Utils Index: makefile =================================================================== RCS file: /cvsroot/csmail/csmail/src/makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- makefile 20 Jun 2002 02:56:01 -0000 1.3 +++ makefile 4 Sep 2002 06:31:14 -0000 1.4 @@ -1,6 +1,10 @@ NANT = ../nant/NAnt.exe BUILD_FILE = CSMail.build +CSC = csc.exe /nologo +NOWARN = /nowarn:1591 +TLIB = /target:library + all: lib linux: lib @@ -9,6 +13,11 @@ lib: @$(NANT) -buildfile:$(BUILD_FILE) build + +doc: + $(CSC) $(NOWARN) $(TLIB) /out:../lib/CSMail.dll /doc:../lib/CSMail.xml CSMail\\*.cs CSMail.Utils\\*.cs + +# @$(NANT) -buildfile:$(BUILD_FILE) doc clean: @rm -f *~ .*~ |
From: Gaurav V. <mas...@us...> - 2002-09-04 06:30:30
|
Update of /cvsroot/csmail/csmail In directory usw-pr-cvs1:/tmp/cvs-serv15653 Modified Files: ChangeLog makefile Log Message: 2002-09-04 * makefile : Added target "doc" Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ChangeLog 30 Aug 2002 07:08:00 -0000 1.4 +++ ChangeLog 4 Sep 2002 06:30:27 -0000 1.5 @@ -1,4 +1,8 @@ +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * makefile : Added target "doc" + 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Added file LICENSE. Index: makefile =================================================================== RCS file: /cvsroot/csmail/csmail/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- makefile 20 Jun 2002 02:28:43 -0000 1.1 +++ makefile 4 Sep 2002 06:30:27 -0000 1.2 @@ -8,6 +8,11 @@ (cd $$i; make) || exit 1; \ done +doc: + @for i in $(DIRS); do \ + (cd $$i; make doc) || exit 1; \ + done + nant: cd nant; make |
From: Gaurav V. <mas...@us...> - 2002-09-03 12:49:52
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv29235 Modified Files: ChangeLog Session.cs Log Message: 2002-09-03 * Session.cs : GetStore, GetTransport - Completed : GetServiceInstance(...) - Stubbed Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ChangeLog 3 Sep 2002 12:38:45 -0000 1.24 +++ ChangeLog 3 Sep 2002 12:49:49 -0000 1.25 @@ -1,6 +1,11 @@ 2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : GetStore, GetTransport - Completed + : GetServiceInstance(...) - Stubbed + +2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Connect(...) - Implemented : Connect / Close - Marked "virtual" : GetHostAndProto(...) Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Session.cs 3 Sep 2002 12:38:45 -0000 1.14 +++ Session.cs 3 Sep 2002 12:49:49 -0000 1.15 @@ -72,14 +72,13 @@ return GetStore(null, provider); } - [MailTODO] private Store GetStore(URLName url, Provider provider) { if(provider == null || provider.ProviderType != ProviderType.Store) { throw new NoSuchProviderException("Invalid provider"); } - throw new NotImplementedException(); + return (Store)GetServiceInstance(url, provider); } public Transport GetTransport() @@ -103,14 +102,27 @@ return GetTransport(null, provider); } - [MailTODO] private Transport GetTransport(URLName url, Provider provider) { if(provider == null || provider.ProviderType != ProviderType.Transport) { throw new NoSuchProviderException("Invalid provider"); } + return (Transport)GetServiceInstance(url, provider); + } + + [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) + * then use only and only "Assembly.LoadFrom", + * create instance of the object with canonical name + * as that of value of "Provider.ClassName" + * If even that fails, then throw an exception + */ } private Session(Properties properties, Authenticator authenticator) |
From: Gaurav V. <mas...@us...> - 2002-09-03 12:41:19
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv25854 Added Files: MessagingException.cs Log Message: 2002-09-03 * MessagingException.cs : Added new class / exception. --- NEW FILE --- /** * Namespace: CSMail * Class: MessagingException * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; namespace CSMail { public class MessagingException : Exception { public MessagingException() : base() { } public MessagingException(string message) : base(message) { } } } |
From: Gaurav V. <mas...@us...> - 2002-09-03 12:38:49
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv25155 Modified Files: ChangeLog Folder.cs InternetAddress.cs Service.cs Session.cs URLName.cs Log Message: 2002-09-03 * Service.cs : Connect(...) - Implemented : Connect / Close - Marked "virtual" : GetHostAndProto(...) - Stubbed * MessagingException.cs : Added new class / exception. * URLName.cs : Host -> Hostname * Folder.cs : Corrections due to URLName * Session.cs : Added property "Properties" * InternetAddress.cs : Added new ctor (Needed in Service) Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- ChangeLog 3 Sep 2002 04:17:00 -0000 1.23 +++ ChangeLog 3 Sep 2002 12:38:45 -0000 1.24 @@ -1,6 +1,18 @@ 2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Connect(...) - Implemented + : Connect / Close - Marked "virtual" + : GetHostAndProto(...) + - Stubbed + * MessagingException.cs : Added new class / exception. + * URLName.cs : Host -> Hostname + * Folder.cs : Corrections due to URLName + * Session.cs : Added property "Properties" + * InternetAddress.cs : Added new ctor (Needed in Service) + +2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : Fixed GetStore(URLName) and GetTransport(URLName) bugs * Transport.cs : "using System" bug fixed Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Folder.cs 28 Aug 2002 10:25:52 -0000 1.3 +++ Folder.cs 3 Sep 2002 12:38:45 -0000 1.4 @@ -120,7 +120,7 @@ URLName retVal = Store.URL; String fn = (FullName == null ? String.Empty : FullName); char c = Separator; - return new URLName(retVal.Protocol, retVal.Host, retVal.Port, + return new URLName(retVal.Protocol, retVal.Hostname, retVal.Port, retVal.Username, retVal.Password, null); } } Index: InternetAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/InternetAddress.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InternetAddress.cs 28 Aug 2002 10:17:12 -0000 1.4 +++ InternetAddress.cs 3 Sep 2002 12:38:45 -0000 1.5 @@ -36,6 +36,12 @@ } } + [MailTODO] + public InternetAddress(string fullURI) + { + throw new NotImplementedException(); + } + /// <summary> /// Currently only IP_V4 formats are supported. To support /// the IP_V6 format IPs, I have to first go through the Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Service.cs 2 Sep 2002 12:49:17 -0000 1.4 +++ Service.cs 3 Sep 2002 12:38:45 -0000 1.5 @@ -59,25 +59,83 @@ } [MailTODO] - public void Close() + public virtual void Close() { throw new NotImplementedException(); } - [MailTODO] - public void Connect() + public virtual void Connect() { - throw new NotImplementedException(); + Connect(null, null, null); + } + + public virtual void Connect(InternetAddress hostname, string username, string password) + { + Connect(hostname, -1, username, password); } [MailTODO] - public void Connect(InternetAddress hostname, string username, string password) + public virtual void Connect(InternetAddress host, int port, string username, string password) { + if(Connected) + throw new MessagingException("[Connect] Already connected"); + string c_protocol = null; + string c_hostname; + string c_username = username; + string c_password = password; + string c_file; + InternetAddress c_host = host; + int c_port; + + if(url != null) + { + c_protocol = url.Protocol; + c_hostname = (host == null ? url.Hostname : host.Hostname); + c_port = (port == -1 ? url.Port : port); + if(c_username == null) + { + c_username = url.Username; + if(c_password == null) + c_password = url.Password; + } else if(c_password == null) + { + if(username == url.Username) + c_password = url.Password; + } + c_file = url.File; + } + if(c_protocol != null) + { + if(host == null) + { + string s_host; + GetHostAndProto((string)session.Properties["mail." + c_protocol + ".host"], + out s_host); + c_host = new InternetAddress(s_host, c_protocol); + c_hostname = s_host; + } + if(c_username == null) + { + c_username = (string)session.Properties["mail." + c_protocol + ".user"]; + } + } + if(c_host == null) + { + string s_host; + GetHostAndProto((string)session.Properties["mail.host"], + out s_host); + c_host = new InternetAddress(s_host, c_protocol); + c_hostname = s_host; + } + if(c_username == null) + { + c_username = (string)session.Properties["mail.user"]; + } throw new NotImplementedException(); } [MailTODO] - public void Connect(InternetAddress hostname, int port, string username, string password) + private void GetHostAndProto(string key, out string hostname) { throw new NotImplementedException(); } Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Session.cs 3 Sep 2002 04:17:00 -0000 1.13 +++ Session.cs 3 Sep 2002 12:38:45 -0000 1.14 @@ -43,6 +43,14 @@ } } + public Properties Properties + { + get + { + return properties; + } + } + public Store GetStore() { return GetStore("mail.store.protocol"); Index: URLName.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/URLName.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- URLName.cs 2 Sep 2002 11:04:27 -0000 1.2 +++ URLName.cs 3 Sep 2002 12:38:45 -0000 1.3 @@ -67,7 +67,7 @@ } } - public string Host + public string Hostname { get { @@ -128,7 +128,7 @@ public bool Equals(URLName url) { - if(url.Protocol == protocol && url.Host == host && url.Port == port && + if(url.Protocol == protocol && url.Hostname == host && url.Port == port && url.Username == username && url.Password == password) { return true; |
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv9279 Modified Files: ChangeLog MailEventArgs.cs Session.cs Transport.cs Added Files: MessageDeliveredEventArgs.cs MessageDeliveredEventHandler.cs MessageDeliveryStatus.cs Log Message: 2002-09-03 * Session.cs : Fixed GetStore(URLName) and GetTransport(URLName) bugs * Transport.cs : "using System" bug fixed * MessageDeliveryStatus : Added new enum * MessageDeliveredEventHandler.cs, * MessageDeliveredEventArgs.cs : Added delegate and class to handle the message delivery events. * MailEventArgs.cs : Redifinition of the class. --- NEW FILE --- /** * Namespace: CSMail * Class: MessageDeliveredEventArgs * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public class MessageDeliveredEventArgs { private MessageDeliveryStatus status; private Transport transport; private Message message; private IAddressList validSent; private IAddressList validUnsent; private IAddressList invalid; public MessageDeliveredEventArgs(Transport transport, MessageDeliveryStatus status, Message msg, IAddressList validSent, IAddressList validUnsent, IAddressList invalid) { this.transport = transport; this.status = status; this.message = msg; this.validSent = validSent; this.validUnsent = validUnsent; this.invalid = invalid; } public MessageDeliveryStatus DeliveryStatus { get { return status; } } public Transport Transport { get { return transport; } } public Message msg { get { return message; } } public IAddressList ValidSent { get { return validSent; } } public IAddressList ValidUnsent { get { return validUnsent; } } public IAddressList Invalid { get { return invalid; } } } } --- NEW FILE --- /** * Namespace: CSMail * Class: MessageDeliveredEventHandler * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public delegate void MessageDeliveredEventHandler(object source, MessageDeliveredEventArgs e); } --- NEW FILE --- /** * Namespace: CSMail * Enumeration: MessageDeliveryStatus * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public enum MessageDeliveryStatus { Unknown, Delivered, PartiallyDelivered, NotDelivered } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- ChangeLog 2 Sep 2002 13:07:54 -0000 1.22 +++ ChangeLog 3 Sep 2002 04:17:00 -0000 1.23 @@ -1,4 +1,16 @@ +2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Session.cs : Fixed GetStore(URLName) and + GetTransport(URLName) bugs + * Transport.cs : "using System" bug fixed + * MessageDeliveryStatus : Added new enum + * MessageDeliveredEventHandler.cs, + * MessageDeliveredEventArgs.cs + : Added delegate and class to handle the message + delivery events. + * MailEventArgs.cs : Redifinition of the class. + 2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Session.cs : GetTransport(...) - Implemented all Index: MailEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MailEventArgs.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MailEventArgs.cs 2 Sep 2002 13:07:54 -0000 1.1 +++ MailEventArgs.cs 3 Sep 2002 04:17:00 -0000 1.2 @@ -12,11 +12,8 @@ { public class MailEventArgs { - private object obj; - - public MailEventArgs(object obj) + public MailEventArgs() { - this.obj = obj; } } } Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Session.cs 2 Sep 2002 13:07:54 -0000 1.12 +++ Session.cs 3 Sep 2002 04:17:00 -0000 1.13 @@ -55,7 +55,8 @@ public Store GetStore(URLName url) { - return GetStore(url, (url != null ? Providers[url.Protocol] : null)); + return GetStore(url, (url != null ? Providers[ProviderSearchType.Protocol, + url.Protocol] : null)); } public Store GetStore(Provider provider) @@ -66,7 +67,7 @@ [MailTODO] private Store GetStore(URLName url, Provider provider) { - if(provider == null || provider.Type != ProviderType.Store) + if(provider == null || provider.ProviderType != ProviderType.Store) { throw new NoSuchProviderException("Invalid provider"); } @@ -85,7 +86,8 @@ public Transport GetTransport(URLName url) { - return GetTransport(url, (url == null ? null : Providers[url.Protocol])); + return GetTransport(url, (url != null ? Providers[ProviderSearchType.Protocol, + url.Protocol] : null)); } public Transport GetTransport(Provider provider) @@ -96,7 +98,7 @@ [MailTODO] private Transport GetTransport(URLName url, Provider provider) { - if(provider == null || provider.Type != ProviderType.Store) + if(provider == null || provider.ProviderType != ProviderType.Transport) { throw new NoSuchProviderException("Invalid provider"); } Index: Transport.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Transport.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Transport.cs 2 Sep 2002 13:07:54 -0000 1.1 +++ Transport.cs 3 Sep 2002 04:17:00 -0000 1.2 @@ -8,6 +8,8 @@ * (C) Gaurav Vaish (2002) */ +using System; + namespace CSMail { public abstract class Transport : Service |
From: Gaurav V. <mas...@us...> - 2002-09-02 13:07:56
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv17739 Modified Files: ChangeLog Session.cs Added Files: MailEventArgs.cs MailEventHandler.cs Transport.cs Log Message: 2002-09-02 * Session.cs : GetTransport(...) - Implemented all : GetTransport(URLName, Provider) - Stubbed * Transport.cs : Stubbed class. * MailEventHandler.cs : Added delegate * MailEventArgs.cs : Partial implementation. --- NEW FILE --- /** * Namespace: CSMail * Class: MailEventArgs * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public class MailEventArgs { private object obj; public MailEventArgs(object obj) { this.obj = obj; } } } --- NEW FILE --- /** * Namespace: CSMail * Class: MailEventHandler * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public delegate void MailEventHandler(object sender, MailEventArgs e); } --- NEW FILE --- /** * Namespace: CSMail * Class: Transport * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public abstract class Transport : Service { protected Transport(Session session, URLName urlname) : base(session, urlname) { } [MailTODO] public static void Send(Message message) { throw new NotImplementedException(); } [MailTODO] public static void Send(Message message, IAddressList addresses) { throw new NotImplementedException(); } public abstract void SendMessage(Message msg, IAddressList addresses); } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ChangeLog 2 Sep 2002 12:49:17 -0000 1.21 +++ ChangeLog 2 Sep 2002 13:07:54 -0000 1.22 @@ -1,6 +1,15 @@ 2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : GetTransport(...) - Implemented all + : GetTransport(URLName, Provider) + - Stubbed + * Transport.cs : Stubbed class. + * MailEventHandler.cs : Added delegate + * MailEventArgs.cs : Partial implementation. + +2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Why do I need destructor? or have I forgotten something that I thought earlier? * Session.cs : GetStore(...) - Implemented all. Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Session.cs 2 Sep 2002 12:49:17 -0000 1.11 +++ Session.cs 2 Sep 2002 13:07:54 -0000 1.12 @@ -73,6 +73,36 @@ throw new NotImplementedException(); } + public Transport GetTransport() + { + return GetTransport("mail.transport.protocol"); + } + + public Transport GetTransport(string protocol) + { + return GetTransport(new URLName(protocol, null, -1, null, null, null)); + } + + public Transport GetTransport(URLName url) + { + return GetTransport(url, (url == null ? null : Providers[url.Protocol])); + } + + public Transport GetTransport(Provider provider) + { + return GetTransport(null, provider); + } + + [MailTODO] + private Transport GetTransport(URLName url, Provider provider) + { + if(provider == null || provider.Type != ProviderType.Store) + { + throw new NoSuchProviderException("Invalid provider"); + } + throw new NotImplementedException(); + } + private Session(Properties properties, Authenticator authenticator) { this.properties = properties; |
From: Gaurav V. <mas...@us...> - 2002-09-02 12:49:21
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv12525 Modified Files: ChangeLog Service.cs Session.cs Added Files: NoSuchProviderException.cs Log Message: 2002-09-02 * Service.cs : Why do I need destructor? or have I forgotten something that I thought earlier? * Session.cs : GetStore(...) - Implemented all. : GetStore(URLName, Provider) - Stubbed * NoSuchProviderException.cs : Added exception --- NEW FILE --- /** * Namespace: CSMail * Class: NoSuchProviderException * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; namespace CSMail { public class NoSuchProviderException : Exception { public NoSuchProviderException() : base() { } public NoSuchProviderException(string message) : base(message) { } } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- ChangeLog 2 Sep 2002 11:04:27 -0000 1.20 +++ ChangeLog 2 Sep 2002 12:49:17 -0000 1.21 @@ -1,6 +1,16 @@ 2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Why do I need destructor? or have I forgotten + something that I thought earlier? + * Session.cs : GetStore(...) - Implemented all. + : GetStore(URLName, Provider) + - Stubbed + * NoSuchProviderException.cs + : Added exception + +2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * URLName.cs : No need to set any default values to protocol, host and port. Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Service.cs 30 Aug 2002 12:39:33 -0000 1.3 +++ Service.cs 2 Sep 2002 12:49:17 -0000 1.4 @@ -82,12 +82,6 @@ throw new NotImplementedException(); } - [MailTODO] - ~Service() - { - throw new NotImplementedException(); - } - public event ConnectionEventHandler Connection { add @@ -100,4 +94,4 @@ } } } -} \ No newline at end of file +} Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Session.cs 30 Aug 2002 12:17:20 -0000 1.10 +++ Session.cs 2 Sep 2002 12:49:17 -0000 1.11 @@ -43,9 +43,33 @@ } } + public Store GetStore() + { + return GetStore("mail.store.protocol"); + } + + public Store GetStore(string protocol) + { + return GetStore(new URLName(protocol, null, -1, null, null, null)); + } + + public Store GetStore(URLName url) + { + return GetStore(url, (url != null ? Providers[url.Protocol] : null)); + } + + public Store GetStore(Provider provider) + { + return GetStore(null, provider); + } + [MailTODO] - public Store GetStore(object key) + private Store GetStore(URLName url, Provider provider) { + if(provider == null || provider.Type != ProviderType.Store) + { + throw new NoSuchProviderException("Invalid provider"); + } throw new NotImplementedException(); } |
From: Gaurav V. <mas...@us...> - 2002-09-02 11:04:31
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv13327 Modified Files: URLName.cs ChangeLog Log Message: 2002-09-02 * URLName.cs : No need to set any default values to protocol, host and port. Index: URLName.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/URLName.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- URLName.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ URLName.cs 2 Sep 2002 11:04:27 -0000 1.2 @@ -15,9 +15,9 @@ { public class URLName { - private string protocol = "smtp"; - private string host = "localhost"; - private int port = 25; + private string protocol; + private string host; + private int port; private string username; private string password; private string file; Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ChangeLog 30 Aug 2002 12:39:33 -0000 1.19 +++ ChangeLog 2 Sep 2002 11:04:27 -0000 1.20 @@ -1,4 +1,9 @@ +2002-09-02 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * URLName.cs : No need to set any default values to protocol, + host and port. + 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Service.cs : event Connection { add; remove; } |
From: Gaurav V. <mas...@us...> - 2002-08-30 12:39:36
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv15114 Modified Files: ChangeLog Service.cs Store.cs Log Message: 2002-08-30 * Service.cs : event Connection { add; remove; } - Implemented * Store.cs : event StoreMessage { add; remove; } : event Folder { add; remove; } - Implemented Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ChangeLog 30 Aug 2002 12:17:19 -0000 1.18 +++ ChangeLog 30 Aug 2002 12:39:33 -0000 1.19 @@ -1,6 +1,14 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : event Connection { add; remove; } + - Implemented + * Store.cs : event StoreMessage { add; remove; } + : event Folder { add; remove; } + - Implemented + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : GetStore(object) - Stubbed * Store.cs : OnStoreMessage - Parameter bug fix * StoreMessageEventHandler.cs Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Service.cs 30 Aug 2002 10:59:09 -0000 1.2 +++ Service.cs 30 Aug 2002 12:39:33 -0000 1.3 @@ -9,6 +9,7 @@ */ using System; +using System.ComponentModel; namespace CSMail { @@ -21,12 +22,26 @@ private static readonly object ConnectionEvent = new object(); + private EventHandlerList events; + protected Service(Session session, URLName url) { this.session = session; this.url = url; } + protected EventHandlerList Events + { + get + { + if(events == null) + { + events = new EventHandlerList(); + } + return events; + } + } + public URLName URL { get @@ -73,17 +88,16 @@ throw new NotImplementedException(); } - [MailTODO] public event ConnectionEventHandler Connection { add { - throw new NotImplementedException(); + Events.AddHandler(ConnectionEvent, value); } remove { - throw new NotImplementedException(); + Events.RemoveHandler(ConnectionEvent, value); } } } -} +} \ No newline at end of file Index: Store.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Store.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Store.cs 30 Aug 2002 12:17:22 -0000 1.4 +++ Store.cs 30 Aug 2002 12:39:33 -0000 1.5 @@ -25,29 +25,27 @@ public abstract Folder this[string folderName] { get; } public abstract Folder this[URLName url] { get; } - [MailTODO] public event StoreMessageEventHandler StoreMessage { add { - throw new NotImplementedException(); + Events.AddHandler(StoreMessageEvent, value); } remove { - throw new NotImplementedException(); + Events.RemoveHandler(StoreMessageEvent, value); } } - [MailTODO] public event FolderEventHandler Folder { add { - throw new NotImplementedException(); + Events.AddHandler(FolderEvent, value); } remove { - throw new NotImplementedException(); + Events.RemoveHandler(FolderEvent, value); } } |
From: Gaurav V. <mas...@us...> - 2002-08-30 12:17:28
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv6513 Modified Files: ChangeLog Session.cs Store.cs StoreMessageEventHandler.cs Log Message: 2002-08-30 * Session.cs : GetStore(object) - Stubbed * Store.cs : OnStoreMessage - Parameter bug fix * StoreMessageEventHandler.cs : Fixed the typo bugs. It was earlier named StoreChangedEventHandler Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- ChangeLog 30 Aug 2002 11:14:43 -0000 1.17 +++ ChangeLog 30 Aug 2002 12:17:19 -0000 1.18 @@ -1,6 +1,14 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : GetStore(object) - Stubbed + * Store.cs : OnStoreMessage - Parameter bug fix + * StoreMessageEventHandler.cs + : Fixed the typo bugs. It was earlier named + StoreChangedEventHandler + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StoreMessageEventArgs.cs: Completed 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Session.cs 30 Aug 2002 10:31:26 -0000 1.9 +++ Session.cs 30 Aug 2002 12:17:20 -0000 1.10 @@ -43,6 +43,12 @@ } } + [MailTODO] + public Store GetStore(object key) + { + throw new NotImplementedException(); + } + private Session(Properties properties, Authenticator authenticator) { this.properties = properties; Index: Store.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Store.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Store.cs 30 Aug 2002 11:11:18 -0000 1.3 +++ Store.cs 30 Aug 2002 12:17:22 -0000 1.4 @@ -52,7 +52,7 @@ } [MailTODO] - public void OnStoreMessage(StoreChangedEventArgs e) + public void OnStoreMessage(StoreMessageEventArgs e) { throw new NotImplementedException(); } Index: StoreMessageEventHandler.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageEventHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StoreMessageEventHandler.cs 30 Aug 2002 11:11:18 -0000 1.1 +++ StoreMessageEventHandler.cs 30 Aug 2002 12:17:23 -0000 1.2 @@ -1,6 +1,6 @@ /** * Namespace: CSMail - * Delegate: StoreChangedEventHandler + * Delegate: StoreMessagesEventArgs * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net @@ -10,5 +10,5 @@ namespace CSMail { - public delegate void StoreChangedEventHandler(object sender, StoreChangedEventArgs e); -} \ No newline at end of file + public delegate void StoreMessageEventHandler(object sender, StoreMessageEventArgs e); +} |
From: Gaurav V. <mas...@us...> - 2002-08-30 11:14:45
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv21679 Modified Files: ChangeLog StoreMessageEventArgs.cs Log Message: 2002-08-30 * StoreMessageEventArgs.cs: Completed Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ChangeLog 30 Aug 2002 11:11:18 -0000 1.16 +++ ChangeLog 30 Aug 2002 11:14:43 -0000 1.17 @@ -1,6 +1,10 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * StoreMessageEventArgs.cs: Completed + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Store.cs : ctor(Session, URLName) - Made protected : event StoreChanged renamed to StoreMessage Index: StoreMessageEventArgs.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/StoreMessageEventArgs.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StoreMessageEventArgs.cs 30 Aug 2002 11:11:18 -0000 1.1 +++ StoreMessageEventArgs.cs 30 Aug 2002 11:14:43 -0000 1.2 @@ -14,10 +14,29 @@ { public class StoreMessageEventArgs { - [MailTODO] - public StoreMessageEventArgs() + private StoreMessageType type; + private string message; + + public StoreMessageEventArgs(StoreMessageType type, string message) { - throw new NotImplementedException(); + this.type = type; + this.message = message; + } + + public StoreMessageType MessageType + { + get + { + return type; + } + } + + public string Message + { + get + { + return message; + } } } -} \ No newline at end of file +} |
From: Gaurav V. <mas...@us...> - 2002-08-30 11:11:21
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv20446 Modified Files: ChangeLog Store.cs Added Files: StoreMessageEventArgs.cs StoreMessageEventHandler.cs StoreMessageType.cs Removed Files: StoreChangedEventArgs.cs StoreChangedEventHandler.cs Log Message: 2002-08-30 * Store.cs : ctor(Session, URLName) - Made protected : event StoreChanged renamed to StoreMessage : OnStoreMessage(...) - Stubbed : OnFolder(...) - Stubbed * StoreChangedEventArgs.cs => StoreMessageEventArgs.cs * StoreChangedEventHandles.cs => StoreMessageEventHandler.cs * StoreMessageType.cs : Added enumeration --- NEW FILE --- /** * Namespace: CSMail * Class: StoreMessageEventArgs * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; namespace CSMail { public class StoreMessageEventArgs { [MailTODO] public StoreMessageEventArgs() { throw new NotImplementedException(); } } } --- NEW FILE --- /** * Namespace: CSMail * Delegate: StoreChangedEventHandler * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public delegate void StoreChangedEventHandler(object sender, StoreChangedEventArgs e); } --- NEW FILE --- /** * Namespace: CSMail * Class: StoreMessageType * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public enum StoreMessageType { NotSet, Alert, Notice } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ChangeLog 30 Aug 2002 10:59:09 -0000 1.15 +++ ChangeLog 30 Aug 2002 11:11:18 -0000 1.16 @@ -1,6 +1,17 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Store.cs : ctor(Session, URLName) + - Made protected + : event StoreChanged renamed to StoreMessage + : OnStoreMessage(...) - Stubbed + : OnFolder(...) - Stubbed + * StoreChangedEventArgs.cs => StoreMessageEventArgs.cs + * StoreChangedEventHandles.cs => StoreMessageEventHandler.cs + * StoreMessageType.cs : Added enumeration + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Store.cs : event Connection - Stubbed * Service.cs : event Store - Stubbed * StoreChangedEventArgs.cs: Added class Index: Store.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Store.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Store.cs 30 Aug 2002 10:59:09 -0000 1.2 +++ Store.cs 30 Aug 2002 11:11:18 -0000 1.3 @@ -14,7 +14,10 @@ { public abstract class Store: Service { - public Store(Session session, URLName url): base(session, url) + private static readonly object FolderEvent = new object(); + private static readonly object StoreMessageEvent = new object(); + + protected Store(Session session, URLName url): base(session, url) { } @@ -23,7 +26,7 @@ public abstract Folder this[URLName url] { get; } [MailTODO] - public event StoreChangedEventHandler StoreChanged + public event StoreMessageEventHandler StoreMessage { add { @@ -46,6 +49,18 @@ { throw new NotImplementedException(); } + } + + [MailTODO] + public void OnStoreMessage(StoreChangedEventArgs e) + { + throw new NotImplementedException(); + } + + [MailTODO] + public void OnFolder(FolderEventArgs e) + { + throw new NotImplementedException(); } } } --- StoreChangedEventArgs.cs DELETED --- --- StoreChangedEventHandler.cs DELETED --- |
From: Gaurav V. <mas...@us...> - 2002-08-30 10:59:13
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv16789 Modified Files: ChangeLog Service.cs Store.cs Added Files: StoreChangedEventArgs.cs StoreChangedEventHandler.cs Log Message: 2002-08-30 * Store.cs : event Connection - Stubbed * Service.cs : event Store - Stubbed * StoreChangedEventArgs.cs: Added class * StoreChangedEventHandles.cs : Added delegate --- NEW FILE --- /** * Namespace: CSMail * Class: StoreChangedEventArgs * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ using System; namespace CSMail { public class StoreChangedEventArgs { [MailTODO] public StoreChangedEventArgs() { throw new NotImplementedException(); } } } --- NEW FILE --- /** * Namespace: CSMail * Delegate: StoreChangedEventHandler * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public delegate void StoreChangedEventHandler(object sender, StoreChangedEventArgs e); } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ChangeLog 30 Aug 2002 10:31:26 -0000 1.14 +++ ChangeLog 30 Aug 2002 10:59:09 -0000 1.15 @@ -1,6 +1,14 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Store.cs : event Connection - Stubbed + * Service.cs : event Store - Stubbed + * StoreChangedEventArgs.cs: Added class + * StoreChangedEventHandles.cs + : Added delegate + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : Providers { get; } - Implemented : Minor changes due to CSMail.Utils.Properties * EMailAddress.cs : Equals(IAddress) - Changed criterion Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Service.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ Service.cs 30 Aug 2002 10:59:09 -0000 1.2 @@ -19,6 +19,8 @@ protected Session session; protected URLName url; + private static readonly object ConnectionEvent = new object(); + protected Service(Session session, URLName url) { this.session = session; @@ -46,7 +48,7 @@ { throw new NotImplementedException(); } - + [MailTODO] public void Connect() { @@ -64,11 +66,24 @@ { throw new NotImplementedException(); } - + [MailTODO] ~Service() { throw new NotImplementedException(); + } + + [MailTODO] + public event ConnectionEventHandler Connection + { + add + { + throw new NotImplementedException(); + } + remove + { + throw new NotImplementedException(); + } } } } Index: Store.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Store.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Store.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ Store.cs 30 Aug 2002 10:59:09 -0000 1.2 @@ -8,6 +8,8 @@ * (C) Gaurav Vaish (2002) */ +using System; + namespace CSMail { public abstract class Store: Service @@ -15,9 +17,35 @@ public Store(Session session, URLName url): base(session, url) { } - + public abstract Folder DefaultFolder { get; } public abstract Folder this[string folderName] { get; } public abstract Folder this[URLName url] { get; } + + [MailTODO] + public event StoreChangedEventHandler StoreChanged + { + add + { + throw new NotImplementedException(); + } + remove + { + throw new NotImplementedException(); + } + } + + [MailTODO] + public event FolderEventHandler Folder + { + add + { + throw new NotImplementedException(); + } + remove + { + throw new NotImplementedException(); + } + } } } |
From: Gaurav V. <mas...@us...> - 2002-08-30 10:32:44
|
Update of /cvsroot/csmail/csmail/src/CSMail.Utils In directory usw-pr-cvs1:/tmp/cvs-serv10765/CSMail.Utils Modified Files: ChangeLog Properties.cs Log Message: 2002-08-30 * Properties.cs : Changed value type to object. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.Utils/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ChangeLog 29 Aug 2002 10:13:50 -0000 1.7 +++ ChangeLog 30 Aug 2002 10:32:41 -0000 1.8 @@ -1,4 +1,8 @@ +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Properties.cs : Changed value type to object. + 2002-08-29 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * StringUtils.cs : New class in lieu of Utils. Index: Properties.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail.Utils/Properties.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Properties.cs 29 Aug 2002 10:02:02 -0000 1.4 +++ Properties.cs 30 Aug 2002 10:32:41 -0000 1.5 @@ -30,11 +30,11 @@ { } - public string this[string key] + public object this[string key] { get { - return (string)base[key]; + return base[key]; } set { |
From: Gaurav V. <mas...@us...> - 2002-08-30 10:31:30
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv10314 Modified Files: ChangeLog EMailAddress.cs ProviderList.cs Session.cs Added Files: ProviderSearchType.cs StoreSearchType.cs Log Message: 2002-08-30 * Session.cs : Providers { get; } - Implemented : Minor changes due to CSMail.Utils.Properties * EMailAddress.cs : Equals(IAddress) - Changed criterion : operator == - Implemented : operator != - Implemented : GetHashCode() - Implemented * StoreSearchType.cs : Added enumeration. * ProviderList.cs : this[,] - Changed second parameter type to object. Was string. --- NEW FILE --- /** * Namespace: CSMail * Class: StoreSearchType * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public enum StoreSearchType { ClassName, Index, URLName } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ChangeLog 30 Aug 2002 08:41:28 -0000 1.13 +++ ChangeLog 30 Aug 2002 10:31:26 -0000 1.14 @@ -1,6 +1,18 @@ 2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : Providers { get; } - Implemented + : Minor changes due to CSMail.Utils.Properties + * EMailAddress.cs : Equals(IAddress) - Changed criterion + : operator == - Implemented + : operator != - Implemented + : GetHashCode() - Implemented + * StoreSearchType.cs : Added enumeration. + * ProviderList.cs : this[,] - Changed second parameter type + to object. Was string. + +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : providers - Changed to ProviderList : provByProto, provByClass - Removed members Index: EMailAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/EMailAddress.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EMailAddress.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ EMailAddress.cs 30 Aug 2002 10:31:26 -0000 1.2 @@ -17,18 +17,18 @@ private string user; private string host; private string name; - + public EMailAddress(string user, string host) { this.user = user; this.host = host; } - + public EMailAddress(string name, string user, string host): this(user, host) { this.name = name; } - + public string User { get @@ -36,7 +36,7 @@ return user; } } - + public string Host { get @@ -44,7 +44,7 @@ return host; } } - + public string Name { get @@ -52,7 +52,7 @@ return name; } } - + public AddressType AddressType { get @@ -60,18 +60,53 @@ return AddressType.EmailAddress; } } - + public bool Equals(IAddress address) { if(address is EMailAddress) { EMailAddress that = (EMailAddress)address; - if(this.User == that.User && this.Host == that.Host && this.Name == that.Name) + if(this.User == that.User && this.Host == that.Host) return true; } return false; } - + + public override bool Equals(object address) + { + if(address is EMailAddress) + { + EMailAddress that = (EMailAddress)address; + if(this.User == that.User && this.Host == that.Host) + return true; + } + return false; + } + + public static bool operator == (EMailAddress left, EMailAddress right) + { + if(left == null && right == null) + { + return true; + } + if(left != null && right != null) + { + return left.Equals(right); + } + return false; + } + + public static bool operator != (EMailAddress left, EMailAddress right) + { + return !(left == right); + } + + public override int GetHashCode() + { + string em = user.ToLower() + "@" + host.ToLower(); + return em.GetHashCode(); + } + public override string ToString() { string retVal = String.Empty; @@ -87,4 +122,4 @@ return retVal; } } -} +} \ No newline at end of file Index: ProviderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderList.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ProviderList.cs 30 Aug 2002 08:41:28 -0000 1.3 +++ ProviderList.cs 30 Aug 2002 10:31:26 -0000 1.4 @@ -22,7 +22,7 @@ } [MailTODO] - public Provider this[ProviderSearchType type, string key] + public Provider this[ProviderSearchType type, object key] { get { Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Session.cs 30 Aug 2002 08:41:28 -0000 1.8 +++ Session.cs 30 Aug 2002 10:31:26 -0000 1.9 @@ -35,6 +35,14 @@ { } + public ProviderList Providers + { + get + { + return providers; + } + } + private Session(Properties properties, Authenticator authenticator) { this.properties = properties; @@ -49,7 +57,7 @@ addrMap = new Properties(); dirsToSearch = new ArrayList(); - debug = bool.Parse(this.properties["CSMail.debug"]); + debug = bool.Parse((string)this.properties["CSMail.debug"]); this.LoadProviders(); this.LoadAddressMap(); @@ -141,6 +149,7 @@ { Provider toAdd = new Provider(currentLine); providers.Add(toAdd); + properties["CSMail." + toAdd.ClassName + ".class"] = toAdd; //provByProto.Add(toAdd.Protocol, toAdd); //provByClass.Add(toAdd.ClassName, toAdd); } @@ -200,8 +209,8 @@ private void SetDirsToSearch() { - string cshome = properties["CSMail.home"]; - string[] cspath = StringUtils.SeparatePath(properties["CSMail.path"]); + string cshome = (string)properties["CSMail.home"]; + string[] cspath = StringUtils.SeparatePath((string)properties["CSMail.path"]); string cwd = Environment.CurrentDirectory; string configP = Path.DirectorySeparatorChar + "config"; |
From: Gaurav V. <mas...@us...> - 2002-08-30 10:21:22
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv7649 Removed Files: ProviderSearchType.cs Log Message: 2002-08-30 * ProviderSearchType.cs - Removed --- ProviderSearchType.cs DELETED --- |
From: Gaurav V. <mas...@us...> - 2002-08-30 08:41:32
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv14026 Modified Files: ChangeLog Provider.cs ProviderList.cs Session.cs Added Files: ProviderSearchType.cs Log Message: 2002-08-30 * Session.cs : providers - Changed to ProviderList : provByProto, provByClass - Removed members : LoadProviders - Implemented : LoadAddressMap() - Implemented : LoadAddressMap(string) - Implemented : LoadAddressMap(string, bool) - Implemented : * Provider.cs : ToString() - Added assembly : SetProperly(...) - Added assembly : operator == - Added null comparision * ProviderList.cs : Add(Provider) - Stubbed : this[ProviderSearchType, string] - Stubbed * ProviderSearchType.cs : Added enumeration. --- NEW FILE --- /** * Namespace: CSMail * Class: ProviderSearchType * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public enum ProviderSearchType { ClassName, Protocol } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ChangeLog 29 Aug 2002 11:32:31 -0000 1.12 +++ ChangeLog 30 Aug 2002 08:41:28 -0000 1.13 @@ -1,4 +1,24 @@ +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Session.cs : providers - Changed to ProviderList + : provByProto, + provByClass - Removed members + : LoadProviders - Implemented + : LoadAddressMap() - Implemented + : LoadAddressMap(string) + - Implemented + : LoadAddressMap(string, bool) + - Implemented + : + * Provider.cs : ToString() - Added assembly + : SetProperly(...) - Added assembly + : operator == - Added null comparision + * ProviderList.cs : Add(Provider) - Stubbed + : this[ProviderSearchType, string] + - Stubbed + * ProviderSearchType.cs : Added enumeration. + 2002-08-29 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * Constants.cs : Added class. Index: Provider.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Provider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Provider.cs 29 Aug 2002 11:32:31 -0000 1.4 +++ Provider.cs 30 Aug 2002 08:41:28 -0000 1.5 @@ -36,7 +36,8 @@ /// <summary> /// Format of rawline: /// protocol = <proto>; type = <type>; class = <class>; - /// vendor = <vendor>; version = <version> + /// 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> @@ -87,6 +88,8 @@ break; case "version" : this.version = value; break; + case "assembly": this.assembly = value; + break; default : break; } } @@ -170,6 +173,11 @@ public static bool operator == (Provider obj1, Provider obj2) { + if(obj1 == null && obj2 == null) + { + return true; + } + if(obj1 != null && obj2 != null) { return obj1.Equals(obj2); @@ -190,7 +198,7 @@ public override string ToString() { String retVal = "CSMail.Provider["; - switch(type) + switch(this.type) { case ProviderType.Store: retVal += "STORE,"; break; @@ -198,11 +206,13 @@ break; default : break; } - retVal += (protocol + "," + className); + retVal += (this.protocol + "," + this.className); + if(assembly != null) + retVal += ("," + this.assembly); if(vendor != null) - retVal += ("," + vendor); + retVal += ("," + this.vendor); if(version != null) - retVal += ("," + version); + retVal += ("," + this.version); retVal += "]"; return retVal; } Index: ProviderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ProviderList.cs 29 Aug 2002 11:32:31 -0000 1.2 +++ ProviderList.cs 30 Aug 2002 08:41:28 -0000 1.3 @@ -8,6 +8,7 @@ * (C) Gaurav Vaish (2002) */ +using System; using System.Collections; namespace CSMail @@ -18,6 +19,21 @@ public ProviderList() { + } + + [MailTODO] + public Provider this[ProviderSearchType type, string key] + { + get + { + throw new NotImplementedException(); + } + } + + [MailTODO] + public int Add(Provider prov) + { + throw new NotImplementedException(); } public IEnumerator GetEnumerator() Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Session.cs 29 Aug 2002 11:32:31 -0000 1.7 +++ Session.cs 30 Aug 2002 08:41:28 -0000 1.8 @@ -20,9 +20,9 @@ private readonly Properties properties; private readonly Authenticator authenticator; private Hashtable authTable; - private ArrayList providers; - private Hashtable provByProto; - private Hashtable provByClass; + private ProviderList providers; + //private Hashtable provByProto; + //private Hashtable provByClass; private Properties addrMap; private bool debug; @@ -43,9 +43,9 @@ this.areDirsSet = false; authTable = new Hashtable(); - providers = new ArrayList(); - provByProto = new Hashtable(); - provByClass = new Hashtable(); + providers = new ProviderList(); + //provByProto = new Hashtable(); + //provByClass = new Hashtable(); addrMap = new Properties(); dirsToSearch = new ArrayList(); @@ -110,7 +110,9 @@ { // Load from the file. if(!areDirsSet) + { SetDirsToSearch(); + } foreach(string current in dirsToSearch) { LoadProviders(current); @@ -123,12 +125,27 @@ LoadProviders(path, true); } - [MailTODO] private void LoadProviders(string path, bool fromDefault) { string file = path + Path.DirectorySeparatorChar; file += (fromDefault ? Constants.ProviderFileDefault : Constants.ProviderFile); - throw new NotImplementedException(); + + if(File.Exists(file)) + { + TextReader reader = new StreamReader(File.OpenRead(file)); + string currentLine = String.Empty; + while( (currentLine = reader.ReadLine()) != null) + { + currentLine = currentLine.Trim(); + if(currentLine.Length > 0 && currentLine[0] != '#') + { + Provider toAdd = new Provider(currentLine); + providers.Add(toAdd); + //provByProto.Add(toAdd.Protocol, toAdd); + //provByClass.Add(toAdd.ClassName, toAdd); + } + } + } } /// <summary> @@ -141,13 +158,44 @@ /// /// * To be provided later by CSMail itself. /// </summary> - [MonoTODO] private void LoadAddressMap() { // Load from the file. if(!areDirsSet) SetDirsToSearch(); - throw new NotImplementedException(); + foreach(string current in dirsToSearch) + { + LoadAddressMap(current); + } + } + + private void LoadAddressMap(string path) + { + LoadAddressMap(path, true); + LoadAddressMap(path, false); + } + + private void LoadAddressMap(string path, bool fromDefault) + { + string file = path + Path.DirectorySeparatorChar; + file += (fromDefault ? Constants.AddressMapFile : Constants.AddressMapFileDefault); + + if(File.Exists(file)) + { + TextReader reader = new StreamReader(File.OpenRead(file)); + string currentLine = String.Empty; + string key; + string value; + while( (currentLine = reader.ReadLine()) != null) + { + currentLine = currentLine.Trim(); + if(currentLine.Length > 0 && currentLine[0] != '#') + { + Properties.GetKeyValue(currentLine, out key, out value); + addrMap[key] = value; + } + } + } } private void SetDirsToSearch() |
From: Gaurav V. <mas...@us...> - 2002-08-30 07:08:02
|
Update of /cvsroot/csmail/csmail In directory usw-pr-cvs1:/tmp/cvs-serv22134 Modified Files: README ChangeLog Added Files: LICENSE Log Message: 2002-08-30 * Added file LICENSE. * Typo in "README" fixed --- NEW FILE --- See the accompanied file "COPYING". Index: README =================================================================== RCS file: /cvsroot/csmail/csmail/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- README 20 Jun 2002 02:28:43 -0000 1.1 +++ README 30 Aug 2002 07:08:00 -0000 1.2 @@ -10,7 +10,7 @@ |-> Source code of classes. | test/ | - |-> Tests for the classes. Bases on NUnit + |-> Tests for the classes. Based on NUnit | nant/ | |-> NAnt source. Used for building the classes. Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ChangeLog 25 Jul 2002 09:32:06 -0000 1.3 +++ ChangeLog 30 Aug 2002 07:08:00 -0000 1.4 @@ -1,4 +1,9 @@ +2002-08-30 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * Added file LICENSE. + * Typo in "README" fixed + 2002-07-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * IMPORTANT UPDATE (file COPYING): |
From: Gaurav V. <mas...@us...> - 2002-08-29 11:32:34
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv27597 Modified Files: ChangeLog Provider.cs ProviderList.cs ProviderType.cs Session.cs Added Files: Constants.cs Log Message: 2002-08-29 * Constants.cs : Added class. * Provider.cs : Modified/Added the following : ctor(...) - Added parameter assembly : ctor(string) - Implemented : IsRequiredSet - Implemented : SetProperly(...) - Implemented : ParseType(...) - Implemented : AssemblyName - Implemented : Equals - Implemented : operator == - Implemented : operator != - Implemented : GetHashcode() - Implemented * ProviderCollected / ProviderList : Previous change reverted. * ProviderType.cs : Added element "NotSet" * Session.cs : LoadProviders() - Implemented : LoadProviders(string) - Implemented : LoadProviders(string, bool) - Stubbed : LoadAddressMap() - Stubbed : SetDirsToSearch() - Implemented --- NEW FILE --- /** * Namespace: CSMail * Class: Constants * * Author: Gaurav Vaish * Maintainer: mastergaurav AT users DOT sf DOT net * * (C) Gaurav Vaish (2002) */ namespace CSMail { public class Constants { public const string ProviderFile = "CSMail.providers"; public const string ProviderFileDefault = "CSMail.providers.default"; public const string AddressMapFile = "CSMail.adress.map"; public const string AddressMapFileDefault = "CSMail.adress.map.default"; public const int Pop3PortDefault = 110; public const int ImapPortDefault = 143; public const int SmtpPortDefault = 25; public const int NntpPortDefault = 119; } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ChangeLog 29 Aug 2002 07:03:03 -0000 1.11 +++ ChangeLog 29 Aug 2002 11:32:31 -0000 1.12 @@ -1,6 +1,35 @@ 2002-08-29 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Constants.cs : Added class. + * Provider.cs : Modified/Added the following + : ctor(...) - Added parameter assembly + : ctor(string) - Implemented + : IsRequiredSet - Implemented + : SetProperly(...) - Implemented + : ParseType(...) - Implemented + : AssemblyName - Implemented + : Equals - Implemented + : operator == - Implemented + : operator != - Implemented + : GetHashcode() - Implemented + * ProviderCollected / ProviderList + : Previous change reverted. + * ProviderType.cs : Added element "NotSet" + * Session.cs : LoadProviders() - Implemented + : LoadProviders(string) + - Implemented + : LoadProviders(string, bool) + - Stubbed + : LoadAddressMap() - Stubbed + : SetDirsToSearch() - Implemented + +2002-08-29 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + + * ProviderType.cs : Added property "NotSet". + +2002-08-29 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * ProviderCollection.cs : Renamed to ProviderList * ProviderList.cs : Renamed version of ProviderCollection * Session.cs : Stubbed LoadProviders, LoadAddressMap Index: Provider.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Provider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Provider.cs 29 Aug 2002 04:10:11 -0000 1.3 +++ Provider.cs 29 Aug 2002 11:32:31 -0000 1.4 @@ -9,6 +9,7 @@ */ using System; +using CSMail.Utils; namespace CSMail { @@ -16,20 +17,91 @@ { private string className; private string protocol; + private string assembly; private ProviderType type; private string vendor; private string version; - public Provider(ProviderType type, string protocol, string className, - string vendor, string version) + public Provider(ProviderType type, string assembly, string protocol, + string className, string vendor, string version) { this.type = type; + this.assembly = assembly; this.protocol = protocol; this.className = className; this.vendor = vendor; this.version = version; } + /// <summary> + /// Format of rawline: + /// protocol = <proto>; type = <type>; class = <class>; + /// vendor = <vendor>; version = <version> + /// Note that they may appear in any order. Vendor and version + /// may be missing. '=' may be replaced by a ':' + /// </summary> + internal Provider(string rawLine) + { + rawLine = rawLine.Trim(); + string[] pairs = rawLine.Split(new char[] { ';' }); + if(pairs == null || pairs.Length < 3) + throw new ArgumentException("[Provider] Failed to extract minimal parameters"); + string key; + string value; + + foreach(string current in pairs) + { + string trimmed = current.Trim(); + Properties.GetKeyValue(current, out key, out value); + if(key != null && value != null && key.Length > 0 && value.Length > 0) + { + SetProperly(key, value); + } + } + if(!IsRequiredSet()) + throw new ArgumentException("[Provider] Failed to extract required parameters"); + } + + private bool IsRequiredSet() + { + bool retVal = true; + retVal &= (this.type != ProviderType.NotSet); + retVal &= (this.protocol != null); + retVal &= (this.className != null); + + return retVal; + } + + private void SetProperly(string key, string value) + { + key = key.ToLower(); + switch(key) + { + case "protocol": this.protocol = value; + break; + case "type" : this.type = ParseType(value); + break; + case "class" : this.className = value; + break; + case "vendor" : this.vendor = value; + break; + case "version" : this.version = value; + break; + default : break; + } + } + + private ProviderType ParseType(string typeStr) + { + typeStr = typeStr.ToLower(); + switch(typeStr) + { + case "store" : return ProviderType.Store; + case "transport": return ProviderType.Transport; + } + return ProviderType.NotSet; + } + public string ClassName { get @@ -38,6 +110,14 @@ } } + public string AssemblyName + { + get + { + return assembly; + } + } + public string Protocol { get @@ -68,6 +148,43 @@ { return version; } + } + + public override bool Equals(object obj) + { + if(obj != null && obj is Provider) + { + Provider prov = (Provider)obj; + bool retVal = true; + retVal &= (this.assembly == prov.assembly); + retVal &= (this.className == prov.className); + retVal &= (this.protocol == prov.protocol); + retVal &= (this.type == prov.type); + retVal &= (this.vendor == prov.vendor); + retVal &= (this.version == prov.version); + + return retVal; + } + return false; + } + + public static bool operator == (Provider obj1, Provider obj2) + { + if(obj1 != null && obj2 != null) + { + return obj1.Equals(obj2); + } + return false; + } + + public static bool operator != (Provider obj1, Provider obj2) + { + return !(obj1 == obj2); + } + + public override int GetHashCode() + { + return ToString().GetHashCode(); } public override string ToString() Index: ProviderList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ProviderList.cs 29 Aug 2002 07:03:04 -0000 1.1 +++ ProviderList.cs 29 Aug 2002 11:32:31 -0000 1.2 @@ -16,10 +16,10 @@ { private ArrayList providers = new ArrayList(); - public ProviderCollection() + public ProviderList() { } - + public IEnumerator GetEnumerator() { return providers.GetEnumerator(); Index: ProviderType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ProviderType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ProviderType.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ ProviderType.cs 29 Aug 2002 11:32:31 -0000 1.2 @@ -12,7 +12,8 @@ { public enum ProviderType { + NotSet, Store, Transport } -} +} \ No newline at end of file Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Session.cs 29 Aug 2002 07:03:04 -0000 1.6 +++ Session.cs 29 Aug 2002 11:32:31 -0000 1.7 @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.IO; using CSMail.Utils; namespace CSMail @@ -27,7 +28,8 @@ private static Session defaultSession; - private const string CSMailVersion = "0.1"; + private ArrayList dirsToSearch; + private bool areDirsSet; private Session() { @@ -38,12 +40,14 @@ this.properties = properties; this.authenticator = authenticator; this.debug = false; + this.areDirsSet = false; - authTable = new Hashtable(); - providers = new ArrayList(); - provByProto = new Hashtable(); - provByClass = new Hashtable(); - addrMap = new Properties(); + authTable = new Hashtable(); + providers = new ArrayList(); + provByProto = new Hashtable(); + provByClass = new Hashtable(); + addrMap = new Properties(); + dirsToSearch = new ArrayList(); debug = bool.Parse(this.properties["CSMail.debug"]); @@ -99,12 +103,32 @@ /// 3. $PWD/config/CSMail.properties /// 4. $PWD/config/CSMail.properties.default /// 5. Load default providers* - /// + /// /// * To be provided later by CSMail itself. /// </summary> private void LoadProviders() { // Load from the file. + if(!areDirsSet) + SetDirsToSearch(); + foreach(string current in dirsToSearch) + { + LoadProviders(current); + } + } + + private void LoadProviders(string path) + { + LoadProviders(path, false); + LoadProviders(path, true); + } + + [MailTODO] + private void LoadProviders(string path, bool fromDefault) + { + string file = path + Path.DirectorySeparatorChar; + file += (fromDefault ? Constants.ProviderFileDefault : Constants.ProviderFile); + throw new NotImplementedException(); } /// <summary> @@ -114,12 +138,39 @@ /// 3. $PWD/config/CSMail.adress.map /// 4. $PWD/config/CSMail.adress.map.default /// 5. Load default map* - /// + /// /// * To be provided later by CSMail itself. /// </summary> + [MonoTODO] private void LoadAddressMap() { // Load from the file. + if(!areDirsSet) + SetDirsToSearch(); + throw new NotImplementedException(); + } + + private void SetDirsToSearch() + { + string cshome = properties["CSMail.home"]; + string[] cspath = StringUtils.SeparatePath(properties["CSMail.path"]); + string cwd = Environment.CurrentDirectory; + string configP = Path.DirectorySeparatorChar + "config"; + + dirsToSearch.Add(cshome + configP); + foreach(string current in cspath) + { + if(!dirsToSearch.Contains(current + configP)) + { + dirsToSearch.Add(current + configP); + } + } + if(!dirsToSearch.Contains(cwd + configP)) + { + dirsToSearch.Add(cwd + configP); + } + + this.areDirsSet = true; } } } |