wfrm_Delivery.cs
上传用户:horngjaan
上传日期:2009-12-12
资源大小:2882k
文件大小:31k
- using System;
- using System.IO;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
- using System.Net;
- namespace LumiSoft.MailServer
- {
- /// <summary>
- /// Summary description for Delivery.
- /// </summary>
- public class wfrm_Delivery : System.Windows.Forms.Form
- {
- private LumiSoft.UI.Controls.WEditBox m_pSecDNS;
- private LumiSoft.UI.Controls.WEditBox m_pPriDNS;
- private LumiSoft.UI.Controls.WEditBox m_pSmartHost;
- private LumiSoft.UI.Controls.WLabel mt_secdns;
- private LumiSoft.UI.Controls.WLabel mt_pridns;
- private LumiSoft.UI.Controls.WLabel mt_smarthost;
- private System.Windows.Forms.RadioButton m_pDNS;
- private System.Windows.Forms.RadioButton m_pUseSmartHost;
- private LumiSoft.UI.Controls.WButton m_pSave;
- private LumiSoft.UI.Controls.WLabel mt_maxthreads;
- private LumiSoft.UI.Controls.WSpinEdit m_pMaxThreads;
- private LumiSoft.UI.Controls.WSpinEdit m_pRelayInterval;
- private LumiSoft.UI.Controls.WLabel mt_RelayInterval;
- private LumiSoft.UI.Controls.WSpinEdit m_pRelayRetryInterval;
- private LumiSoft.UI.Controls.WLabel mt_RelayRetryInterval;
- private LumiSoft.UI.Controls.WLabel wLabel1;
- private LumiSoft.UI.Controls.WLabel wLabel2;
- private LumiSoft.UI.Controls.WLabel wLabel3;
- private LumiSoft.UI.Controls.WLabel wLabel4;
- private LumiSoft.UI.Controls.WLabel wLabel5;
- private LumiSoft.UI.Controls.WLabel wLabel6;
- private LumiSoft.UI.Controls.WSpinEdit m_pUndelivered;
- private LumiSoft.UI.Controls.WSpinEdit m_pUndeliveredWarning;
- private LumiSoft.UI.Controls.WButton m_UndelWarningText;
- private LumiSoft.UI.Controls.WButton m_pUndeliveredText;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- private DataSet dsSettings = null;
- /// <summary>
- /// Default constructor.
- /// </summary>
- /// <param name="ds"></param>
- public wfrm_Delivery(DataSet ds)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- try
- {
- dsSettings = ds;
- RefreshForm();
- RefreshRadioBtns();
- }
- catch(Exception x)
- {
- wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
- frm.ShowDialog(this);
- }
- }
- #region function Dispose
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #endregion
- #region Windows Form 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.m_pSecDNS = new LumiSoft.UI.Controls.WEditBox();
- this.m_pPriDNS = new LumiSoft.UI.Controls.WEditBox();
- this.m_pSmartHost = new LumiSoft.UI.Controls.WEditBox();
- this.mt_secdns = new LumiSoft.UI.Controls.WLabel();
- this.mt_pridns = new LumiSoft.UI.Controls.WLabel();
- this.mt_smarthost = new LumiSoft.UI.Controls.WLabel();
- this.m_pDNS = new System.Windows.Forms.RadioButton();
- this.m_pUseSmartHost = new System.Windows.Forms.RadioButton();
- this.mt_maxthreads = new LumiSoft.UI.Controls.WLabel();
- this.m_pMaxThreads = new LumiSoft.UI.Controls.WSpinEdit();
- this.m_pSave = new LumiSoft.UI.Controls.WButton();
- this.m_pRelayInterval = new LumiSoft.UI.Controls.WSpinEdit();
- this.mt_RelayInterval = new LumiSoft.UI.Controls.WLabel();
- this.m_pRelayRetryInterval = new LumiSoft.UI.Controls.WSpinEdit();
- this.mt_RelayRetryInterval = new LumiSoft.UI.Controls.WLabel();
- this.m_pUndeliveredWarning = new LumiSoft.UI.Controls.WSpinEdit();
- this.wLabel1 = new LumiSoft.UI.Controls.WLabel();
- this.m_pUndelivered = new LumiSoft.UI.Controls.WSpinEdit();
- this.wLabel2 = new LumiSoft.UI.Controls.WLabel();
- this.wLabel3 = new LumiSoft.UI.Controls.WLabel();
- this.wLabel4 = new LumiSoft.UI.Controls.WLabel();
- this.wLabel5 = new LumiSoft.UI.Controls.WLabel();
- this.wLabel6 = new LumiSoft.UI.Controls.WLabel();
- this.m_UndelWarningText = new LumiSoft.UI.Controls.WButton();
- this.m_pUndeliveredText = new LumiSoft.UI.Controls.WButton();
- ((System.ComponentModel.ISupportInitialize)(this.m_pSecDNS)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pPriDNS)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pSmartHost)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pMaxThreads)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pSave)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pRelayInterval)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pRelayRetryInterval)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndeliveredWarning)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndelivered)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_UndelWarningText)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndeliveredText)).BeginInit();
- this.SuspendLayout();
- //
- // m_pSecDNS
- //
- this.m_pSecDNS.DecimalPlaces = 2;
- this.m_pSecDNS.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pSecDNS.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pSecDNS.Lines = new string[0];
- this.m_pSecDNS.Location = new System.Drawing.Point(504, 64);
- this.m_pSecDNS.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
- this.m_pSecDNS.MaxLength = 32767;
- this.m_pSecDNS.Multiline = false;
- this.m_pSecDNS.Name = "m_pSecDNS";
- this.m_pSecDNS.PasswordChar = ' ';
- this.m_pSecDNS.ReadOnly = false;
- this.m_pSecDNS.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.m_pSecDNS.Size = new System.Drawing.Size(100, 20);
- this.m_pSecDNS.TabIndex = 11;
- this.m_pSecDNS.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pSecDNS.UseStaticViewStyle = true;
- //
- // m_pPriDNS
- //
- this.m_pPriDNS.DecimalPlaces = 2;
- this.m_pPriDNS.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pPriDNS.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pPriDNS.Lines = new string[0];
- this.m_pPriDNS.Location = new System.Drawing.Point(304, 64);
- this.m_pPriDNS.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
- this.m_pPriDNS.MaxLength = 32767;
- this.m_pPriDNS.Multiline = false;
- this.m_pPriDNS.Name = "m_pPriDNS";
- this.m_pPriDNS.PasswordChar = ' ';
- this.m_pPriDNS.ReadOnly = false;
- this.m_pPriDNS.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.m_pPriDNS.Size = new System.Drawing.Size(100, 20);
- this.m_pPriDNS.TabIndex = 10;
- this.m_pPriDNS.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pPriDNS.UseStaticViewStyle = true;
- //
- // m_pSmartHost
- //
- this.m_pSmartHost.DecimalPlaces = 2;
- this.m_pSmartHost.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pSmartHost.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pSmartHost.Lines = new string[0];
- this.m_pSmartHost.Location = new System.Drawing.Point(304, 40);
- this.m_pSmartHost.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Text;
- this.m_pSmartHost.MaxLength = 32767;
- this.m_pSmartHost.Multiline = false;
- this.m_pSmartHost.Name = "m_pSmartHost";
- this.m_pSmartHost.PasswordChar = ' ';
- this.m_pSmartHost.ReadOnly = false;
- this.m_pSmartHost.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.m_pSmartHost.Size = new System.Drawing.Size(100, 20);
- this.m_pSmartHost.TabIndex = 9;
- this.m_pSmartHost.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pSmartHost.UseStaticViewStyle = true;
- //
- // mt_secdns
- //
- this.mt_secdns.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_secdns.Location = new System.Drawing.Point(408, 64);
- this.mt_secdns.Name = "mt_secdns";
- this.mt_secdns.Size = new System.Drawing.Size(94, 24);
- this.mt_secdns.TabIndex = 8;
- this.mt_secdns.Text = "Secondary DNS";
- this.mt_secdns.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_secdns.UseStaticViewStyle = true;
- //
- // mt_pridns
- //
- this.mt_pridns.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_pridns.Location = new System.Drawing.Point(216, 64);
- this.mt_pridns.Name = "mt_pridns";
- this.mt_pridns.Size = new System.Drawing.Size(86, 24);
- this.mt_pridns.TabIndex = 7;
- this.mt_pridns.Text = "Primary DNS";
- this.mt_pridns.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_pridns.UseStaticViewStyle = true;
- //
- // mt_smarthost
- //
- this.mt_smarthost.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_smarthost.Location = new System.Drawing.Point(216, 40);
- this.mt_smarthost.Name = "mt_smarthost";
- this.mt_smarthost.Size = new System.Drawing.Size(86, 24);
- this.mt_smarthost.TabIndex = 6;
- this.mt_smarthost.Text = "SmartHost";
- this.mt_smarthost.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_smarthost.UseStaticViewStyle = true;
- //
- // m_pDNS
- //
- this.m_pDNS.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.m_pDNS.Location = new System.Drawing.Point(32, 64);
- this.m_pDNS.Name = "m_pDNS";
- this.m_pDNS.Size = new System.Drawing.Size(176, 24);
- this.m_pDNS.TabIndex = 1;
- this.m_pDNS.Text = "Send mails directly using DNS";
- this.m_pDNS.CheckedChanged += new System.EventHandler(this.m_pDNS_CheckedChanged);
- //
- // m_pUseSmartHost
- //
- this.m_pUseSmartHost.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.m_pUseSmartHost.Location = new System.Drawing.Point(32, 40);
- this.m_pUseSmartHost.Name = "m_pUseSmartHost";
- this.m_pUseSmartHost.Size = new System.Drawing.Size(176, 24);
- this.m_pUseSmartHost.TabIndex = 0;
- this.m_pUseSmartHost.Text = "Send mails through SmartHost";
- this.m_pUseSmartHost.CheckedChanged += new System.EventHandler(this.m_pDNS_CheckedChanged);
- //
- // mt_maxthreads
- //
- this.mt_maxthreads.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_maxthreads.Location = new System.Drawing.Point(24, 120);
- this.mt_maxthreads.Name = "mt_maxthreads";
- this.mt_maxthreads.Size = new System.Drawing.Size(150, 24);
- this.mt_maxthreads.TabIndex = 12;
- this.mt_maxthreads.Text = "Max. Delivery Threads";
- this.mt_maxthreads.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_maxthreads.UseStaticViewStyle = true;
- //
- // m_pMaxThreads
- //
- this.m_pMaxThreads.BackColor = System.Drawing.Color.White;
- this.m_pMaxThreads.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
- this.m_pMaxThreads.DecimalPlaces = 0;
- this.m_pMaxThreads.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pMaxThreads.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pMaxThreads.DecValue = new System.Decimal(new int[] {
- 0,
- 0,
- 0,
- 0});
- this.m_pMaxThreads.Location = new System.Drawing.Point(176, 120);
- this.m_pMaxThreads.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
- this.m_pMaxThreads.MaxLength = 32767;
- this.m_pMaxThreads.Name = "m_pMaxThreads";
- this.m_pMaxThreads.ReadOnly = false;
- this.m_pMaxThreads.Size = new System.Drawing.Size(64, 20);
- this.m_pMaxThreads.TabIndex = 15;
- this.m_pMaxThreads.Text = "0";
- this.m_pMaxThreads.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pMaxThreads.UseStaticViewStyle = false;
- this.m_pMaxThreads.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
- //
- // m_pSave
- //
- this.m_pSave.Location = new System.Drawing.Point(536, 16);
- this.m_pSave.Name = "m_pSave";
- this.m_pSave.Size = new System.Drawing.Size(64, 24);
- this.m_pSave.TabIndex = 18;
- this.m_pSave.Text = "Save";
- this.m_pSave.UseStaticViewStyle = false;
- this.m_pSave.Click += new System.EventHandler(this.m_pSave_Load);
- //
- // m_pRelayInterval
- //
- this.m_pRelayInterval.BackColor = System.Drawing.Color.White;
- this.m_pRelayInterval.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
- this.m_pRelayInterval.DecimalPlaces = 0;
- this.m_pRelayInterval.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pRelayInterval.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pRelayInterval.DecValue = new System.Decimal(new int[] {
- 0,
- 0,
- 0,
- 0});
- this.m_pRelayInterval.Location = new System.Drawing.Point(176, 168);
- this.m_pRelayInterval.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
- this.m_pRelayInterval.MaxLength = 32767;
- this.m_pRelayInterval.Name = "m_pRelayInterval";
- this.m_pRelayInterval.ReadOnly = false;
- this.m_pRelayInterval.Size = new System.Drawing.Size(64, 20);
- this.m_pRelayInterval.TabIndex = 20;
- this.m_pRelayInterval.Text = "0";
- this.m_pRelayInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pRelayInterval.UseStaticViewStyle = false;
- this.m_pRelayInterval.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
- //
- // mt_RelayInterval
- //
- this.mt_RelayInterval.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_RelayInterval.Location = new System.Drawing.Point(24, 168);
- this.mt_RelayInterval.Name = "mt_RelayInterval";
- this.mt_RelayInterval.Size = new System.Drawing.Size(150, 24);
- this.mt_RelayInterval.TabIndex = 19;
- this.mt_RelayInterval.Text = "Relay interval";
- this.mt_RelayInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_RelayInterval.UseStaticViewStyle = true;
- //
- // m_pRelayRetryInterval
- //
- this.m_pRelayRetryInterval.BackColor = System.Drawing.Color.White;
- this.m_pRelayRetryInterval.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
- this.m_pRelayRetryInterval.DecimalPlaces = 0;
- this.m_pRelayRetryInterval.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pRelayRetryInterval.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pRelayRetryInterval.DecValue = new System.Decimal(new int[] {
- 0,
- 0,
- 0,
- 0});
- this.m_pRelayRetryInterval.Location = new System.Drawing.Point(176, 192);
- this.m_pRelayRetryInterval.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
- this.m_pRelayRetryInterval.MaxLength = 32767;
- this.m_pRelayRetryInterval.Name = "m_pRelayRetryInterval";
- this.m_pRelayRetryInterval.ReadOnly = false;
- this.m_pRelayRetryInterval.Size = new System.Drawing.Size(64, 20);
- this.m_pRelayRetryInterval.TabIndex = 22;
- this.m_pRelayRetryInterval.Text = "0";
- this.m_pRelayRetryInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pRelayRetryInterval.UseStaticViewStyle = false;
- this.m_pRelayRetryInterval.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
- //
- // mt_RelayRetryInterval
- //
- this.mt_RelayRetryInterval.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.mt_RelayRetryInterval.Location = new System.Drawing.Point(24, 192);
- this.mt_RelayRetryInterval.Name = "mt_RelayRetryInterval";
- this.mt_RelayRetryInterval.Size = new System.Drawing.Size(150, 24);
- this.mt_RelayRetryInterval.TabIndex = 21;
- this.mt_RelayRetryInterval.Text = "Relay retry interval";
- this.mt_RelayRetryInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.mt_RelayRetryInterval.UseStaticViewStyle = true;
- //
- // m_pUndeliveredWarning
- //
- this.m_pUndeliveredWarning.BackColor = System.Drawing.Color.White;
- this.m_pUndeliveredWarning.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
- this.m_pUndeliveredWarning.DecimalPlaces = 0;
- this.m_pUndeliveredWarning.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pUndeliveredWarning.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pUndeliveredWarning.DecValue = new System.Decimal(new int[] {
- 0,
- 0,
- 0,
- 0});
- this.m_pUndeliveredWarning.Location = new System.Drawing.Point(176, 248);
- this.m_pUndeliveredWarning.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
- this.m_pUndeliveredWarning.MaxLength = 32767;
- this.m_pUndeliveredWarning.Name = "m_pUndeliveredWarning";
- this.m_pUndeliveredWarning.ReadOnly = false;
- this.m_pUndeliveredWarning.Size = new System.Drawing.Size(64, 20);
- this.m_pUndeliveredWarning.TabIndex = 26;
- this.m_pUndeliveredWarning.Text = "0";
- this.m_pUndeliveredWarning.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pUndeliveredWarning.UseStaticViewStyle = false;
- this.m_pUndeliveredWarning.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
- //
- // wLabel1
- //
- this.wLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel1.Location = new System.Drawing.Point(16, 272);
- this.wLabel1.Name = "wLabel1";
- this.wLabel1.Size = new System.Drawing.Size(160, 24);
- this.wLabel1.TabIndex = 25;
- this.wLabel1.Text = "Send undelivered after";
- this.wLabel1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.wLabel1.UseStaticViewStyle = true;
- //
- // m_pUndelivered
- //
- this.m_pUndelivered.BackColor = System.Drawing.Color.White;
- this.m_pUndelivered.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
- this.m_pUndelivered.DecimalPlaces = 0;
- this.m_pUndelivered.DecMaxValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- 0});
- this.m_pUndelivered.DecMinValue = new System.Decimal(new int[] {
- 999999999,
- 0,
- 0,
- -2147483648});
- this.m_pUndelivered.DecValue = new System.Decimal(new int[] {
- 0,
- 0,
- 0,
- 0});
- this.m_pUndelivered.Location = new System.Drawing.Point(176, 272);
- this.m_pUndelivered.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
- this.m_pUndelivered.MaxLength = 32767;
- this.m_pUndelivered.Name = "m_pUndelivered";
- this.m_pUndelivered.ReadOnly = false;
- this.m_pUndelivered.Size = new System.Drawing.Size(64, 20);
- this.m_pUndelivered.TabIndex = 24;
- this.m_pUndelivered.Text = "0";
- this.m_pUndelivered.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.m_pUndelivered.UseStaticViewStyle = false;
- this.m_pUndelivered.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
- //
- // wLabel2
- //
- this.wLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel2.Location = new System.Drawing.Point(16, 248);
- this.wLabel2.Name = "wLabel2";
- this.wLabel2.Size = new System.Drawing.Size(160, 24);
- this.wLabel2.TabIndex = 23;
- this.wLabel2.Text = "Send undelivered warning after";
- this.wLabel2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.wLabel2.UseStaticViewStyle = true;
- //
- // wLabel3
- //
- this.wLabel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel3.Location = new System.Drawing.Point(240, 248);
- this.wLabel3.Name = "wLabel3";
- this.wLabel3.Size = new System.Drawing.Size(48, 24);
- this.wLabel3.TabIndex = 27;
- this.wLabel3.Text = "minutes";
- this.wLabel3.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.wLabel3.UseStaticViewStyle = true;
- //
- // wLabel4
- //
- this.wLabel4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel4.Location = new System.Drawing.Point(240, 272);
- this.wLabel4.Name = "wLabel4";
- this.wLabel4.Size = new System.Drawing.Size(48, 24);
- this.wLabel4.TabIndex = 28;
- this.wLabel4.Text = "hours";
- this.wLabel4.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.wLabel4.UseStaticViewStyle = true;
- //
- // wLabel5
- //
- this.wLabel5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel5.Location = new System.Drawing.Point(240, 168);
- this.wLabel5.Name = "wLabel5";
- this.wLabel5.Size = new System.Drawing.Size(48, 24);
- this.wLabel5.TabIndex = 29;
- this.wLabel5.Text = "seconds";
- this.wLabel5.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.wLabel5.UseStaticViewStyle = true;
- //
- // wLabel6
- //
- this.wLabel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.wLabel6.Location = new System.Drawing.Point(240, 192);
- this.wLabel6.Name = "wLabel6";
- this.wLabel6.Size = new System.Drawing.Size(48, 24);
- this.wLabel6.TabIndex = 30;
- this.wLabel6.Text = "seconds";
- this.wLabel6.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.wLabel6.UseStaticViewStyle = true;
- //
- // m_UndelWarningText
- //
- this.m_UndelWarningText.Location = new System.Drawing.Point(312, 243);
- this.m_UndelWarningText.Name = "m_UndelWarningText";
- this.m_UndelWarningText.Size = new System.Drawing.Size(288, 24);
- this.m_UndelWarningText.TabIndex = 31;
- this.m_UndelWarningText.Text = "Edit undelivered warning text";
- this.m_UndelWarningText.UseStaticViewStyle = false;
- this.m_UndelWarningText.ButtonPressed += new LumiSoft.UI.Controls.ButtonPressedEventHandler(this.m_UndelWarningText_ButtonPressed);
- //
- // m_pUndeliveredText
- //
- this.m_pUndeliveredText.Location = new System.Drawing.Point(312, 272);
- this.m_pUndeliveredText.Name = "m_pUndeliveredText";
- this.m_pUndeliveredText.Size = new System.Drawing.Size(288, 24);
- this.m_pUndeliveredText.TabIndex = 32;
- this.m_pUndeliveredText.Text = "Edit undelivered text";
- this.m_pUndeliveredText.UseStaticViewStyle = false;
- this.m_pUndeliveredText.ButtonPressed += new LumiSoft.UI.Controls.ButtonPressedEventHandler(this.m_pUndeliveredText_ButtonPressed);
- //
- // wfrm_Delivery
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(628, 373);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.m_pUndeliveredText,
- this.m_UndelWarningText,
- this.wLabel6,
- this.wLabel5,
- this.wLabel4,
- this.wLabel3,
- this.m_pUndeliveredWarning,
- this.wLabel1,
- this.m_pUndelivered,
- this.wLabel2,
- this.m_pRelayRetryInterval,
- this.mt_RelayRetryInterval,
- this.m_pRelayInterval,
- this.mt_RelayInterval,
- this.m_pSave,
- this.m_pMaxThreads,
- this.mt_maxthreads,
- this.m_pUseSmartHost,
- this.m_pDNS,
- this.mt_smarthost,
- this.mt_pridns,
- this.m_pSmartHost,
- this.m_pSecDNS,
- this.mt_secdns,
- this.m_pPriDNS});
- this.Name = "wfrm_Delivery";
- this.Text = "Delivery";
- ((System.ComponentModel.ISupportInitialize)(this.m_pSecDNS)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pPriDNS)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pSmartHost)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pMaxThreads)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pSave)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pRelayInterval)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pRelayRetryInterval)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndeliveredWarning)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndelivered)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_UndelWarningText)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.m_pUndeliveredText)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- #region Events handling
- #region function m_pSave_Load
- private void m_pSave_Load(object sender, System.EventArgs e)
- {
- try
- {
- if(!IsIpValid(m_pPriDNS.Text)){
- MessageBox.Show("Primary Dns IP address isn't valid !");
- m_pPriDNS.FlashControl();
- return;
- }
- if(!IsIpValid(m_pSecDNS.Text)){
- MessageBox.Show("Secondary Dns IP address isn't valid !");
- m_pSecDNS.FlashControl();
- return;
- }
- DataRow dr = dsSettings.Tables["Settings"].Rows[0];
- dr["SmartHost"] = m_pSmartHost.Text;
- dr["Dns1"] = m_pPriDNS.Text;
- dr["Dns2"] = m_pSecDNS.Text;
- dr["UseSmartHost"] = m_pUseSmartHost.Checked;
- dr["MaxRelayThreads"] = m_pMaxThreads.Text;
- dr["RelayInterval"] = m_pRelayInterval.Text;
- dr["RelayRetryInterval"] = m_pRelayRetryInterval.Text;
- dr["RelayUndelivered"] = m_pUndelivered.Text;
- dr["RelayUndeliveredWarning"] = m_pUndeliveredWarning.Text;
- dsSettings.WriteXml(Application.StartupPath + "\Settings\Settings.xml",XmlWriteMode.IgnoreSchema);
- }
- catch(Exception x)
- {
- wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
- frm.ShowDialog(this);
- }
- }
- #endregion
- #region function m_pDNS_CheckedChanged
- private void m_pDNS_CheckedChanged(object sender, System.EventArgs e)
- {
- RefreshRadioBtns();
- }
- #endregion
- #region function m_UndelWarningText_ButtonPressed
- private void m_UndelWarningText_ButtonPressed(object sender, System.EventArgs e)
- {
- DataRow dr = dsSettings.Tables["Settings"].Rows[0];
- wfrm_EditUndeliveredText frm = new wfrm_EditUndeliveredText(dr["UndeliveredWarningTemplate"].ToString());
- if(frm.ShowDialog(this) == DialogResult.OK){
- dr["UndeliveredWarningTemplate"] = frm.wp_Template;
- dsSettings.WriteXml(Application.StartupPath + "\Settings\Settings.xml",XmlWriteMode.IgnoreSchema);
- }
- }
- #endregion
- #region function m_pUndeliveredText_ButtonPressed
- private void m_pUndeliveredText_ButtonPressed(object sender, System.EventArgs e)
- {
- DataRow dr = dsSettings.Tables["Settings"].Rows[0];
- wfrm_EditUndeliveredText frm = new wfrm_EditUndeliveredText(dr["UndeliveredTemplate"].ToString());
- if(frm.ShowDialog(this) == DialogResult.OK){
- dr["UndeliveredTemplate"] = frm.wp_Template;
- dsSettings.WriteXml(Application.StartupPath + "\Settings\Settings.xml",XmlWriteMode.IgnoreSchema);
- }
- }
- #endregion
- #endregion
- #region function RefreshRadioBtns
- private void RefreshRadioBtns()
- {
- if(m_pDNS.Checked){
- m_pPriDNS.Enabled = true;
- m_pSecDNS.Enabled = true;
- m_pSmartHost.Enabled = false;
- }
- else{
- m_pPriDNS.Enabled = false;
- m_pSecDNS.Enabled = false;
- m_pSmartHost.Enabled = true;
- }
- }
- #endregion
- #region function RefreshForm()
- public void RefreshForm()
- {
- try
- {
- DataRow dr = dsSettings.Tables["Settings"].Rows[0];
- m_pSmartHost.Text = dr["SmartHost"].ToString();
- m_pPriDNS.Text = dr["Dns1"].ToString();
- m_pSecDNS.Text = dr["Dns2"].ToString();
- m_pMaxThreads.Text = dr["MaxRelayThreads"].ToString();
- m_pRelayInterval.Text = dr["RelayInterval"].ToString();
- m_pRelayRetryInterval.Text = dr["RelayRetryInterval"].ToString();
- m_pUndelivered.Text = dr["RelayUndelivered"].ToString();
- m_pUndeliveredWarning.Text = dr["RelayUndeliveredWarning"].ToString();
- bool UseSmartHost = Convert.ToBoolean(dr["UseSmartHost"]);
- if(UseSmartHost){
- m_pUseSmartHost.Checked = true;
- }
- else{
- m_pDNS.Checked = true;
- }
- }
- catch(Exception x)
- {
- wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
- frm.ShowDialog(this);
- }
- }
- #endregion
- #region function IsIpValid
- private bool IsIpValid(string IP)
- {
- try
- {
- string[] ipBlocks = IP.Split(new char[]{'.'});
- if(ipBlocks.Length != 4){
- return false;
- }
- System.Net.IPAddress ip = System.Net.IPAddress.Parse(IP);
- return true;
- }
- catch(Exception x)
- {
- return false;
- }
- }
- #endregion
-
- }
- }