Revision: 59
Author: tmyroadctfig
Date: 2006-07-15 05:15:25 -0700 (Sat, 15 Jul 2006)
ViewCVS: http://svn.sourceforge.net/nmailserver/?rev=59&view=rev
Log Message:
-----------
Work on setup wizard.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs
NMail/branches/luke-dev/NMail/DataTypes/Domain.cs
NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs
NMail/branches/luke-dev/NMail/NMail.csproj
NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs
NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs
NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs
NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs
NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
NMail/branches/luke-dev/NMail.PostInstall/Program.cs
NMail/branches/luke-dev/NMail.Server.Console/NMail.config
NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs
NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/branches/luke-dev/NMail.SetupWizard/Program.cs
NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs
NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx
NMail/branches/luke-dev/NMail.SetupWizard/SmtpSubSysConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/WelcomePanel.cs
NMail/branches/luke-dev/NMail.SmtpClient/Configuration/SmtpClientConfiguration.cs
NMail/branches/luke-dev/NMail.SmtpService/Configuration/SmtpServiceConfiguration.cs
NMail/branches/luke-dev/NMail.SpoolData.MySql/Configuration/MySqlSpoolDataConfiguration.cs
NMail/branches/luke-dev/NMail.SpoolFilter/Configuration/SpoolFilterConfiguration.cs
NMail/branches/luke-dev/NMail.SpoolService/Configuration/SpoolServiceConfiguration.cs
Added Paths:
-----------
NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx
NMail/branches/luke-dev/NMail.SetupWizard/Resources/
NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png
NMail/branches/luke-dev/NMail.SetupWizard/Resources/ok.png
NMail/branches/luke-dev/NMail.SetupWizard/Resources/pending.png
NMail/branches/luke-dev/NMail.SetupWizard/Resources/warning.png
NMail/branches/luke-dev/NMail.SetupWizard/Task.cs
Added: NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs (rev 0)
+++ NMail/branches/luke-dev/NMail/Configuration/NMailConfigFile.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Text;
+
+namespace NMail.Configuration {
+ public class NMailConfigFile {
+ /// <summary>
+ /// Opens the configuration files and sets up the shared instance of this config.
+ /// </summary>
+ static NMailConfigFile() {
+ current = OpenConfig("NMail.config");
+ }
+
+ private static System.Configuration.Configuration current;
+
+ public static System.Configuration.Configuration Current {
+ get {
+ return current;
+ }
+ set {
+ current = value;
+ }
+ }
+
+ public static System.Configuration.Configuration OpenConfig(string configFilename) {
+ ExeConfigurationFileMap cfm = new ExeConfigurationFileMap();
+ cfm.ExeConfigFilename = configFilename;
+ return ConfigurationManager.OpenMappedExeConfiguration(cfm, ConfigurationUserLevel.None);
+ }
+ }
+}
Modified: NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail/Configuration/NMailConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -31,38 +31,37 @@
/// The global NMail configuration.
/// </summary>
public class NMailConfiguration : ConfigurationSection {
-
/// <summary>
- /// Opens the configuration files and sets up the shared instance of this config.
+ /// Adds a NMail configuration section to the current config file.
/// </summary>
- static NMailConfiguration() {
- ExeConfigurationFileMap cfm = new ExeConfigurationFileMap();
- cfm.ExeConfigFilename = "NMail.config";
- configFile = ConfigurationManager.OpenMappedExeConfiguration(cfm, ConfigurationUserLevel.None);
- current = (NMailConfiguration) configFile.GetSection("NMail");
+ public static void AddToConfigFile() {
+ if (NMailConfigFile.Current.Sections["NMail"] == null) {
+ NMailConfigFile.Current.Sections.Add("NMail", new NMailConfiguration());
+ }
}
- private static System.Configuration.Configuration configFile;
-
/// <summary>
- /// Gets the configuration section for the given section name.
+ /// Returns true if a NMail configuration section exists in the current
+ /// configuration.
/// </summary>
- /// <param name="sectionName">The section name to lookup.</param>
- /// <returns>The configuration section.</returns>
- public static ConfigurationSection GetSection(string sectionName) {
- return configFile.GetSection(sectionName);
+ public static bool ConfigurationPresent {
+ get {
+ return (NMailConfigFile.Current.Sections["NMail"] != null);
+ }
}
- private static NMailConfiguration current;
-
/// <summary>
/// Returns the current NMail configuration.
/// </summary>
public static NMailConfiguration Current {
get {
+ NMailConfiguration current;
+ current = (NMailConfiguration) NMailConfigFile.Current.GetSection("NMail");
+
if (current == null) {
throw new ConfigurationErrorsException("NMail configuration is missing");
}
+
return current;
}
}
Modified: NMail/branches/luke-dev/NMail/DataTypes/Domain.cs
===================================================================
--- NMail/branches/luke-dev/NMail/DataTypes/Domain.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail/DataTypes/Domain.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -210,6 +210,11 @@
/// <summary>
/// The "localhost" domain.
/// </summary>
- public static readonly Domain LocalHost = new Domain("localhost");
+ public static readonly Domain LocalHost = new Domain(LocalHostString);
+
+ /// <summary>
+ /// The "localhost" string.
+ /// </summary>
+ public const string LocalHostString = "localhost";
}
}
Modified: NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs
===================================================================
--- NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail/DataTypes/Spool/SpoolRecipient.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2006 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.Text;
Modified: NMail/branches/luke-dev/NMail/NMail.csproj
===================================================================
--- NMail/branches/luke-dev/NMail/NMail.csproj 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail/NMail.csproj 2006-07-15 12:15:25 UTC (rev 59)
@@ -117,6 +117,7 @@
<Compile Include="Configuration\NMailConfiguration.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Configuration\NMailConfigFile.cs" />
<Compile Include="Configuration\ObjectConfigurationElement.cs" />
<Compile Include="Configuration\ObjectConfigurationElementCollection.cs" />
<Compile Include="Configuration\WildcardHostElementCollection.cs" />
Modified: NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.DnsClient/Configuration/DnsClientConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -28,17 +28,33 @@
/// DNS client configuration.
/// </summary>
public class DnsClientConfiguration : ConfigurationSection {
- private static DnsClientConfiguration current;
+ /// <summary>
+ /// Adds a DNS client configuration section to the current config file.
+ /// </summary>
+ public static void AddToConfigFile() {
+ if (NMailConfigFile.Current.Sections["NMail.DnsClient"] == null) {
+ NMailConfigFile.Current.Sections.Add("NMail.DnsClient", new DnsClientConfiguration());
+ }
+ }
- static DnsClientConfiguration() {
- current = (DnsClientConfiguration) NMailConfiguration.GetSection("NMail.DnsClient");
+ /// <summary>
+ /// Returns true if a DNS client configuration section exists in the current
+ /// configuration.
+ /// </summary>
+ public static bool ConfigurationPresent {
+ get {
+ return (NMailConfigFile.Current.Sections["NMail.DnsClient"] != null);
+ }
}
/// <summary>
- /// Returns the current NMail configuration.
+ /// Returns the current DNS client configuration.
/// </summary>
public static DnsClientConfiguration Current {
get {
+ DnsClientConfiguration current;
+ current = (DnsClientConfiguration) NMailConfigFile.Current.GetSection("NMail.DnsClient");
+
if (current == null) {
throw new ConfigurationErrorsException("NMail DNS Client configuration is missing");
}
Modified: NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.ImapService/Configuration/ImapServiceConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -33,7 +33,7 @@
private static ImapServiceConfiguration current;
static ImapServiceConfiguration() {
- current = (ImapServiceConfiguration) NMailConfiguration.GetSection("NMail.ImapService");
+ current = (ImapServiceConfiguration) NMailConfigFile.Current.GetSection("NMail.ImapService");
}
/// <summary>
Modified: NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.LocalStoreData.MySql/Configuration/MySqlLocalStoreDataConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -32,7 +32,7 @@
private static MySqlLocalStoreDataConfiguration current;
static MySqlLocalStoreDataConfiguration() {
- current = (MySqlLocalStoreDataConfiguration) NMailConfiguration.GetSection("NMail.LocalStoreData.MySql");
+ current = (MySqlLocalStoreDataConfiguration) NMailConfigFile.Current.GetSection("NMail.LocalStoreData.MySql");
}
public static MySqlLocalStoreDataConfiguration Current {
Modified: NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs
===================================================================
--- NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.MessageRouter/Configuration/MessageRouterConfiguration.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -29,15 +29,22 @@
/// </summary>
public class MessageRouterConfiguration : ConfigurationSection {
/// <summary>
- /// The current configuration in use.
+ /// Adds a message router configuration section to the current config file.
/// </summary>
- private static MessageRouterConfiguration current;
+ public static void AddToConfigFile() {
+ if (NMailConfigFile.Current.Sections["NMail.MessageRouter"] == null) {
+ NMailConfigFile.Current.Sections.Add("NMail.MessageRouter", new MessageRouterConfiguration());
+ }
+ }
/// <summary>
- /// Sets up the current configuration.
+ /// Returns true if a message router configuration section exists in the current
+ /// configuration.
/// </summary>
- static MessageRouterConfiguration() {
- current = (MessageRouterConfiguration) NMailConfiguration.GetSection("NMail.MessageRouter");
+ public static bool ConfigurationPresent {
+ get {
+ return (NMailConfigFile.Current.Sections["NMail.MessageRouter"] != null);
+ }
}
/// <summary>
@@ -45,6 +52,9 @@
/// </summary>
public static MessageRouterConfiguration Current {
get {
+ MessageRouterConfiguration current;
+ current = (MessageRouterConfiguration) NMailConfigFile.Current.GetSection("NMail.MessageRouter");
+
if (current == null) {
throw new ConfigurationErrorsException("NMail Message Router configuration is missing");
}
Modified: NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.PostInstall/PostInstallForm.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2006 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;
@@ -5,6 +22,7 @@
using System.Diagnostics;
using System.Drawing;
using System.Text;
+using System.Threading;
using System.Windows.Forms;
using NMail.SmtpService;
@@ -14,10 +32,10 @@
public PostInstallForm() {
InitializeComponent();
- SetupSmtpServiceCounters();
+ ThreadPool.QueueUserWorkItem(new WaitCallback(SetupSmtpServiceCounters()));
}
- private void SetupSmtpServiceCounters() {
+ private void SetupSmtpServiceCounters(object unused) {
if (PerformanceCounterCategory.Exists(SmtpService.SmtpService.PerfCounterCategory)) {
// Remove any old performance counters if they are present
PerformanceCounterCategory.Delete(SmtpService.SmtpService.PerfCounterCategory);
Modified: NMail/branches/luke-dev/NMail.PostInstall/Program.cs
===================================================================
--- NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.PostInstall/Program.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2006 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.Windows.Forms;
Modified: NMail/branches/luke-dev/NMail.Server.Console/NMail.config
===================================================================
--- NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.Server.Console/NMail.config 2006-07-15 12:15:25 UTC (rev 59)
@@ -81,51 +81,6 @@
<NMail.SpoolFilterService>
<Filter Type="NMail.SpoolFilter.NoActionFilter, NMail.SpoolFilter" />
</NMail.SpoolFilterService>
-
- <NMail.LocalStore>
- <DeliveryActions>
- <DeliveryAction Name="virusScan" Type="NMail.LocalStore.DeliveryActions.ClamAvScanner, NMail.LocalStore" />
- <DeliveryAction Name="manageWhiteList" Type="NMail.LocalStore.DeliveryActions.ManageWhiteList, NMail.LocalStore" />
- </DeliveryActions>
-
- <!--<DefaultValidator Name="onWhiteList" Type="NMail.LocalStore.Validators.OnWhiteList, NMail.LocalStore">-->
-
- <!--<FailValidator Name="sender" Type="NMail.LocalStore.Validators.AddressSender, NMail.LocalStore">-->
-
- <!-- <failValidator name="date" type="NMail.LocalStore.Validators.AddressDate, NMail.LocalStore">
-
- <failValidator name="keyword" type="NMail.LocalStore.Validators.AddressKeyword, NMail.LocalStore">
-
- <failValidator name="blackList" type="NMail.LocalStore.Validators.OrdbBlackList, NMail.LocalStore">
- <settings server="relays.ordb.org"/>
- </failValidator>
- </failValidator>
- </failValidator>-->
- <!--</FailValidator>-->
- <!--</DefaultValidator>-->
-
- <AcceptCases>
- <AcceptCase>
- <AcceptHosts>
- <Accept Match="localhost" />
- <!-- <Accept Match="mydomain.local" /> -->
- </AcceptHosts>
-
- <AllowedDeliveryActions>
- <DeliveryAction Name="mv" Type="NMail.LocalStore.DeliveryActions.Move, NMail.LocalStore" />
- <DeliveryAction Name="cp" Type="NMail.LocalStore.DeliveryActions.Copy, NMail.LocalStore" />
- </AllowedDeliveryActions>
-
- <AllowedRecipientValidators>
- <RecipientValidator Name="blackList" Type="NMail.LocalStore.Validators.OrdbBlackList, NMail.LocalStore"/>
- </AllowedRecipientValidators>
-
- <MailboxMappings>
- <MailboxMapping Type="NMail.LocalStoreData.MySql.MySqlLocalStoreData, NMail.LocalStoreData.MySql" />
- </MailboxMappings>
- </AcceptCase>
- </AcceptCases>
- </NMail.LocalStore>
<NMail.SpoolData.MySql ConnectionString="Database=NMailSpool;Uid=NMail;Password=moo" />
Modified: NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/BaseForm.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,11 +1,32 @@
+/*
+ * Copyright 2004-2006 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.Configuration;
using System.Data;
using System.Drawing;
using System.Text;
+using System.Threading;
using System.Windows.Forms;
+using NMail.Configuration;
+
namespace NMail.SetupWizard {
public partial class BaseForm : Form {
public BaseForm() {
@@ -18,5 +39,13 @@
panel.Dock = DockStyle.Fill;
this.Controls.Add(panel);
}
+
+ private List<Task> taskList = new List<Task>();
+
+ public List<Task> Tasks {
+ get {
+ return this.taskList;
+ }
+ }
}
}
\ No newline at end of file
Modified: NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.Designer.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -43,7 +43,7 @@
this.nextButton.TabIndex = 2;
this.nextButton.Text = "Next >";
this.nextButton.UseVisualStyleBackColor = true;
- this.nextButton.Click += new System.EventHandler(this.OnNextButtonClick);
+ this.nextButton.Click += new System.EventHandler(this.NextButton_Click);
//
// titleLabel
//
@@ -81,7 +81,7 @@
this.backButton.TabIndex = 1;
this.backButton.Text = "< Back";
this.backButton.UseVisualStyleBackColor = true;
- this.backButton.Click += new System.EventHandler(this.OnBackButtonClick);
+ this.backButton.Click += new System.EventHandler(this.BackButton_Click);
//
// cancelButton
//
@@ -91,7 +91,7 @@
this.cancelButton.TabIndex = 0;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
- this.cancelButton.Click += new System.EventHandler(this.OnCancelButtonClick);
+ this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click);
//
// leftPanel
//
Modified: NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/BasePanel.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2006 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;
@@ -49,20 +66,39 @@
}
}
- protected virtual void OnCancelButtonClick(object sender, EventArgs e) {
+ #region Private Event Handlers
+
+ private void CancelButton_Click(object sender, EventArgs e) {
+ OnCancelButtonClick();
+ }
+
+ private void BackButton_Click(object sender, EventArgs e) {
+ OnBackButtonClick();
+ }
+
+ private void NextButton_Click(object sender, EventArgs e) {
+ OnNextButtonClick();
+ }
+ #endregion
+
+ protected virtual void OnCancelButtonClick() {
this.BaseForm.Close();
}
- protected virtual void OnBackButtonClick(object sender, EventArgs e) {
+ protected virtual void OnBackButtonClick() {
if (this.PreviousPanel != null) {
this.BaseForm.SetPanel(this.PreviousPanel);
+ this.PreviousPanel.OnPanelDisplayed();
}
}
- protected virtual void OnNextButtonClick(object sender, EventArgs e) {
+ protected virtual void OnNextButtonClick() {
if (this.NextPanel != null) {
this.BaseForm.SetPanel(this.NextPanel);
+ this.NextPanel.OnPanelDisplayed();
}
}
+
+ protected virtual void OnPanelDisplayed() { }
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/DnsConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004-2006 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;
@@ -7,14 +24,37 @@
using System.Text;
using System.Windows.Forms;
+using NMail.Configuration;
+using NMail.DnsClient.Configuration;
+
namespace NMail.SetupWizard {
public partial class DnsConfigPanel : BasePanel {
+
+ private DnsClientConfiguration config;
+
public DnsConfigPanel(BaseForm baseForm, BasePanel previous) : base(baseForm) {
InitializeComponent();
this.PreviousPanel = previous;
- this.dnsList.Items.Add(IPAddress.Loopback);
this.NextPanel = new SmtpSubSysConfigPanel(this.BaseForm, this);
+
+ // Ensure the config has a dns client section
+ if (!DnsClientConfiguration.ConfigurationPresent) {
+ DnsClientConfiguration.AddToConfigFile();
+ }
+
+ config = DnsClientConfiguration.Current;
+
+ if (config.DnsServers.Count > 0) {
+ // Add any DNS servers from the current config
+ for (int i = 0; i < this.config.DnsServers.Count; i++) {
+ this.dnsList.Items.Add(this.config.DnsServers[i].Address);
+ }
+
+ } else {
+ // If there were non configured, add localhost
+ this.dnsList.Items.Add(IPAddress.Loopback);
+ }
}
private void addBtn_Click(object sender, EventArgs e) {
@@ -39,5 +79,19 @@
this.dnsList.Items.RemoveAt(this.dnsList.SelectedIndex);
}
}
+
+ protected override void OnNextButtonClick() {
+ // Clear the list of DNS servers
+ DnsClientConfiguration.Current.DnsServers.Clear();
+
+ // Add the list of configured DNS servers
+ foreach (IPAddress server in this.dnsList.Items) {
+ IPAddressElement element = new IPAddressElement();
+ element.Address = server;
+ DnsClientConfiguration.Current.DnsServers.Add(element);
+ }
+
+ base.OnNextButtonClick();
+ }
}
}
Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -0,0 +1,100 @@
+namespace NMail.SetupWizard {
+ partial class FinalConfigPanel {
+ /// <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.taskListView = new System.Windows.Forms.ListView();
+ this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
+ this.imageList = new System.Windows.Forms.ImageList(this.components);
+ this.descriptionTextBox = new System.Windows.Forms.TextBox();
+ this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ this.mainPanel.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // titleLabel
+ //
+ this.titleLabel.Size = new System.Drawing.Size(145, 29);
+ this.titleLabel.Text = "Final Steps";
+ //
+ // mainPanel
+ //
+ this.mainPanel.Controls.Add(this.descriptionTextBox);
+ this.mainPanel.Controls.Add(this.taskListView);
+ //
+ // taskListView
+ //
+ this.taskListView.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.taskListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1});
+ this.taskListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
+ this.taskListView.Location = new System.Drawing.Point(65, 63);
+ this.taskListView.MultiSelect = false;
+ this.taskListView.Name = "taskListView";
+ this.taskListView.Size = new System.Drawing.Size(232, 211);
+ this.taskListView.SmallImageList = this.imageList;
+ this.taskListView.TabIndex = 0;
+ this.taskListView.UseCompatibleStateImageBehavior = false;
+ this.taskListView.View = System.Windows.Forms.View.Details;
+ //
+ // 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;
+ //
+ // descriptionTextBox
+ //
+ this.descriptionTextBox.BackColor = System.Drawing.Color.White;
+ this.descriptionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.descriptionTextBox.Location = new System.Drawing.Point(8, 8);
+ this.descriptionTextBox.Multiline = true;
+ this.descriptionTextBox.Name = "descriptionTextBox";
+ this.descriptionTextBox.ReadOnly = true;
+ this.descriptionTextBox.Size = new System.Drawing.Size(343, 40);
+ this.descriptionTextBox.TabIndex = 2;
+ this.descriptionTextBox.TabStop = false;
+ this.descriptionTextBox.Text = "The NMail setup is almost complete. Below are a list of actions that will be perf" +
+ "ormed, click \"Next\" to continue.";
+ //
+ // FinalConfigPanel
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Name = "FinalConfigPanel";
+ this.mainPanel.ResumeLayout(false);
+ this.mainPanel.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ListView taskListView;
+ private System.Windows.Forms.TextBox descriptionTextBox;
+ private System.Windows.Forms.ImageList imageList;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ToolTip toolTip;
+
+ }
+}
Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs (rev 0)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2004-2006 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.Threading;
+using System.Windows.Forms;
+
+namespace NMail.SetupWizard {
+ public partial class FinalConfigPanel : BasePanel {
+ public FinalConfigPanel(BaseForm baseForm, BasePanel previous) : base(baseForm) {
+ InitializeComponent();
+
+ this.PreviousPanel = previous;
+
+ this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.pending);
+ this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.ok);
+ this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.warning);
+ this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.error);
+
+ this.taskListView.Columns[0].Width = this.taskListView.Width;
+ }
+
+ private Dictionary<Task, ListViewItem> taskMap = new Dictionary<Task, ListViewItem>();
+
+ protected override void OnPanelDisplayed() {
+ this.taskMap.Clear();
+
+ // Re-populate the task list
+ foreach (Task task in this.BaseForm.Tasks) {
+ ListViewItem item = new ListViewItem(task.Description, 0);
+ item.Tag = task;
+ this.taskMap.Add(task, item);
+ this.taskListView.Items.Add(item);
+ }
+ }
+
+ private bool tasksRun = false;
+
+ protected override void OnNextButtonClick() {
+ lock (this) {
+ if (!this.tasksRun) {
+ // Disable the buttons and start running the tasks
+ this.tasksRun = true;
+ this.nextButton.Enabled = false;
+ this.backButton.Enabled = false;
+ this.cancelButton.Enabled = false;
+
+ ThreadPool.QueueUserWorkItem(new WaitCallback(processTasks));
+
+ } else {
+ this.BaseForm.Close();
+ }
+ }
+ }
+
+ private void processTasks(object unused) {
+ foreach (Task task in this.BaseForm.Tasks) {
+ string message;
+
+ TaskResult result = task.TaskProcessing(out message);
+
+ // Update the task list with the result from this task
+ object[] updateArgs = { task, result, message };
+ this.Invoke(new updateTaskDelegate(updateTask), updateArgs);
+ }
+
+ object[] args = { null };
+ this.BeginInvoke(new WaitCallback(enableFinishButton), args);
+ }
+
+ delegate void updateTaskDelegate(Task task, TaskResult result, string message);
+
+ public void updateTask(Task task, TaskResult result, string message) {
+ ListViewItem item = this.taskMap[task];
+
+ if (result == TaskResult.Error) {
+ item.ImageIndex = 3;
+ item.ToolTipText = message;
+ } else if (result == TaskResult.Warning) {
+ item.ImageIndex = 2;
+ item.ToolTipText = message;
+ } else {
+ item.ImageIndex = 1;
+ }
+ }
+
+ public void enableFinishButton(object o) {
+ this.nextButton.Text = "Finish";
+ this.nextButton.Enabled = true;
+ this.backButton.Enabled = false;
+ this.cancelButton.Enabled = false;
+ }
+ }
+}
Added: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx (rev 0)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.resx 2006-07-15 12:15:25 UTC (rev 59)
@@ -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="toolTip.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/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/NMail.SetupWizard.csproj 2006-07-15 12:15:25 UTC (rev 59)
@@ -29,6 +29,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
+ <Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
@@ -54,6 +55,12 @@
<Compile Include="DnsConfigPanel.Designer.cs">
<DependentUpon>DnsConfigPanel.cs</DependentUpon>
</Compile>
+ <Compile Include="FinalConfigPanel.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="FinalConfigPanel.Designer.cs">
+ <DependentUpon>FinalConfigPanel.cs</DependentUpon>
+ </Compile>
<Compile Include="SmtpSubSysConfigPanel.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -74,6 +81,10 @@
<SubType>Designer</SubType>
<DependentUpon>DnsConfigPanel.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="FinalConfigPanel.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>FinalConfigPanel.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -90,6 +101,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
+ <DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -100,6 +112,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
+ <Compile Include="Task.cs" />
<Compile Include="WelcomePanel.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -108,11 +121,51 @@
</Compile>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\NMail.DnsClient\NMail.DnsClient.csproj">
+ <Project>{103510D8-6042-4556-98A2-9FD10D215454}</Project>
+ <Name>NMail.DnsClient</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.MessageRouter\NMail.MessageRouter.csproj">
+ <Project>{0AB0E8BA-8CAE-479E-AC85-8255103A107C}</Project>
+ <Name>NMail.MessageRouter</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.SmtpClient\NMail.SmtpClient.csproj">
+ <Project>{8CDAF015-FF14-4960-BC91-6F2618A6FED3}</Project>
+ <Name>NMail.SmtpClient</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.SmtpService\NMail.SmtpService.csproj">
+ <Project>{AEFF4DA8-7243-44C2-8223-69035380B042}</Project>
+ <Name>NMail.SmtpService</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.SpoolData.MySql\NMail.SpoolData.MySql.csproj">
+ <Project>{68D6D57F-02CC-419F-8D69-3B479A1BFBED}</Project>
+ <Name>NMail.SpoolData.MySql</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.SpoolFilter\NMail.SpoolFilter.csproj">
+ <Project>{1C585C54-6FE4-47F5-9A1F-8437F412DCF5}</Project>
+ <Name>NMail.SpoolFilter</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NMail.SpoolService\NMail.SpoolService.csproj">
+ <Project>{81EA6856-1AA7-4278-B0CC-1F851B987DA0}</Project>
+ <Name>NMail.SpoolService</Name>
+ </ProjectReference>
<ProjectReference Include="..\NMail\NMail.csproj">
<Project>{5A5A5012-B157-49B1-A35F-67EC9680112A}</Project>
<Name>NMail</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\warning.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\error.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\ok.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\pending.png" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Modified: NMail/branches/luke-dev/NMail.SetupWizard/Program.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/Program.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/Program.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,7 +1,28 @@
+/*
+ * Copyright 2004-2006 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.Configuration;
+using System.IO;
using System.Windows.Forms;
+using NMail.Configuration;
+
namespace NMail.SetupWizard {
static class Program {
/// <summary>
@@ -12,9 +33,59 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
+ // Ensure the config file has an NMail section
+ NMailConfiguration.AddToConfigFile();
+ NMailConfiguration configuration = NMailConfiguration.Current;
+
BaseForm baseForm = new BaseForm();
baseForm.SetPanel(new WelcomePanel(baseForm));
+
+ // Setup any tasks
+ Task task;
+
+ if (NMailConfigFile.Current.HasFile) {
+ task = new Task("Backup NMail configuration", new TaskDelegate(backupNMailConfig));
+ baseForm.Tasks.Add(task);
+ }
+
+ task = new Task("Save NMail configuration", new TaskDelegate(saveNMailConfig));
+ baseForm.Tasks.Add(task);
+
Application.Run(baseForm);
}
+
+ private static TaskResult backupNMailConfig(out string message) {
+ try {
+ string file = NMailConfigFile.Current.FilePath;
+ string backupFile = file + ".backup";
+
+ // Remove any previous backup
+ if (File.Exists(backupFile)) {
+ File.Delete(backupFile);
+ }
+
+ // Make a copy of the file
+ File.Copy(file, backupFile);
+
+ message = null;
+ return TaskResult.Ok;
+
+ } catch (Exception e) {
+ message = "Error backing up NMail configuration: " + e.Message;
+ return TaskResult.Error;
+ }
+ }
+
+ private static TaskResult saveNMailConfig(out string message) {
+ try {
+ NMailConfigFile.Current.Save(ConfigurationSaveMode.Minimal, true);
+ message = null;
+ return TaskResult.Ok;
+
+ } catch (Exception e) {
+ message = "Error saving NMail configuration: " + e.Message;
+ return TaskResult.Error;
+ }
+ }
}
}
\ No newline at end of file
Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/AssemblyInfo.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -1,4 +1,21 @@
-using System.Reflection;
+/*
+ * Copyright 2004-2006 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.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -6,7 +23,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NMail.SetupWizard")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("A wizard for setting up NMail installations.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NMail.SetupWizard")]
Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.Designer.cs 2006-07-15 12:15:25 UTC (rev 59)
@@ -9,54 +9,83 @@
//------------------------------------------------------------------------------
namespace NMail.SetupWizard.Properties {
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if ((resourceMan == null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NMail.SetupWizard.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NMail.SetupWizard.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ internal static System.Drawing.Bitmap error {
+ get {
+ object obj = ResourceManager.GetObject("error", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap ok {
+ get {
+ object obj = ResourceManager.GetObject("ok", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap pending {
+ get {
+ object obj = ResourceManager.GetObject("pending", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ internal static System.Drawing.Bitmap warning {
+ get {
+ object obj = ResourceManager.GetObject("warning", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx 2006-07-11 12:25:54 UTC (rev 58)
+++ NMail/branches/luke-dev/NMail.SetupWizard/Properties/Resources.resx 2006-07-15 12:15:25 UTC (rev 59)
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: 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">
@@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
+ <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">
@@ -85,9 +87,10 @@
<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" msdata:Ordinal="1" />
+ <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">
@@ -114,4 +117,17 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="error" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ok.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="pending" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\pending.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
</root>
\ No newline at end of file
Added: NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png
===================================================================
(Binary files differ)
Property changes on: NMail/branches/luke-dev/NMail.SetupWizard/Resources/error.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added...
[truncated message content] |