Revision: 126
http://svn.sourceforge.net/nmailserver/?rev=126&view=rev
Author: tmyroadctfig
Date: 2007-02-02 01:20:36 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Some minor changes and added licenses to some files.
Modified Paths:
--------------
NMail/trunk/NMail.WebAccess/App_Code/Helper.cs
NMail/trunk/NMail.WebAccess/App_Code/HtmlEscaper.cs
NMail/trunk/NMail.WebAccess/App_Code/MailListDataSource.cs
NMail/trunk/NMail.WebAccess/App_Code/RowClickableGridView.cs
NMail/trunk/NMail.WebAccess/App_Code/SubscribedFolderDataSource.cs
NMail/trunk/NMail.WebAccess/App_Themes/Default/Default.skin
NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx
NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx.cs
NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx
NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx.cs
NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx
NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx.cs
NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx
NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx.cs
NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx
NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx.cs
NMail/trunk/NMail.WebAccess/Login.aspx
NMail/trunk/NMail.WebAccess/Login.aspx.cs
NMail/trunk/NMail.WebAccess/Mail.aspx
NMail/trunk/NMail.WebAccess/Mail.aspx.cs
Added Paths:
-----------
NMail/trunk/NMail.WebAccess/Controls/Mail/MailError.aspx
NMail/trunk/NMail.WebAccess/ErrorHandler.aspx
NMail/trunk/NMail.WebAccess/ErrorHandler.aspx.cs
Modified: NMail/trunk/NMail.WebAccess/App_Code/Helper.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Code/Helper.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Code/Helper.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -14,8 +31,16 @@
namespace NMail.WebAccess
{
+ /// <summary>
+ /// A helper class for converting data types, etc.
+ /// </summary>
public static class Helper
{
+ /// <summary>
+ /// Gets the body structure from a serialized version.
+ /// </summary>
+ /// <param name="serializedBody">The version to de-serialize.</param>
+ /// <returns>The body structure.</returns>
public static BodyStructure GetBodyStructure(BodyStructureSerializer serializedBody)
{
ByteString headerData = new ByteString(Convert.FromBase64String(serializedBody.Headers.Headers), Encoding.ASCII);
@@ -30,6 +55,11 @@
return result;
}
+ /// <summary>
+ /// Gets the message envelope from a serialized version.
+ /// </summary>
+ /// <param name="es">The version to de-serialize.</param>
+ /// <returns>The envelope.</returns>
public static Envelope GetEnvelope(EnvelopeSerializer es)
{
Envelope result = new Envelope(es.From, es.Date, es.Subject);
@@ -45,6 +75,12 @@
return result;
}
+ /// <summary>
+ /// Attempts to parse the given string as a date and reformat it in
+ /// a more uniform way.
+ /// </summary>
+ /// <param name="s">The string containing the date.</param>
+ /// <returns>The reformatted string where possible otherwise the original.</returns>
public static string GetDate(string s) {
DateTime dateTime;
Modified: NMail/trunk/NMail.WebAccess/App_Code/HtmlEscaper.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Code/HtmlEscaper.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Code/HtmlEscaper.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -15,27 +32,45 @@
/// </summary>
public static class HtmlEscaper
{
+ /// <summary>
+ /// Escapes all html "<", ">" and "&"s.
+ /// </summary>
+ /// <param name="o">The data to escape.</param>
+ /// <returns>The escaped string.</returns>
public static string EscapeAll(object o)
{
return EscapeAll(o.ToString());
}
+ /// <summary>
+ /// Escapes all html "<", ">" and "&"s.
+ /// </summary>
+ /// <param name="html">The data to escape.</param>
+ /// <returns>The escaped string.</returns>
public static string EscapeAll(string html)
{
- string result = html.Replace("<", "<");
+ string result = html.Replace("&", "&");
+ result = result.Replace("<", "<");
result = result.Replace(">", ">");
return result;
}
+ /// <summary>
+ /// Attempts to escape nasty contents from a html document.
+ /// </summary>
+ /// <param name="html">The html data to escape.</param>
+ /// <returns>The escaped data</returns>
public static string EscapeScriptsAndImages(string html)
{
string result = html.Replace("<img", "<img");
result = result.Replace("<script", "<script");
+ result = result.Replace("<object", "<object");
+ // TODO: this should very possibly be a whitelist
// TODO: other nasty tags
// TODO: css proxy
-
+
return result;
}
}
Modified: NMail/trunk/NMail.WebAccess/App_Code/MailListDataSource.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Code/MailListDataSource.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Code/MailListDataSource.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -13,8 +30,16 @@
namespace NMail.WebAccess
{
+ /// <summary>
+ /// A data source for the mail list.
+ /// </summary>
public static class MailListDataSource
{
+ /// <summary>
+ /// Gets the message envelopes for a folder.
+ /// </summary>
+ /// <param name="folderId">The Id of the folder to get the envelopes in.</param>
+ /// <returns>The envelopes and their message Id.</returns>
public static KeyValuePairOfInt32EnvelopeSerializer[] GetMessageEnvelopes(int folderId)
{
try
@@ -24,7 +49,6 @@
RemoteAccessService.RemoteAccessService ras = (RemoteAccessService.RemoteAccessService)session["RAS"];
return ras.GetAllMessageEnvelopes(authToken, folderId);
-
}
catch (Exception)
{
Modified: NMail/trunk/NMail.WebAccess/App_Code/RowClickableGridView.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Code/RowClickableGridView.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Code/RowClickableGridView.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -21,6 +38,7 @@
{
base.PrepareControlHierarchy();
+ // Add a click handler to each row
for (int i = 0; i < this.Rows.Count; i++)
{
string argument = "rowClicked:" + i;
@@ -30,6 +48,7 @@
protected override void RaisePostBackEvent(string eventArgument)
{
+ // Only override "rowClicked" post-backs
if (eventArgument.StartsWith("rowClicked:"))
{
eventArgument = eventArgument.Remove(0, 11);
Modified: NMail/trunk/NMail.WebAccess/App_Code/SubscribedFolderDataSource.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Code/SubscribedFolderDataSource.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Code/SubscribedFolderDataSource.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
using System;
using System.Data;
@@ -16,22 +32,21 @@
namespace NMail.WebAccess
{
+ /// <summary>
+ /// A data source for the subscribed folders.
+ /// </summary>
public static class SubscribedFolderDataSource
{
+ /// <summary>
+ /// Gets a list of subscribed folders.
+ /// </summary>
+ /// <returns>The list of folders.</returns>
public static List<StoreFolder> GetSubscribedFolders()
{
IHttpSessionState session = SessionStateUtility.GetHttpSessionStateFromContext(HttpContext.Current);
string authToken = (string)session["AuthToken"];
RemoteAccessService.RemoteAccessService ras = (RemoteAccessService.RemoteAccessService)session["RAS"];
- if (ras == null || authToken == null)
- {
- session.Abandon();
- FormsAuthentication.SignOut();
- FormsAuthentication.RedirectToLoginPage();
- return null;
- }
-
StoreFolderSerializer[] serializedFolders = ras.GetAllSubscribedFolders(authToken);
List<StoreFolder> result = new List<StoreFolder>();
List<int> folderIds = new List<int>();
Modified: NMail/trunk/NMail.WebAccess/App_Themes/Default/Default.skin
===================================================================
--- NMail/trunk/NMail.WebAccess/App_Themes/Default/Default.skin 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/App_Themes/Default/Default.skin 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,19 +1,18 @@
<%--
-Default skin template. The following skins are provided as examples only.
-
-1. Named control skin. The SkinId should be uniquely defined because
- duplicate SkinId's per control type are not allowed in the same theme.
-
-<asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
- <AlternatingRowStyle BackColor="Blue" />
-</asp:GridView>
-
-2. Default skin. The SkinId is not defined. Only one default
- control skin per control type is allowed in the same theme.
-
-<asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
--%>
<asp:Image runat="server" SkinId="LoginBanner" ImageUrl="~/Images/Skins/Default/LoginBanner.jpg" />
-
-<%-- <asp:GridView runat="server" SkinId="MailList" Width="100%" /> --%>
\ No newline at end of file
Modified: NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,4 +1,22 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LinkButtonList.ascx.cs" Inherits="Controls_LinkButtonList" %>
+
<asp:Repeater ID="Repeater" runat="server">
<ItemTemplate>
<div class='<%# Eval("ItemStyleClass") %>'>
Modified: NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/LinkButtonList.ascx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -10,6 +27,9 @@
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
+/// <summary>
+/// The code for the link-button list
+/// </summary>
public partial class Controls_LinkButtonList : System.Web.UI.UserControl
{
protected override void OnInit(EventArgs e)
@@ -32,6 +52,10 @@
}
}
+ /// <summary>
+ /// Sets the list of items to display in this control.
+ /// </summary>
+ /// <param name="items">The items to display.</param>
public void SetListItems(List<LinkButtonListItem> items)
{
RepeaterItemCollection dataSource = new RepeaterItemCollection(new ArrayList(items));
Added: NMail/trunk/NMail.WebAccess/Controls/Mail/MailError.aspx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MailError.aspx (rev 0)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MailError.aspx 2007-02-02 09:20:36 UTC (rev 126)
@@ -0,0 +1,35 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+ <title>Mail Error</title>
+</head>
+<body>
+ <form id="form1" runat="server">
+ <div>
+ <h1>Error</h1>
+ An error has occurred trying to view your message or download an attachment.
+ Click <a onclick="refresh()">here</a> to try again.
+ </div>
+ </form>
+</body>
+</html>
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,6 +1,25 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MailList.ascx.cs" Inherits="Controls_Mail_MailList" %>
<%@ Register Namespace="NMail.WebAccess" TagPrefix="nmwa" %>
+
+<!-- The mail grid view for the mail list -->
<nmwa:RowClickableGridView
SkinID="MailList"
AutoGenerateColumns="false"
@@ -18,18 +37,20 @@
<Columns>
<asp:TemplateField HeaderText="From">
<ItemTemplate>
-<%# NMail.WebAccess.HtmlEscaper.EscapeAll(Eval("Value.From")) %>
-</ItemTemplate>
+ <%# NMail.WebAccess.HtmlEscaper.EscapeAll(Eval("Value.From")) %>
+ </ItemTemplate>
</asp:TemplateField>
+
<asp:TemplateField HeaderText="Subject">
<ItemTemplate>
-<%# NMail.WebAccess.HtmlEscaper.EscapeAll(Eval("Value.Subject")) %>
-</ItemTemplate>
- </asp:TemplateField>
+ <%# NMail.WebAccess.HtmlEscaper.EscapeAll(Eval("Value.Subject")) %>
+ </ItemTemplate>
+ </asp:TemplateField>
+
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
-<%# NMail.WebAccess.Helper.GetDate((string) Eval("Value.Date")) %>
-</ItemTemplate>
+ <%# NMail.WebAccess.Helper.GetDate((string) Eval("Value.Date")) %>
+ </ItemTemplate>
</asp:TemplateField>
</Columns>
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MailList.ascx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -11,6 +28,9 @@
using NMail.WebAccess;
+/// <summary>
+/// The code for the mail list control.
+/// </summary>
public partial class Controls_Mail_MailList : System.Web.UI.UserControl, IWebPart
{
protected void Page_Init(object sender, EventArgs e)
@@ -20,6 +40,7 @@
protected void Page_PreRender(object sender, EventArgs e)
{
+ // Setup and bind to the data source
ObjectDataSource mailListDataSource = new ObjectDataSource("NMail.WebAccess.MailListDataSource", "GetMessageEnvelopes");
mailListDataSource.SelectParameters.Add("FolderId", TypeCode.Int32, this.selectedFolderId.ToString());
@@ -31,12 +52,14 @@
{
Hashtable result = new Hashtable();
result.Add("SelectedFolderId", this.selectedFolderId);
+ result.Add("SelectedFolderName", this.folderName);
return result;
}
protected override void LoadControlState(object savedState)
{
this.selectedFolderId = (int)((Hashtable)savedState)["SelectedFolderId"];
+ this.folderName = (string)((Hashtable)savedState)["SelectedFolderName"];
}
private int selectedFolderId;
@@ -50,7 +73,18 @@
set { selectedFolderId = value; }
}
+ private string folderName;
+
/// <summary>
+ /// The name of the currently selected folder.
+ /// </summary>
+ public string FolderName
+ {
+ get { return folderName; }
+ set { folderName = value; }
+ }
+
+ /// <summary>
/// The Id of the currently selected message.
/// </summary>
public int SelectedMessageId
@@ -125,8 +159,7 @@
{
get
{
- string folderName = Session["SelectedFolderName"] as string;
- return (folderName == null) ? " " : folderName;
+ return (this.folderName == null) ? " " : this.folderName;
}
set
{
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,16 +1,36 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MessageBody.aspx.cs" Inherits="Controls_Mail_MessageBody" %>
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+<%@ Page Language="C#" ErrorPage="~/Controls/Mail/MailError.aspx" AutoEventWireup="true" CodeFile="MessageBody.aspx.cs" Inherits="Controls_Mail_MessageBody" %>
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
- <title>Untitled Page</title>
+ <title runat="Server">Message</title>
</head>
<body>
<form id="form1" runat="server">
<div class="MessageBody">
+ <!-- The message body -->
<asp:Literal ID="MessageBody" runat="server" />
<br />
+
+ <!-- The attachments -->
<asp:Repeater ID="AttachmentsRepeater" runat="server">
<ItemTemplate>
<!-- Name -->
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MessageBody.aspx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -16,10 +33,16 @@
using NMail.WebAccess;
using RemoteAccessService;
+/// <summary>
+/// The code for the message body page.
+/// </summary>
public partial class Controls_Mail_MessageBody : System.Web.UI.Page
{
private int messageId;
+ /// <summary>
+ /// The message Id displayed in the page.
+ /// </summary>
public int MessageId
{
get { return messageId; }
@@ -27,11 +50,17 @@
private int folderId;
+ /// <summary>
+ /// The folder the message is in.
+ /// </summary>
public int FolderId
{
get { return folderId; }
}
+ /// <summary>
+ /// Extracts the message and folder Ids from the query string.
+ /// </summary>
protected void ExtractQueryStringParams()
{
foreach (string key in Request.QueryString.AllKeys)
@@ -47,6 +76,48 @@
}
}
+ /// <summary>
+ /// Examines the body structure to determine which MIME part to display as the
+ /// message body.
+ /// </summary>
+ /// <param name="bodyStructure">The structure of the message.</param>
+ /// <param name="partNumber">The part number to display.</param>
+ /// <param name="html">True if the part is a HTML part.</param>
+ protected void FindMimePartToDisplay(BodyStructure bodyStructure, out int partNumber, out bool html)
+ {
+ if (bodyStructure.Count == 0)
+ {
+ // Simple message body, only one part to the message
+ partNumber = 1;
+ html = false;
+ }
+ else
+ {
+ partNumber = 1;
+ html = false;
+
+ // Search for the best part
+ for (int i = 0; i < bodyStructure.Count; i++)
+ {
+ string subType;
+ MimeContentType contentType = MimeHelper.GetContentType(bodyStructure[i].Headers, out subType);
+
+ if (contentType == MimeContentType.Text)
+ {
+ // We'll take the first text part we find unless something better appears
+ partNumber = i + 1;
+
+ if (subType == "html")
+ {
+ // We'll display the first HTML part we find
+ html = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+
protected void Page_Load(object sender, EventArgs e)
{
ExtractQueryStringParams();
@@ -55,6 +126,7 @@
if (this.folderId == -1)
{
this.MessageBody.Text = "No folder selected.";
+ this.Page.Title = this.MessageBody.Text;
return;
}
@@ -62,6 +134,7 @@
if (this.messageId == -1)
{
this.MessageBody.Text = "No message selected.";
+ this.Page.Title = this.MessageBody.Text;
return;
}
@@ -69,44 +142,21 @@
string authToken = (string) Session["AuthToken"];
RemoteAccessService.RemoteAccessService ras = (RemoteAccessService.RemoteAccessService) Session["RAS"];
+ // Get the body structure
BodyStructureSerializer bs = ras.GetMessageStructure(authToken, messageId, folderId);
BodyStructure bodyStructure = Helper.GetBodyStructure(bs);
- int bodyPartNumber = 1;
- bool htmlBody = false;
-
- if (bodyStructure.Count == 0)
- {
- // Simple message body, only one part to the message
- bodyPartNumber = 1;
- }
- else
- {
- // Search for the best part
- for (int i = 0; i < bodyStructure.Count; i++)
- {
- string subType;
- MimeContentType contentType = MimeHelper.GetContentType(bodyStructure[i].Headers, out subType);
-
- if (contentType == MimeContentType.Text)
- {
- // We'll take the first text part we find unless something better appears
- bodyPartNumber = i + 1;
-
- if (subType == "html")
- {
- // We'll display the first HTML part we find
- htmlBody = true;
- break;
- }
- }
- }
- }
-
+ // Find which part to display
+ int bodyPartNumber;
+ bool htmlBody;
+ FindMimePartToDisplay(bodyStructure, out bodyPartNumber, out htmlBody);
+
+ // Get the part to display
string base64Body = ras.GetMessageMimePart(authToken, bodyPartNumber, messageId, folderId);
ByteString bodyData = new ByteString(Convert.FromBase64String(base64Body), Encoding.UTF8);
SimpleBodyPart body = MessageHelper.ParseMessage(bodyData);
+ // Ensure all nasty stuff is escaped
if (htmlBody)
{
this.MessageBody.Text = HtmlEscaper.EscapeScriptsAndImages(body.Data.ToString());
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,5 +1,23 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MessageViewer.ascx.cs" Inherits="Controls_Mail_MessageViewer" %>
+<!-- A panel for the message details -->
<asp:Panel ID="EnvelopePanel" runat="server" Visible="false" Width="100%">
<span class="MessageEnvelope">
From: <asp:Literal ID="From" runat="server" /><br />
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/MessageViewer.ascx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -13,6 +30,9 @@
using NMail.WebAccess;
using RemoteAccessService;
+/// <summary>
+/// The code for the message viewer control.
+/// </summary>
public partial class Controls_Mail_MessageViewer : System.Web.UI.UserControl, IWebPart
{
protected void Page_Init(object sender, EventArgs e)
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubscribedFolderList.ascx.cs" Inherits="Controls_Mail_SubscribedFolderList" %>
<%@ Register Assembly="MenuPilot" Namespace="MenuPilot.Web.Ui" TagPrefix="mp" %>
@@ -3,4 +20,5 @@
<div class="SubscribedFolderList">
+ <!-- The repeater for the list of folders -->
<asp:Repeater
ID="FolderRepeater"
Modified: NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Controls/Mail/SubscribedFolderList.ascx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -12,6 +29,9 @@
using NMail.WebAccess;
+/// <summary>
+/// The code for the subscribed folder list control.
+/// </summary>
public partial class Controls_Mail_SubscribedFolderList : System.Web.UI.UserControl
{
protected void Page_Init(object sender, EventArgs e)
@@ -65,8 +85,8 @@
if (f.UnreadMessages > 0) {
result.Append(string.Format(" ({0})", f.UnreadMessages));
- result.Append("</span>");
}
+ result.Append("</span>");
return result.ToString();
}
Added: NMail/trunk/NMail.WebAccess/ErrorHandler.aspx
===================================================================
--- NMail/trunk/NMail.WebAccess/ErrorHandler.aspx (rev 0)
+++ NMail/trunk/NMail.WebAccess/ErrorHandler.aspx 2007-02-02 09:20:36 UTC (rev 126)
@@ -0,0 +1,36 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ErrorHandler.aspx.cs" Inherits="ErrorHandler" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+ <title>NMail Web Access - Error</title>
+</head>
+<body>
+ <form id="form1" runat="server">
+ <div>
+ <h1>Error</h1>
+ An unexpected error has occurred in NMail Web Access.
+ Click <asp:LinkButton ID="Logout" runat="server" OnClick="Logout_Click">here</asp:LinkButton>
+ to logout and return to the login page.
+ </div>
+ </form>
+</body>
+</html>
Added: NMail/trunk/NMail.WebAccess/ErrorHandler.aspx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/ErrorHandler.aspx.cs (rev 0)
+++ NMail/trunk/NMail.WebAccess/ErrorHandler.aspx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Data;
+using System.Configuration;
+using System.Collections;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.WebControls.WebParts;
+using System.Web.UI.HtmlControls;
+
+public partial class ErrorHandler : System.Web.UI.Page
+{
+ protected void Logout_Click(object sender, EventArgs e)
+ {
+ Session.Abandon();
+ FormsAuthentication.SignOut();
+ FormsAuthentication.RedirectToLoginPage();
+ }
+}
Modified: NMail/trunk/NMail.WebAccess/Login.aspx
===================================================================
--- NMail/trunk/NMail.WebAccess/Login.aspx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Login.aspx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -10,19 +27,22 @@
<form id="form1" runat="server">
<div align="center" class="LoginBox">
- <asp:Image ID="LoginBanner" runat="server" SkinID="LoginBanner" />
- <asp:LoginView ID="LoginView" runat="server">
- <LoggedInTemplate>
- You are currently logged in as
- <asp:LoginName ID="LoginName" runat="server" />.<br />
- <asp:LoginStatus ID="LoginStatus" runat="server" />
- </LoggedInTemplate>
- <AnonymousTemplate>
- <asp:Login ID="Login" runat="server" OnAuthenticate="Login_Authenticate" DestinationPageUrl="~/Default.aspx" TitleText="Log in to NMail web access">
- <TitleTextStyle CssClass="LogonTitle" />
- </asp:Login>
- </AnonymousTemplate>
- </asp:LoginView>
+ <asp:Image ID="LoginBanner" runat="server" SkinID="LoginBanner" />
+ <asp:LoginView ID="LoginView" runat="server">
+ <%-- Show the user name and logout prompt --%>
+ <LoggedInTemplate>
+ You are currently logged in as
+ <asp:LoginName ID="LoginName" runat="server" />.<br />
+ <asp:LoginStatus ID="LoginStatus" runat="server" />
+ </LoggedInTemplate>
+
+ <%-- Show the login prompt --%>
+ <AnonymousTemplate>
+ <asp:Login ID="Login" runat="server" OnAuthenticate="Login_Authenticate" DestinationPageUrl="~/Default.aspx" TitleText="Log in to NMail web access">
+ <TitleTextStyle CssClass="LogonTitle" />
+ </asp:Login>
+ </AnonymousTemplate>
+ </asp:LoginView>
</div>
</form>
</body>
Modified: NMail/trunk/NMail.WebAccess/Login.aspx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Login.aspx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Login.aspx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -11,6 +28,9 @@
using RemoteAccessService;
+/// <summary>
+/// The code for the login page.
+/// </summary>
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) { }
@@ -22,6 +42,7 @@
RemoteAccessService.RemoteAccessService ras = new RemoteAccessService.RemoteAccessService();
string authToken = ras.Authenticate(login.UserName, login.Password);
+ // Check the result of the authentication attempt
if (authToken != string.Empty)
{
Session["AuthToken"] = authToken;
Modified: NMail/trunk/NMail.WebAccess/Mail.aspx
===================================================================
--- NMail/trunk/NMail.WebAccess/Mail.aspx 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Mail.aspx 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,5 +1,22 @@
-<%@ Page Language="C#" Trace="true" TraceMode="SortByTime" AutoEventWireup="true" CodeFile="Mail.aspx.cs" Inherits="Mail" %>
+<%--
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+--%>
+<%@ Page Language="C#" ErrorPage="~/ErrorHandler.aspx" AutoEventWireup="true" CodeFile="Mail.aspx.cs" Inherits="Mail" %>
+
<%@ Register Src="Controls/Mail/MessageViewer.ascx" TagName="MessageViewer" TagPrefix="uc4" %>
<%@ Register Src="Controls/Mail/MailList.ascx" TagName="MailList" TagPrefix="uc3" %>
Modified: NMail/trunk/NMail.WebAccess/Mail.aspx.cs
===================================================================
--- NMail/trunk/NMail.WebAccess/Mail.aspx.cs 2007-02-01 10:33:00 UTC (rev 125)
+++ NMail/trunk/NMail.WebAccess/Mail.aspx.cs 2007-02-02 09:20:36 UTC (rev 126)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2007 Luke Quinane
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Data;
using System.Configuration;
@@ -12,6 +29,9 @@
using ASP;
+/// <summary>
+/// The code for the mail viewer form.
+/// </summary>
public partial class Mail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
@@ -24,6 +44,7 @@
viewItems.Add(new LinkButtonListItem("Logout", "ViewButton", new EventHandler(Logout_Clicked)));
this.ViewList.SetListItems(viewItems);
+ // Register for events
this.SubscribedFolderList.SelectedFolderIdChanged += new EventHandler(SubscribedFolderList_SelectedFolderIdChanged);
this.MailList.SelectedMessageChanged += new EventHandler(MailList_SelectedMessageChanged);
}
@@ -42,14 +63,17 @@
{
string folderName = null;
+ // Get the folder name
if (folderId != -1)
{
NMail.DataTypes.LocalStore.StoreFolder folder = NMail.WebAccess.SubscribedFolderDataSource.GetStoreFolder(folderId);
folderName = folder.FullFolderName;
}
+ // Update the controls
this.SubscribedFolderList.SelectedFolderId = folderId;
this.MailList.SelectedFolderId = folderId;
+ this.MailList.SelectedFolderName = folderName;
this.MessageViewer.FolderId = folderId;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|