[csmaild-cvs] csmaild/src/Common FlagList.cs,NONE,1.1 Common.2002.csproj,1.3,1.4 Common.csproj,1.7,1
Brought to you by:
tamc
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv18360/src/Common Modified Files: Common.2002.csproj Common.csproj Mailbox.cs Message.cs MessageCollection.cs Added Files: FlagList.cs Log Message: Updated VS.NET 2002 project files to reflect currect VS.NET 2003 project Moved message flags into a FlagList class (this makes flag extensions easier to support) Modified the TestClient for easier debugging of the server Added BASE64 decoder to common library Moved argument parsing from ImapCommand into the newly created types (representing various arguments parsed from the client) Added support for AUTHENTICATE PLAIN Added TODO document in the docs !!Some stuff surely has been broken with all this code moving around, it'll compile and run, but some functionality hasn't been verified yet!! --- NEW FILE: FlagList.cs --- using System; using System.Collections.Specialized; namespace Common { public class FlagList { private bool mAnswered; private bool mFlagged; private bool mDeleted; private bool mSeen; private bool mDraft; private StringCollection mKeywords; public bool Answered { get { return mAnswered; } set { mAnswered = value; } } public bool Flagged { get { return mFlagged; } set { mFlagged = value; } } public bool Deleted { get { return mDeleted; } set { mDeleted = value; } } public bool Seen { get { return mSeen; } set { mSeen = value; } } public bool Draft { get { return mDraft; } set { mDraft = value; } } public StringCollection Keywords { get { if(mKeywords == null) mKeywords = new StringCollection(); return mKeywords; } } public void AddFlags(FlagList list) { } public void RemoveFlags(FlagList list) { } } } Index: Common.2002.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Common.2002.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Common.2002.csproj 1 Aug 2003 22:02:37 -0000 1.3 --- Common.2002.csproj 8 Aug 2003 22:39:26 -0000 1.4 *************** *** 88,91 **** --- 88,96 ---- /> <File + RelPath = "FlagList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Mailbox.cs" SubType = "Code" *************** *** 109,112 **** --- 114,122 ---- <File RelPath = "User.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Encoders\Base64.cs" SubType = "Code" BuildAction = "Compile" Index: Common.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Common.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Common.csproj 1 Aug 2003 22:02:37 -0000 1.7 --- Common.csproj 8 Aug 2003 22:39:26 -0000 1.8 *************** *** 95,98 **** --- 95,103 ---- /> <File + RelPath = "FlagList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Mailbox.cs" SubType = "Code" *************** *** 116,119 **** --- 121,129 ---- <File RelPath = "User.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Encoders\Base64.cs" SubType = "Code" BuildAction = "Compile" Index: Mailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Mailbox.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Mailbox.cs 5 Aug 2003 01:42:09 -0000 1.11 --- Mailbox.cs 8 Aug 2003 22:39:26 -0000 1.12 *************** *** 131,135 **** /// The number of messages in this mailbox /// </summary> ! public int MessageCount { get --- 131,135 ---- /// The number of messages in this mailbox /// </summary> ! public uint MessageCount { get *************** *** 163,167 **** int rv = 0; foreach(Message msg in Messages) ! if(!msg.Seen) ++rv; return rv; --- 163,167 ---- int rv = 0; foreach(Message msg in Messages) ! if(!msg.Flags.Seen) ++rv; return rv; *************** *** 175,179 **** // TODO: make this more efficient then having to load all the messages for(uint idx = 0; idx < Messages.Count; ++idx) ! if(!Messages.BySeq(idx+1).Seen) return idx; return 0; --- 175,179 ---- // TODO: make this more efficient then having to load all the messages for(uint idx = 0; idx < Messages.Count; ++idx) ! if(!Messages.BySeq(idx+1).Flags.Seen) return idx; return 0; Index: Message.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Message.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Message.cs 5 Aug 2003 01:42:09 -0000 1.8 --- Message.cs 8 Aug 2003 22:39:26 -0000 1.9 *************** *** 16,24 **** private uint mUniqueId; ! private bool mSeen; ! private bool mAnswered; ! private bool mFlagged; ! private bool mDeleted; ! private bool mDraft; private bool mRecent; private int mSize; --- 16,20 ---- private uint mUniqueId; ! private FlagList mFlags; private bool mRecent; private int mSize; *************** *** 49,124 **** } ! /// <summary> ! /// Whether the message has been seen ! /// </summary> ! public bool Seen ! { ! get ! { ! return mSeen; ! } ! set ! { ! mSeen = value; ! } ! } ! ! /// <summary> ! /// Whether the message has been answered ! /// </summary> ! public bool Answered ! { ! get ! { ! return mAnswered; ! } ! set ! { ! mAnswered = value; ! } ! } ! ! /// <summary> ! /// Whether the message has been flagged ! /// </summary> ! public bool Flagged ! { ! get ! { ! return mFlagged; ! } ! set ! { ! mFlagged = value; ! } ! } ! ! /// <summary> ! /// Whether the message has been deleted ! /// </summary> ! public bool Deleted ! { ! get ! { ! return mDeleted; ! } ! set ! { ! mDeleted = value; ! } ! } ! ! /// <summary> ! /// Whether the message is a draft ! /// </summary> ! public bool Draft { get { ! return mDraft; } set { ! mDraft = value; } } --- 45,57 ---- } ! public FlagList Flags { get { ! return mFlags; } set { ! mFlags = value; } } *************** *** 189,197 **** mUniqueId = uid; ! mSeen = seen; ! mAnswered = answered; ! mFlagged = flagged; ! mDeleted = deleted; ! mDraft = draft; mRecent = recent; mSize = size; --- 122,131 ---- mUniqueId = uid; ! mFlags = new FlagList(); ! mFlags.Seen = seen; ! mFlags.Answered = answered; ! mFlags.Flagged = flagged; ! mFlags.Deleted = deleted; ! mFlags.Draft = draft; mRecent = recent; mSize = size; Index: MessageCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MessageCollection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MessageCollection.cs 5 Aug 2003 01:42:09 -0000 1.5 --- MessageCollection.cs 8 Aug 2003 22:39:26 -0000 1.6 *************** *** 31,39 **** } ! public int Count { get { ! return mSequenceList.Count; } } --- 31,39 ---- } ! public uint Count { get { ! return (uint)mSequenceList.Count; } } *************** *** 60,64 **** { uint uid = mMailbox.NextUniqueIdIncrement; ! Message newMsg = new Message(mMailstoreProvider, mMailbox, null, uid, msg.Seen, msg.Answered, msg.Flagged, msg.Deleted, msg.Draft, true, msg.Size, msg.InternalDate); mMailstoreProvider.InsertMessage(newMsg, msg.RawRfc2822Message); --- 60,64 ---- { uint uid = mMailbox.NextUniqueIdIncrement; ! Message newMsg = new Message(mMailstoreProvider, mMailbox, null, uid, msg.Flags.Seen, msg.Flags.Answered, msg.Flags.Flagged, msg.Flags.Deleted, msg.Flags.Draft, true, msg.Size, msg.InternalDate); mMailstoreProvider.InsertMessage(newMsg, msg.RawRfc2822Message); |