[Nmailserver-commits] SF.net SVN: nmailserver: [217] NMail/trunk
Brought to you by:
dframpton-oss,
tmyroadctfig
|
From: <tmy...@us...> - 2007-06-10 14:34:19
|
Revision: 217
http://svn.sourceforge.net/nmailserver/?rev=217&view=rev
Author: tmyroadctfig
Date: 2007-06-10 07:34:21 -0700 (Sun, 10 Jun 2007)
Log Message:
-----------
Work on Spool and service administration.
Modified Paths:
--------------
NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainEditor.cs
NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.Designer.cs
NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.cs
NMail/trunk/NMail.Administration.WinForms/MainForm.cs
NMail/trunk/NMail.Administration.WinForms/NMail.Administration.WinForms.csproj
NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.Designer.cs
NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.cs
NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.resx
NMail/trunk/NMail.Icons/NMail.Icons.csproj
Added Paths:
-----------
NMail/trunk/NMail.Administration.WinForms/Spool/
NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.Designer.cs
NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.cs
NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.Designer.cs
NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.cs
NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.resx
NMail/trunk/NMail.Icons/Resources/16x16/actions/mail_generic.png
NMail/trunk/NMail.Icons/Resources/16x16/actions/recur.png
Modified: NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainEditor.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainEditor.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainEditor.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -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.Collections.Generic;
using System.ComponentModel;
Modified: NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.Designer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.Designer.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.Designer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -35,6 +35,8 @@
this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.refreshMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bottomPanel.SuspendLayout();
this.mailDomainContextMenu.SuspendLayout();
this.SuspendLayout();
@@ -56,7 +58,7 @@
this.mailDomainsListView.TabIndex = 1;
this.mailDomainsListView.UseCompatibleStateImageBehavior = false;
this.mailDomainsListView.View = System.Windows.Forms.View.Details;
- this.mailDomainsListView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.mailDomainsListView_MouseClick);
+ this.mailDomainsListView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mailDomainsListView_MouseUp);
//
// idColumnHeader
//
@@ -92,9 +94,10 @@
//
this.refreshButton.Location = new System.Drawing.Point(4, 7);
this.refreshButton.Name = "refreshButton";
- this.refreshButton.Size = new System.Drawing.Size(75, 23);
+ this.refreshButton.Size = new System.Drawing.Size(82, 23);
this.refreshButton.TabIndex = 0;
this.refreshButton.Text = "Refresh";
+ this.refreshButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.refreshButton.UseVisualStyleBackColor = true;
this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
//
@@ -103,31 +106,45 @@
this.mailDomainContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addToolStripMenuItem,
this.editMenuItem,
- this.deleteToolStripMenuItem});
+ this.deleteToolStripMenuItem,
+ this.toolStripSeparator1,
+ this.refreshMenuItem});
this.mailDomainContextMenu.Name = "mailDomainContextMenu";
- this.mailDomainContextMenu.Size = new System.Drawing.Size(153, 92);
+ this.mailDomainContextMenu.Size = new System.Drawing.Size(124, 98);
//
// addToolStripMenuItem
//
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
- this.addToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.addToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.addToolStripMenuItem.Text = "Add";
this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click);
//
// editMenuItem
//
this.editMenuItem.Name = "editMenuItem";
- this.editMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.editMenuItem.Size = new System.Drawing.Size(123, 22);
this.editMenuItem.Text = "Edit...";
this.editMenuItem.Click += new System.EventHandler(this.editMenuItem_Click);
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
- this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.deleteToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(120, 6);
+ //
+ // refreshMenuItem
+ //
+ this.refreshMenuItem.Name = "refreshMenuItem";
+ this.refreshMenuItem.Size = new System.Drawing.Size(123, 22);
+ this.refreshMenuItem.Text = "Refresh";
+ this.refreshMenuItem.Click += new System.EventHandler(this.refreshButton_Click);
+ //
// MailDomainManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -155,6 +172,8 @@
private System.Windows.Forms.ToolStripMenuItem editMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem refreshMenuItem;
}
}
Modified: NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/MailDomain/MailDomainManager.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -37,10 +37,12 @@
this.mainForm = mainForm;
+ // Setup icons
this.imageList.Images.Add(IconHelper.GetImage("server", "actions", IconSize.s16x16));
-
this.editMenuItem.Image = IconHelper.GetImage("edit", "actions", IconSize.s16x16);
this.deleteToolStripMenuItem.Image = IconHelper.GetImage("delete", "actions", IconSize.s16x16);
+ this.refreshMenuItem.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
+ this.refreshButton.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
}
MainForm mainForm;
@@ -55,7 +57,7 @@
// Add them to the list view
foreach (NMail.DataTypes.LocalStore.MailDomain mailDomain in mailDomains) {
- ListViewItem item = new MailDomainListVieItem(mailDomain);
+ ListViewItem item = new MailDomainListViewItem(mailDomain);
this.mailDomainsListView.Items.Add(item);
}
@@ -65,15 +67,27 @@
}
}
- private MailDomainListVieItem clickedItem;
+ private MailDomainListViewItem clickedItem;
- private void mailDomainsListView_MouseClick(object sender, MouseEventArgs e) {
+ private void mailDomainsListView_MouseUp(object sender, MouseEventArgs e) {
if (e.Button == MouseButtons.Right) {
- this.clickedItem = this.mailDomainsListView.GetItemAt(e.X, e.Y) as MailDomainListVieItem;
+ // Get the item clicked on (if any)
+ this.clickedItem = this.mailDomainsListView.GetItemAt(e.X, e.Y) as MailDomainListViewItem;
+
+ // Update and show the context menu
+ updateContextMenu();
this.mailDomainContextMenu.Show(Control.MousePosition, ToolStripDropDownDirection.BelowRight);
}
}
+ /// <summary>
+ /// Updates the context menu based on the item clicked on
+ /// </summary>
+ private void updateContextMenu() {
+ this.editMenuItem.Enabled = (this.clickedItem != null);
+ this.deleteToolStripMenuItem.Enabled = (this.clickedItem != null);
+ }
+
private void addToolStripMenuItem_Click(object sender, EventArgs e) {
// Create a new editor and display it
MailDomainEditor editor = new MailDomainEditor();
@@ -160,16 +174,22 @@
} catch (Exception ex) {
Program.ShowExceptionDialog(ex);
}
+
+ // Update the list of mail domains
+ refreshButton_Click(this, new EventArgs());
}
}
}
}
- public class MailDomainListVieItem : ListViewItem {
+ /// <summary>
+ /// A list view item for displaying mail domains.
+ /// </summary>
+ public class MailDomainListViewItem : ListViewItem {
private NMail.DataTypes.LocalStore.MailDomain mailDomain;
- public MailDomainListVieItem(NMail.DataTypes.LocalStore.MailDomain mailDomain) {
+ public MailDomainListViewItem(NMail.DataTypes.LocalStore.MailDomain mailDomain) {
this.mailDomain = mailDomain;
this.SubItems[0] = new ListViewSubItem(this, mailDomain.MailDomainId.ToString());
Modified: NMail/trunk/NMail.Administration.WinForms/MainForm.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/MainForm.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/MainForm.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -54,6 +54,7 @@
InitialiseManagementTree();
InitialiseServicesViewer();
InitialiseMailDomainManager();
+ InitialiseSpoolManager();
this.connectionStatusLbl.Image = IconHelper.GetImage("connect_no", "actions", IconSize.s16x16);
this.connectMenuItem.Image = IconHelper.GetImage("connect_no", "actions", IconSize.s16x16);
@@ -387,8 +388,46 @@
}
#endregion
+ #region Spool Manager
+ /// <summary>
+ /// The spool manager.
+ /// </summary>
+ Spool.SmtpSpoolManager spoolManager;
+
+ DockContent spoolManagerDock;
+
+ protected void InitialiseSpoolManager() {
+ this.spoolManager = new Spool.SmtpSpoolManager(this);
+ this.spoolManager.Dock = DockStyle.Fill;
+
+ spoolManagerDock = new DockContent();
+ spoolManagerDock.Controls.Add(this.spoolManager);
+ spoolManagerDock.Text = "SMTP Spool";
+ spoolManagerDock.DockPanel = this.dockPanel;
+ spoolManagerDock.DockState = DockState.Hidden;
+ spoolManagerDock.Icon = IconHelper.GetIcon("queue", "actions", IconSize.s16x16);
+ spoolManagerDock.FormClosing += new FormClosingEventHandler(spoolManagerDock_FormClosing);
+ }
+
+ void spoolManagerDock_FormClosing(object sender, FormClosingEventArgs e) {
+ if (e.CloseReason == CloseReason.UserClosing) {
+ e.Cancel = true;
+
+ this.spoolManagerDock.DockState = DockState.Hidden;
+ }
+ }
+
public void ShowSpoolControl() {
+ if (!Connected) {
+ ShowStatusBrowser();
+
+ } else {
+ this.spoolManagerDock.DockState = DockState.Document;
+ this.spoolManagerDock.DockHandler.DockTo(this.dockPanel.DockWindows[DockState.Document].NestedPanes[0], DockStyle.Fill, 0);
+ this.spoolManagerDock.DockHandler.Show();
+ }
}
+ #endregion
#region Mail Domain Manager
/// <summary>
Modified: NMail/trunk/NMail.Administration.WinForms/NMail.Administration.WinForms.csproj
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/NMail.Administration.WinForms.csproj 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/NMail.Administration.WinForms.csproj 2007-06-10 14:34:21 UTC (rev 217)
@@ -130,6 +130,10 @@
<SubType>Designer</SubType>
<DependentUpon>ServicesViewer.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Spool\SmtpSpoolManager.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>SmtpSpoolManager.cs</DependentUpon>
+ </EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
@@ -149,6 +153,18 @@
<Compile Include="Services\ServicesViewer.Designer.cs">
<DependentUpon>ServicesViewer.cs</DependentUpon>
</Compile>
+ <Compile Include="Spool\SmtpMessageRecipientViewer.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Spool\SmtpMessageRecipientViewer.Designer.cs">
+ <DependentUpon>SmtpMessageRecipientViewer.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Spool\SmtpSpoolManager.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Spool\SmtpSpoolManager.Designer.cs">
+ <DependentUpon>SmtpSpoolManager.cs</DependentUpon>
+ </Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\ConnectFailed.html">
Modified: NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.Designer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.Designer.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.Designer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -24,72 +24,160 @@
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
- this.mainListView = new System.Windows.Forms.ListView();
+ this.servicesListView = new System.Windows.Forms.ListView();
+ this.nameColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.descColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.runningColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.autoStartColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.imageList = new System.Windows.Forms.ImageList(this.components);
this.servicesContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.startMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restartMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.refreshMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.bottomPanel = new System.Windows.Forms.Panel();
+ this.refreshButton = new System.Windows.Forms.Button();
this.servicesContextMenu.SuspendLayout();
+ this.bottomPanel.SuspendLayout();
this.SuspendLayout();
//
- // mainListView
+ // servicesListView
//
- this.mainListView.ContextMenuStrip = this.servicesContextMenu;
- this.mainListView.Dock = System.Windows.Forms.DockStyle.Fill;
- this.mainListView.FullRowSelect = true;
- this.mainListView.GridLines = true;
- this.mainListView.Location = new System.Drawing.Point(0, 0);
- this.mainListView.Name = "mainListView";
- this.mainListView.Size = new System.Drawing.Size(570, 423);
- this.mainListView.TabIndex = 0;
- this.mainListView.UseCompatibleStateImageBehavior = false;
- this.mainListView.View = System.Windows.Forms.View.Details;
+ this.servicesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.nameColumnHeader,
+ this.descColumnHeader,
+ this.runningColumnHeader,
+ this.autoStartColumnHeader});
+ this.servicesListView.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.servicesListView.FullRowSelect = true;
+ this.servicesListView.GridLines = true;
+ this.servicesListView.Location = new System.Drawing.Point(0, 0);
+ this.servicesListView.Name = "servicesListView";
+ this.servicesListView.Size = new System.Drawing.Size(570, 384);
+ this.servicesListView.SmallImageList = this.imageList;
+ this.servicesListView.TabIndex = 0;
+ this.servicesListView.UseCompatibleStateImageBehavior = false;
+ this.servicesListView.View = System.Windows.Forms.View.Details;
+ this.servicesListView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.servicesListView_MouseUp);
//
+ // nameColumnHeader
+ //
+ this.nameColumnHeader.Text = "Name";
+ this.nameColumnHeader.Width = 122;
+ //
+ // descColumnHeader
+ //
+ this.descColumnHeader.Text = "Description";
+ this.descColumnHeader.Width = 211;
+ //
+ // runningColumnHeader
+ //
+ this.runningColumnHeader.Text = "Running";
+ //
+ // autoStartColumnHeader
+ //
+ this.autoStartColumnHeader.Text = "Auto-Start";
+ //
+ // imageList
+ //
+ this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+ this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+ this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+ //
// servicesContextMenu
//
this.servicesContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.startMenuItem,
this.stopMenuItem,
- this.restartMenuItem});
+ this.restartMenuItem,
+ this.toolStripSeparator1,
+ this.refreshMenuItem});
this.servicesContextMenu.Name = "servicesContextMenu";
- this.servicesContextMenu.Size = new System.Drawing.Size(153, 92);
+ this.servicesContextMenu.Size = new System.Drawing.Size(153, 120);
//
// startMenuItem
//
this.startMenuItem.Name = "startMenuItem";
this.startMenuItem.Size = new System.Drawing.Size(152, 22);
this.startMenuItem.Text = "Start";
+ this.startMenuItem.Click += new System.EventHandler(this.startMenuItem_Click);
//
// stopMenuItem
//
this.stopMenuItem.Name = "stopMenuItem";
this.stopMenuItem.Size = new System.Drawing.Size(152, 22);
this.stopMenuItem.Text = "Stop";
+ this.stopMenuItem.Click += new System.EventHandler(this.stopMenuItem_Click);
//
// restartMenuItem
//
this.restartMenuItem.Name = "restartMenuItem";
this.restartMenuItem.Size = new System.Drawing.Size(152, 22);
this.restartMenuItem.Text = "Restart";
+ this.restartMenuItem.Click += new System.EventHandler(this.restartMenuItem_Click);
//
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
+ //
+ // refreshMenuItem
+ //
+ this.refreshMenuItem.Name = "refreshMenuItem";
+ this.refreshMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.refreshMenuItem.Text = "Refresh";
+ this.refreshMenuItem.Click += new System.EventHandler(this.refreshButton_Click);
+ //
+ // bottomPanel
+ //
+ this.bottomPanel.Controls.Add(this.refreshButton);
+ this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.bottomPanel.Location = new System.Drawing.Point(0, 384);
+ this.bottomPanel.Name = "bottomPanel";
+ this.bottomPanel.Size = new System.Drawing.Size(570, 39);
+ this.bottomPanel.TabIndex = 1;
+ //
+ // refreshButton
+ //
+ this.refreshButton.Location = new System.Drawing.Point(3, 6);
+ this.refreshButton.Name = "refreshButton";
+ this.refreshButton.Size = new System.Drawing.Size(75, 23);
+ this.refreshButton.TabIndex = 0;
+ this.refreshButton.Text = "Refresh";
+ this.refreshButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.refreshButton.UseVisualStyleBackColor = true;
+ this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
+ //
// ServicesViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.mainListView);
+ this.Controls.Add(this.servicesListView);
+ this.Controls.Add(this.bottomPanel);
this.Name = "ServicesViewer";
this.Size = new System.Drawing.Size(570, 423);
this.servicesContextMenu.ResumeLayout(false);
+ this.bottomPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
- private System.Windows.Forms.ListView mainListView;
+ private System.Windows.Forms.ListView servicesListView;
private System.Windows.Forms.ContextMenuStrip servicesContextMenu;
private System.Windows.Forms.ToolStripMenuItem startMenuItem;
private System.Windows.Forms.ToolStripMenuItem stopMenuItem;
private System.Windows.Forms.ToolStripMenuItem restartMenuItem;
+ private System.Windows.Forms.ColumnHeader nameColumnHeader;
+ private System.Windows.Forms.ColumnHeader descColumnHeader;
+ private System.Windows.Forms.ColumnHeader runningColumnHeader;
+ private System.Windows.Forms.ColumnHeader autoStartColumnHeader;
+ private System.Windows.Forms.Panel bottomPanel;
+ private System.Windows.Forms.Button refreshButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem refreshMenuItem;
+ private System.Windows.Forms.ImageList imageList;
}
}
Modified: NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.cs 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -23,10 +23,141 @@
using System.Text;
using System.Windows.Forms;
+using NMail.DataTypes.Service;
+using NMail.Icons;
+
namespace NMail.Administration.WinForms.Services {
public partial class ServicesViewer : UserControl {
+
+ private MainForm mainForm;
+
public ServicesViewer(MainForm mainForm) {
InitializeComponent();
+
+ this.mainForm = mainForm;
+
+ // Setup icons
+ this.imageList.Images.Add(IconHelper.GetImage("exec", "actions", IconSize.s16x16));
+ this.refreshMenuItem.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
+ this.refreshButton.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
}
+
+ private void refreshButton_Click(object sender, EventArgs e) {
+ try {
+ // Get a list of mail domains
+ IList<ServiceStartInfo> services = this.mainForm.RemoteAdministration.NMailServer.Services;
+
+ this.servicesListView.Items.Clear();
+
+ // Add them to the list view
+ foreach (ServiceStartInfo service in services) {
+ ListViewItem item = new ServiceListViewItem(service);
+ this.servicesListView.Items.Add(item);
+ }
+
+ } catch (Exception ex) {
+ // Something bad :(
+ Program.ShowExceptionDialog(ex);
+ }
+ }
+
+ private ServiceListViewItem clickedItem;
+
+ private void servicesListView_MouseUp(object sender, MouseEventArgs e) {
+ if (e.Button == MouseButtons.Right) {
+ // Get the item clicked on (if any)
+ this.clickedItem = this.servicesListView.GetItemAt(e.X, e.Y) as ServiceListViewItem;
+
+ // Update and show the context menu
+ updateContextMenu();
+ this.servicesContextMenu.Show(Control.MousePosition, ToolStripDropDownDirection.BelowRight);
+ }
+ }
+
+ /// <summary>
+ /// Updates the context menu based on the item clicked on
+ /// </summary>
+ private void updateContextMenu() {
+ this.startMenuItem.Enabled = (this.clickedItem != null);
+ this.stopMenuItem.Enabled = (this.clickedItem != null);
+ this.restartMenuItem.Enabled = (this.clickedItem != null);
+ }
+
+ private void startMenuItem_Click(object sender, EventArgs e) {
+ if (this.clickedItem != null
+ && this.clickedItem.Service != null
+ && this.clickedItem.Service.Service != null) {
+
+ try {
+ // Attempt to start the service
+ this.clickedItem.Service.Service.Start();
+
+ } catch (Exception ex) {
+ Program.ShowExceptionDialog(ex);
+ }
+
+ // Update services list
+ refreshButton_Click(this, new EventArgs());
+ }
+ }
+
+ private void stopMenuItem_Click(object sender, EventArgs e) {
+ if (this.clickedItem != null
+ && this.clickedItem.Service != null
+ && this.clickedItem.Service.Service != null) {
+
+ try {
+ // Attempt to stop the service
+ this.clickedItem.Service.Service.Stop(true);
+
+ } catch (Exception ex) {
+ Program.ShowExceptionDialog(ex);
+ }
+
+ // Update services list
+ refreshButton_Click(this, new EventArgs());
+ }
+ }
+
+ private void restartMenuItem_Click(object sender, EventArgs e) {
+ if (this.clickedItem != null
+ && this.clickedItem.Service != null
+ && this.clickedItem.Service.Service != null) {
+
+ try {
+ // Attempt to restart the service
+ this.clickedItem.Service.Service.Stop(true);
+ this.clickedItem.Service.Service.Start();
+
+ } catch (Exception ex) {
+ Program.ShowExceptionDialog(ex);
+ }
+
+ // Update services list
+ refreshButton_Click(this, new EventArgs());
+ }
+ }
}
+
+ public class ServiceListViewItem : ListViewItem {
+
+ public ServiceListViewItem(ServiceStartInfo service) {
+ this.service = service;
+
+ this.SubItems[0] = new ListViewSubItem(this, service.Service.Name);
+ this.SubItems.Add(new ListViewSubItem(this, service.Service.Description));
+ this.SubItems.Add(new ListViewSubItem(this, service.Service.Running.ToString()));
+ this.SubItems.Add(new ListViewSubItem(this, service.AutomaticStart.ToString()));
+
+ this.ImageIndex = 0;
+ }
+
+ private ServiceStartInfo service;
+
+ public ServiceStartInfo Service {
+ get {
+ return this.service;
+ }
+ }
+ }
}
Modified: NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.resx
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.resx 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Administration.WinForms/Services/ServicesViewer.resx 2007-06-10 14:34:21 UTC (rev 217)
@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>173, 17</value>
+ </metadata>
<metadata name="servicesContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Added: NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.Designer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.Designer.cs (rev 0)
+++ NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.Designer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -0,0 +1,32 @@
+namespace NMail.Administration.WinForms.Spool {
+ partial class SmtpMessageRecipientViewer {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent() {
+ components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ }
+
+ #endregion
+ }
+}
Added: NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.cs (rev 0)
+++ NMail/trunk/NMail.Administration.WinForms/Spool/SmtpMessageRecipientViewer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using WeifenLuo.WinFormsUI.Docking;
+
+namespace NMail.Administration.WinForms.Spool {
+ public partial class SmtpMessageRecipientViewer : DockContent {
+ public SmtpMessageRecipientViewer() {
+ InitializeComponent();
+ }
+ }
+}
Added: NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.Designer.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.Designer.cs (rev 0)
+++ NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.Designer.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -0,0 +1,209 @@
+namespace NMail.Administration.WinForms.Spool {
+ partial class SmtpSpoolManager {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent() {
+ this.components = new System.ComponentModel.Container();
+ this.imageList = new System.Windows.Forms.ImageList(this.components);
+ this.spoolListView = new System.Windows.Forms.ListView();
+ this.guidColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.inProgressColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.filteredColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.sourceAddressColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.reportedHostColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.senderColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.recipientsColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.bottomPanel = new System.Windows.Forms.Panel();
+ this.refreshButton = new System.Windows.Forms.Button();
+ this.spoolContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.viewRecipientsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.deleteMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.refreshMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.subjectColumnHeader = new System.Windows.Forms.ColumnHeader();
+ this.bottomPanel.SuspendLayout();
+ this.spoolContextMenu.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // imageList
+ //
+ this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+ this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+ this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+ //
+ // spoolListView
+ //
+ this.spoolListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.guidColumnHeader,
+ this.inProgressColumnHeader,
+ this.filteredColumnHeader,
+ this.subjectColumnHeader,
+ this.sourceAddressColumnHeader,
+ this.reportedHostColumnHeader,
+ this.senderColumnHeader,
+ this.recipientsColumnHeader});
+ this.spoolListView.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.spoolListView.FullRowSelect = true;
+ this.spoolListView.GridLines = true;
+ this.spoolListView.HideSelection = false;
+ this.spoolListView.Location = new System.Drawing.Point(0, 0);
+ this.spoolListView.Name = "spoolListView";
+ this.spoolListView.Size = new System.Drawing.Size(755, 399);
+ this.spoolListView.SmallImageList = this.imageList;
+ this.spoolListView.TabIndex = 0;
+ this.spoolListView.UseCompatibleStateImageBehavior = false;
+ this.spoolListView.View = System.Windows.Forms.View.Details;
+ this.spoolListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.spoolListView_MouseDoubleClick);
+ this.spoolListView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.spoolListView_MouseUp);
+ //
+ // guidColumnHeader
+ //
+ this.guidColumnHeader.Text = "Guid";
+ this.guidColumnHeader.Width = 45;
+ //
+ // inProgressColumnHeader
+ //
+ this.inProgressColumnHeader.Text = "In Progress";
+ this.inProgressColumnHeader.Width = 47;
+ //
+ // filteredColumnHeader
+ //
+ this.filteredColumnHeader.Text = "Filtered";
+ this.filteredColumnHeader.Width = 47;
+ //
+ // sourceAddressColumnHeader
+ //
+ this.sourceAddressColumnHeader.Text = "Source Address";
+ this.sourceAddressColumnHeader.Width = 75;
+ //
+ // reportedHostColumnHeader
+ //
+ this.reportedHostColumnHeader.Text = "Reported Host";
+ this.reportedHostColumnHeader.Width = 92;
+ //
+ // senderColumnHeader
+ //
+ this.senderColumnHeader.Text = "Sender";
+ this.senderColumnHeader.Width = 77;
+ //
+ // recipientsColumnHeader
+ //
+ this.recipientsColumnHeader.Text = "Recipients";
+ this.recipientsColumnHeader.Width = 347;
+ //
+ // bottomPanel
+ //
+ this.bottomPanel.Controls.Add(this.refreshButton);
+ this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.bottomPanel.Location = new System.Drawing.Point(0, 399);
+ this.bottomPanel.Name = "bottomPanel";
+ this.bottomPanel.Size = new System.Drawing.Size(755, 33);
+ this.bottomPanel.TabIndex = 1;
+ //
+ // refreshButton
+ //
+ this.refreshButton.Location = new System.Drawing.Point(3, 6);
+ this.refreshButton.Name = "refreshButton";
+ this.refreshButton.Size = new System.Drawing.Size(75, 23);
+ this.refreshButton.TabIndex = 0;
+ this.refreshButton.Text = "Refresh";
+ this.refreshButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.refreshButton.UseVisualStyleBackColor = true;
+ this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
+ //
+ // spoolContextMenu
+ //
+ this.spoolContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.viewRecipientsMenuItem,
+ this.deleteMenuItem,
+ this.toolStripSeparator1,
+ this.refreshMenuItem});
+ this.spoolContextMenu.Name = "spoolContextMenu";
+ this.spoolContextMenu.Size = new System.Drawing.Size(160, 76);
+ //
+ // viewRecipientsMenuItem
+ //
+ this.viewRecipientsMenuItem.Name = "viewRecipientsMenuItem";
+ this.viewRecipientsMenuItem.Size = new System.Drawing.Size(159, 22);
+ this.viewRecipientsMenuItem.Text = "View Recipients";
+ this.viewRecipientsMenuItem.Click += new System.EventHandler(this.viewRecipientsMenuItem_Click);
+ //
+ // deleteMenuItem
+ //
+ this.deleteMenuItem.Name = "deleteMenuItem";
+ this.deleteMenuItem.Size = new System.Drawing.Size(159, 22);
+ this.deleteMenuItem.Text = "Delete";
+ this.deleteMenuItem.Click += new System.EventHandler(this.deleteMenuItem_Click);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(156, 6);
+ //
+ // refreshMenuItem
+ //
+ this.refreshMenuItem.Name = "refreshMenuItem";
+ this.refreshMenuItem.Size = new System.Drawing.Size(159, 22);
+ this.refreshMenuItem.Text = "Refresh";
+ this.refreshMenuItem.Click += new System.EventHandler(this.refreshButton_Click);
+ //
+ // subjectColumnHeader
+ //
+ this.subjectColumnHeader.Text = "Subject";
+ this.subjectColumnHeader.Width = 83;
+ //
+ // SmtpSpoolManager
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.spoolListView);
+ this.Controls.Add(this.bottomPanel);
+ this.Name = "SmtpSpoolManager";
+ this.Size = new System.Drawing.Size(755, 432);
+ this.bottomPanel.ResumeLayout(false);
+ this.spoolContextMenu.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ImageList imageList;
+ private System.Windows.Forms.ListView spoolListView;
+ private System.Windows.Forms.Panel bottomPanel;
+ private System.Windows.Forms.ContextMenuStrip spoolContextMenu;
+ private System.Windows.Forms.ColumnHeader guidColumnHeader;
+ private System.Windows.Forms.ColumnHeader inProgressColumnHeader;
+ private System.Windows.Forms.ColumnHeader filteredColumnHeader;
+ private System.Windows.Forms.ColumnHeader sourceAddressColumnHeader;
+ private System.Windows.Forms.ColumnHeader reportedHostColumnHeader;
+ private System.Windows.Forms.ColumnHeader senderColumnHeader;
+ private System.Windows.Forms.ColumnHeader recipientsColumnHeader;
+ private System.Windows.Forms.Button refreshButton;
+ private System.Windows.Forms.ToolStripMenuItem viewRecipientsMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem deleteMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem refreshMenuItem;
+ private System.Windows.Forms.ColumnHeader subjectColumnHeader;
+ }
+}
Added: NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.cs
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.cs (rev 0)
+++ NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.cs 2007-06-10 14:34:21 UTC (rev 217)
@@ -0,0 +1,198 @@
+/*
+ * 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.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using NMail.DataTypes;
+using NMail.DataTypes.Service;
+using NMail.DataTypes.Spool;
+using NMail.Icons;
+
+namespace NMail.Administration.WinForms.Spool {
+ public partial class SmtpSpoolManager : UserControl {
+
+ private MainForm mainForm;
+
+ public SmtpSpoolManager(MainForm mainForm) {
+ InitializeComponent();
+
+ this.mainForm = mainForm;
+
+ // Setup icons
+ this.imageList.Images.Add(IconHelper.GetImage("mail_generic", "actions", IconSize.s16x16));
+ this.refreshButton.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
+ this.deleteMenuItem.Image = IconHelper.GetImage("delete", "actions", IconSize.s16x16);
+ this.refreshMenuItem.Image = IconHelper.GetImage("recur", "actions", IconSize.s16x16);
+ }
+
+ private ISpoolService GetSpool() {
+ ISpoolService spool = null;
+
+ foreach (ServiceStartInfo service in this.mainForm.RemoteAdministration.NMailServer.Services) {
+ if (service.Service is ISpoolService) {
+ spool = service.Service as ISpoolService;
+ break;
+ }
+ }
+
+ return spool;
+ }
+
+ private void refreshButton_Click(object sender, EventArgs e) {
+ try {
+ // Get a list of spooled messages
+ IList<SpoolEnvelope> envelopes = GetSpool().GetSpooledEnvelopes();
+
+ this.spoolListView.Items.Clear();
+
+ // Add them to the list view
+ foreach (SpoolEnvelope envelope in envelopes) {
+ ListViewItem item = new SpoolEnvelopeListViewItem(envelope);
+ this.spoolListView.Items.Add(item);
+ }
+
+ } catch (Exception ex) {
+ // Something bad :(
+ Program.ShowExceptionDialog(ex);
+ }
+ }
+
+ SpoolEnvelopeListViewItem clickedItem;
+
+ private void spoolListView_MouseUp(object sender, MouseEventArgs e) {
+ if (e.Button == MouseButtons.Right) {
+ // Get the item clicked on (if any)
+ this.clickedItem = this.spoolListView.GetItemAt(e.X, e.Y) as SpoolEnvelopeListViewItem;
+
+ // Update and show the context menu
+ updateContextMenu();
+ this.spoolContextMenu.Show(Control.MousePosition, ToolStripDropDownDirection.BelowRight);
+ }
+ }
+
+ /// <summary>
+ /// Updates the context menu based on the item clicked on
+ /// </summary>
+ private void updateContextMenu() {
+ this.viewRecipientsMenuItem.Enabled = (this.clickedItem != null);
+ this.deleteMenuItem.Enabled = (this.clickedItem != null);
+ }
+
+ private void spoolListView_MouseDoubleClick(object sender, MouseEventArgs e) {
+ if (e.Button == MouseButtons.Left) {
+ SpoolEnvelopeListViewItem item = this.spoolListView.GetItemAt(e.X, e.Y) as SpoolEnvelopeListViewItem;
+
+ if (item != null) {
+ ViewEnvelopeRecipients(item.Envelope);
+ }
+ }
+ }
+
+ private void viewRecipientsMenuItem_Click(object sender, EventArgs e) {
+ if (this.clickedItem != null) {
+ ViewEnvelopeRecipients(this.clickedItem.Envelope);
+ }
+ }
+
+ private void ViewEnvelopeRecipients(SpoolEnvelope envelope) {
+ //// Create a new editor and display it
+ //MailDomainEditor editor = new MailDomainEditor();
+ //editor.Dock = DockStyle.Fill;
+ //editor.TabText = "Edit Mail Domain";
+ //editor.OkButtonText = "Update";
+ //editor.Icon = IconHelper.GetIcon("server", "actions", IconSize.s16x16);
+ //editor.MailDomain = this.clickedItem.MailDomain;
+ //this.mainForm.DockFloat(editor, new Size(320, 440));
+
+ //// Add a handler for the editor's closing event
+ //editor.FormClosing += delegate(object s, FormClosingEventArgs fea) {
+
+ // if (editor.DialogResult == DialogResult.OK) {
+ // // Attempt to add the mail domain
+ // try {
+ // NMail.Authentication.IAuthenticationToken authToken = this.mainForm.AuthenticationToken;
+ // this.mainForm.RemoteAdministration.NMailServer.LocalStore.UpdateMailDomain(authToken, editor.MailDomain);
+ // } catch (Exception ex) {
+ // Program.ShowExceptionDialog(ex);
+ // }
+
+ // // Update the list of mail domains
+ // refreshButton_Click(this, new EventArgs());
+ // }
+ //};
+ }
+
+ private void deleteMenuItem_Click(object sender, EventArgs e) {
+ if (this.clickedItem != null) {
+ // Prompt the user to confirm deletion
+ DialogResult result = MessageBox.Show(
+ this,
+ string.Format("Really delete message: '{0}'?", this.clickedItem.Envelope.Subject),
+ "Confirm delete...",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Warning,
+ MessageBoxDefaultButton.Button2);
+
+ if (result == DialogResult.Yes) {
+ // Attempt to delete the message
+ try {
+ throw new NotImplementedException("Sorry - currently can't delete a spooled message!");
+ } catch (Exception ex) {
+ Program.ShowExceptionDialog(ex);
+ }
+
+ // Update the list of mail domains
+ refreshButton_Click(this, new EventArgs());
+ }
+ }
+ }
+ }
+
+ public class SpoolEnvelopeListViewItem : ListViewItem {
+
+ public SpoolEnvelopeListViewItem(SpoolEnvelope envelope) {
+ this.envelope = envelope;
+ this.ImageIndex = 0;
+
+ this.SubItems[0] = new ListViewSubItem(this, envelope.SpoolMessageId.ToString());
+ this.SubItems.Add(new ListViewSubItem(this, envelope.InProgress.ToString()));
+ this.SubItems.Add(new ListViewSubItem(this, envelope.Filtered.ToString()));
+ this.SubItems.Add(new ListViewSubItem(this, envelope.Subject));
+ this.SubItems.Add(new ListViewSubItem(this, envelope.SourceAddress.ToString()));
+ this.SubItems.Add(new ListViewSubItem(this, envelope.ReportedHost.ToString()));
+ this.SubItems.Add(new ListViewSubItem(this, envelope.Sender.ToString()));
+
+ string recipients = string.Empty;
+ foreach (SmtpMessageRecipient recipient in envelope.Recipients) {
+ recipients += recipient.Address.ToString() + "; ";
+ }
+ this.SubItems.Add(new ListViewSubItem(this, recipients));
+ }
+
+ private SpoolEnvelope envelope;
+
+ public SpoolEnvelope Envelope {
+ get { return envelope; }
+ }
+ }
+}
Added: NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.resx
===================================================================
--- NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.resx (rev 0)
+++ NMail/trunk/NMail.Administration.WinForms/Spool/SmtpSpoolManager.resx 2007-06-10 14:34:21 UTC (rev 217)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="spoolContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>116, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
Modified: NMail/trunk/NMail.Icons/NMail.Icons.csproj
===================================================================
--- NMail/trunk/NMail.Icons/NMail.Icons.csproj 2007-06-10 14:33:07 UTC (rev 216)
+++ NMail/trunk/NMail.Icons/NMail.Icons.csproj 2007-06-10 14:34:21 UTC (rev 217)
@@ -59,6 +59,8 @@
<EmbeddedResource Include="Resources\32x32\apps\password.png" />
<EmbeddedResource Include="Resources\16x16\actions\delete.png" />
<EmbeddedResource Include="Resources\16x16\actions\edit.png" />
+ <EmbeddedResource Include="Resources\16x16\actions\recur.png" />
+ <EmbeddedResource Include="Resources\16x16\actions\mail_generic.png" />
<Content Include="Resources\LGPL.txt" />
</ItemGroup>
<ItemGroup>
Added: NMail/trunk/NMail.Icons/Resources/16x16/actions/mail_generic.png
===================================================================
(Binary files differ)
Property changes on: NMail/trunk/NMail.Icons/Resources/16x16/actions/mail_generic.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: NMail/trunk/NMail.Icons/Resources/16x16/actions/recur.png
===================================================================
(Binary files differ)
Property changes on: NMail/trunk/NMail.Icons/Resources/16x16/actions/recur.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|