namespace AsiaINFO.SMS.APPCMPP2 { using AsiaINFO.SMS.APPCMPP2.MyThread; using AsiaINFO.SMS.APPCMPP2.MyThread.CMPPThread; using AsiaINFO.SMS.APPCMPP2.MyThread.DataThread; using AsiaINFO.SMS.CMPP2; using AsiaINFO.SMS.Entity; using Common; using MyControls; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.IO; using System.Runtime.CompilerServices; using System.Threading; using System.Windows.Forms; public class MainForm : Form { private bool _allowExit; private CMPPClient _cmppClient; private Queue _cmppReceiveQueue = new Queue(0x3e8); private SyncEvents _cmppSyncEvents = new SyncEvents(); private SyncEvents _connectEvents = new SyncEvents(); private ConnectThread _connectThread; private bool _dbTestLastResult = true; private DBTestThread _dbTestThread; private SyncEvents _exitEvents = new SyncEvents(); private int _exitWait; private GetMTWaitThread _getMTWaitThread; private bool _isMTWaitDataReset; private bool _isShow = true; private bool _isStart; private SyncEvents _moinfoEvents = new SyncEvents(); private Queue _moinfoQueue = new Queue(0x3e8); private MOInfoThread _moinfoThread; private MTWaitResetThread _mtWaitResetThread; private ReceiveThread _receiveThread; private SyncEvents _reportEvents = new SyncEvents(); private Queue _reportQueue = new Queue(0x3e8); private ReportThread _reportThread; private Dictionary _slidingWindowDic = new Dictionary(0x10); private SyncEvents _slidingWindowEvents = new SyncEvents(); private SyncEvents _submitEvents = new SyncEvents(); private SyncEvents _submitOKEvents = new SyncEvents(); private Queue _submitOKQueue = new Queue(0x3e8); private SubmitOKThread _submitOKThread; private Queue _submitQueue = new Queue(0x3e8); private SyncEvents _submitRespEvents = new SyncEvents(); private Queue _submitRespQueue = new Queue(0x3e8); private SubmitRespThread _submitRespThread; private SubmitThread _submitThread; private object _SyncErrLogLockObject = new object(); private object _SyncMsgLogLockObject = new object(); private object _syncSlidingWindowDicObject = new object(); private BindingNavigator bindingNavigator; private IContainer components; private ToolStripStatusLabel copyright; internal static MsgLevel CurrentMsgLevel = ((MsgLevel) SysConf.Instance.CurrentMsgLevel); private ToolStripStatusLabel empty; private string errfilename = Utils.GetDate(); private FileStream errlogfile; private StreamWriter errwrite; private ToolStripButton ExitButton; private System.Windows.Forms.Timer exitTimer = new System.Windows.Forms.Timer(); private ToolStripButton HideMsgButton; private ToolStripButton HideSystem; private Label label2; private Label label3; private Label label7; private int lastLogDate = DateTime.Now.Day; private string logfilename = Utils.GetDate(); private System.Windows.Forms.Timer logTimer = new System.Windows.Forms.Timer(); private ToolStripStatusLabel mail; private ListBox MsgListBox; internal static int MsgListBoxMaxRow = SysConf.Instance.MsgListBoxMaxRow; private FileStream msglogfile; private StreamWriter msgwrite; private NotifyIcon notifyIcon; private Panel panel_stat1; private Panel panel1; private Panel panel10; private Panel panel11; private Panel panel2; private Panel panel3; private Panel panel4; private Panel panel5; private Panel panel6; private Panel panel7; private Panel panel8; private Panel panel9; private ToolStripButton SetSysButton; private ToolStripButton ShowMsgButton; private ToolStripButton SmsButton; private Splitter splitter1; private Splitter splitter2; private ToolStripButton StartButton; private Label STATE_CMPP; private Label STATE_CONNECT; private Label STATE_DBTEST; private Label STATE_GET; private Label STATE_MOINFO; private Label STATE_RECEIVE; private Label STATE_REPORT; private Label STATE_SUBMIT; private Label STATE_SUBMITOK; private Label STATE_SUBMITRESP; private StatusStrip statusStrip; private Label ThreadClearLable; private Label ThreadDealLable; private Label ThreadGetLable; private Label ThreadOnTimeLable; private Label ThreadScanLable; private Label ThreadSendLable; private Label ThreadServiceLable; private Label ThreadSynchLable; private ToolStripButton toolStripButton_Explain; private ToolStripSeparator toolStripSeparator1; private ToolStripSeparator toolStripSeparator2; private ToolStripSeparator toolStripSeparator3; private ToolStripSeparator toolStripSeparator4; private VistaClock vistaClock1; public MainForm() { this.InitializeComponent(); this.InitDate(); } private void AddErrLog(string msg) { try { lock (this._SyncErrLogLockObject) { this.errwrite.WriteLine(msg); } } catch (Exception) { } } private void AddMsgLog(string msg) { try { lock (this._SyncMsgLogLockObject) { this.msgwrite.WriteLine(msg); } } catch (Exception) { } } protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } private void ExitButton_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "您确定要退出吗?", "提示", MessageBoxButtons.YesNo) != DialogResult.No) { this.Stop(); this.exitTimer.Start(); } } private void HideMsgButton_Click(object sender, EventArgs e) { if (this._isShow) { this._isShow = false; string msg = string.Format("{0} :停止监视", Utils.GetDateTime()); this.ShowMsg(msg); } } private void HideSystem_Click(object sender, EventArgs e) { base.Hide(); this.notifyIcon.Visible = true; this.HideMsgButton_Click(sender, e); } private void InitDate() { this.OpenLogFile(); this.exitTimer.Interval = 0x3e8; this.exitTimer.Tick += new EventHandler(this.OnExitTime); this.logTimer.Interval = 0x2710; this.logTimer.Tick += new EventHandler(this.OnLogTimer); this.logTimer.Start(); this._dbTestThread = new DBTestThread(this._exitEvents); this._dbTestThread.DBTestEvent += delegate (bool result) { this.ThreadAllStart(result); }; this._cmppClient = new CMPPClient(this._cmppReceiveQueue, this._cmppSyncEvents); this._cmppClient.ErrorEvent += delegate (string err) { this.OnMsg("接口错误:" + err, MsgLevel.Err); this._connectEvents.NewItemEvent.Set(); }; this._cmppClient.MsgEvent += delegate (string msg) { this.OnMsg(msg, MsgLevel.Msg); }; this._mtWaitResetThread = new MTWaitResetThread(this._exitEvents, SysConf.Instance.ProgramID); this._connectThread = new ConnectThread(this._cmppClient, this._connectEvents); this._receiveThread = new ReceiveThread(this._cmppClient, this._cmppSyncEvents, this._cmppReceiveQueue, this._moinfoQueue, this._moinfoEvents, this._reportQueue, this._reportEvents, this._submitRespQueue, this._submitRespEvents); this._submitRespThread = new SubmitRespThread(this._cmppClient, this._submitRespEvents, this._syncSlidingWindowDicObject, this._slidingWindowDic, this._slidingWindowEvents, this._submitOKQueue, this._submitOKEvents, this._submitRespQueue); this._submitThread = new SubmitThread(this._cmppClient, this._submitEvents, this._submitQueue, this._syncSlidingWindowDicObject, this._slidingWindowDic, this._slidingWindowEvents, this._connectEvents, 1, SysConf.Instance.SlidingWindowSize, SysConf.Instance.ReSubmitInterval, SysConf.Instance.ActiveTestInterval); this._getMTWaitThread = new GetMTWaitThread(this._exitEvents, this._submitQueue, this._submitEvents, SysConf.Instance.ProgramID); this._moinfoThread = new MOInfoThread(this._moinfoEvents, this._moinfoQueue); this._reportThread = new ReportThread(this._reportEvents, this._reportQueue); this._submitOKThread = new SubmitOKThread(this._submitOKEvents, this._submitQueue, this._submitOKQueue); this._mtWaitResetThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._connectThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._receiveThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._moinfoThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._reportThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._submitRespThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._submitThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._getMTWaitThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._submitOKThread.MsgEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.MsgEventDelegate(this.OnMsg); this._connectThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._receiveThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._moinfoThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._reportThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._submitRespThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._submitThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._getMTWaitThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._submitOKThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); this._cmppClient.ThreadStateEvent += new CMPPClient.ThreadStateDelegate(this.OnThreadState); this._dbTestThread.ThreadStateEvent += new AsiaINFO.SMS.APPCMPP2.MyThread.ThreadStateDelegate(this.OnThreadState); } private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.splitter2 = new System.Windows.Forms.Splitter(); this.splitter1 = new System.Windows.Forms.Splitter(); this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.ShowMsgButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.HideMsgButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.bindingNavigator = new System.Windows.Forms.BindingNavigator(this.components); this.SetSysButton = new System.Windows.Forms.ToolStripButton(); this.SmsButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.HideSystem = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripButton_Explain = new System.Windows.Forms.ToolStripButton(); this.StartButton = new System.Windows.Forms.ToolStripButton(); this.ExitButton = new System.Windows.Forms.ToolStripButton(); this.copyright = new System.Windows.Forms.ToolStripStatusLabel(); this.empty = new System.Windows.Forms.ToolStripStatusLabel(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.mail = new System.Windows.Forms.ToolStripStatusLabel(); this.panel1 = new System.Windows.Forms.Panel(); this.panel11 = new System.Windows.Forms.Panel(); this.STATE_REPORT = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.panel10 = new System.Windows.Forms.Panel(); this.STATE_DBTEST = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.panel9 = new System.Windows.Forms.Panel(); this.STATE_SUBMITOK = new System.Windows.Forms.Label(); this.ThreadSynchLable = new System.Windows.Forms.Label(); this.panel8 = new System.Windows.Forms.Panel(); this.STATE_MOINFO = new System.Windows.Forms.Label(); this.ThreadOnTimeLable = new System.Windows.Forms.Label(); this.panel6 = new System.Windows.Forms.Panel(); this.STATE_GET = new System.Windows.Forms.Label(); this.ThreadScanLable = new System.Windows.Forms.Label(); this.vistaClock1 = new MyControls.VistaClock(); this.panel5 = new System.Windows.Forms.Panel(); this.STATE_SUBMITRESP = new System.Windows.Forms.Label(); this.ThreadServiceLable = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.STATE_SUBMIT = new System.Windows.Forms.Label(); this.ThreadSendLable = new System.Windows.Forms.Label(); this.panel7 = new System.Windows.Forms.Panel(); this.STATE_RECEIVE = new System.Windows.Forms.Label(); this.ThreadClearLable = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); this.STATE_CONNECT = new System.Windows.Forms.Label(); this.ThreadDealLable = new System.Windows.Forms.Label(); this.panel4 = new System.Windows.Forms.Panel(); this.STATE_CMPP = new System.Windows.Forms.Label(); this.ThreadGetLable = new System.Windows.Forms.Label(); this.panel_stat1 = new System.Windows.Forms.Panel(); this.label7 = new System.Windows.Forms.Label(); this.MsgListBox = new System.Windows.Forms.ListBox(); ((System.ComponentModel.ISupportInitialize)(this.bindingNavigator)).BeginInit(); this.bindingNavigator.SuspendLayout(); this.statusStrip.SuspendLayout(); this.panel1.SuspendLayout(); this.panel11.SuspendLayout(); this.panel10.SuspendLayout(); this.panel9.SuspendLayout(); this.panel8.SuspendLayout(); this.panel6.SuspendLayout(); this.panel5.SuspendLayout(); this.panel2.SuspendLayout(); this.panel7.SuspendLayout(); this.panel3.SuspendLayout(); this.panel4.SuspendLayout(); this.panel_stat1.SuspendLayout(); this.SuspendLayout(); // // splitter2 // this.splitter2.BackColor = System.Drawing.SystemColors.Control; this.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom; this.splitter2.Location = new System.Drawing.Point(0, 594); this.splitter2.Name = "splitter2"; this.splitter2.Size = new System.Drawing.Size(967, 3); this.splitter2.TabIndex = 38; this.splitter2.TabStop = false; // // splitter1 // this.splitter1.BackColor = System.Drawing.Color.Lavender; this.splitter1.Dock = System.Windows.Forms.DockStyle.Right; this.splitter1.Location = new System.Drawing.Point(967, 38); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 559); this.splitter1.TabIndex = 36; this.splitter1.TabStop = false; // // notifyIcon // this.notifyIcon.Text = "移动网关客户端"; this.notifyIcon.Click += new System.EventHandler(this.notifyIcon_Click); // // ShowMsgButton // this.ShowMsgButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.ShowMsgButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.ShowMsgButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.ShowMsgButton.Name = "ShowMsgButton"; this.ShowMsgButton.Size = new System.Drawing.Size(135, 35); this.ShowMsgButton.Text = "开始监视"; this.ShowMsgButton.Click += new System.EventHandler(this.ShowMsgButton_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 38); // // HideMsgButton // this.HideMsgButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.HideMsgButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.HideMsgButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.HideMsgButton.Name = "HideMsgButton"; this.HideMsgButton.Size = new System.Drawing.Size(135, 35); this.HideMsgButton.Text = "停止监视"; this.HideMsgButton.Click += new System.EventHandler(this.HideMsgButton_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38); // // bindingNavigator // this.bindingNavigator.AddNewItem = null; this.bindingNavigator.AutoSize = false; this.bindingNavigator.BackColor = System.Drawing.SystemColors.Control; this.bindingNavigator.CountItem = null; this.bindingNavigator.DeleteItem = null; this.bindingNavigator.ImageScalingSize = new System.Drawing.Size(24, 24); this.bindingNavigator.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SetSysButton, this.SmsButton, this.toolStripSeparator1, this.ShowMsgButton, this.toolStripSeparator2, this.HideMsgButton, this.toolStripSeparator3, this.HideSystem, this.toolStripSeparator4, this.toolStripButton_Explain, this.StartButton, this.ExitButton}); this.bindingNavigator.Location = new System.Drawing.Point(0, 0); this.bindingNavigator.MoveFirstItem = null; this.bindingNavigator.MoveLastItem = null; this.bindingNavigator.MoveNextItem = null; this.bindingNavigator.MovePreviousItem = null; this.bindingNavigator.Name = "bindingNavigator"; this.bindingNavigator.PositionItem = null; this.bindingNavigator.Size = new System.Drawing.Size(970, 38); this.bindingNavigator.Stretch = true; this.bindingNavigator.TabIndex = 33; this.bindingNavigator.Text = "bindingNavigator1"; // // SetSysButton // this.SetSysButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.SetSysButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.SetSysButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.SetSysButton.Name = "SetSysButton"; this.SetSysButton.Size = new System.Drawing.Size(135, 35); this.SetSysButton.Text = "参数设置"; this.SetSysButton.Click += new System.EventHandler(this.SetSysButton_Click); // // SmsButton // this.SmsButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.SmsButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.SmsButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.SmsButton.Name = "SmsButton"; this.SmsButton.Size = new System.Drawing.Size(135, 35); this.SmsButton.Text = "测试短信"; this.SmsButton.Click += new System.EventHandler(this.SmsButton_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(6, 38); // // HideSystem // this.HideSystem.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.HideSystem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.HideSystem.ImageTransparentColor = System.Drawing.Color.Magenta; this.HideSystem.Name = "HideSystem"; this.HideSystem.Size = new System.Drawing.Size(135, 35); this.HideSystem.Text = "隐藏窗口"; this.HideSystem.Click += new System.EventHandler(this.HideSystem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(6, 38); // // toolStripButton_Explain // this.toolStripButton_Explain.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.toolStripButton_Explain.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.toolStripButton_Explain.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton_Explain.Name = "toolStripButton_Explain"; this.toolStripButton_Explain.Size = new System.Drawing.Size(135, 35); this.toolStripButton_Explain.Text = "帮助信息"; this.toolStripButton_Explain.Click += new System.EventHandler(this.toolStripButton_Explain_Click); // // StartButton // this.StartButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.StartButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.StartButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.StartButton.Name = "StartButton"; this.StartButton.Size = new System.Drawing.Size(77, 35); this.StartButton.Text = "启动"; this.StartButton.Click += new System.EventHandler(this.StartButton_Click); // // ExitButton // this.ExitButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); this.ExitButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.ExitButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.ExitButton.Name = "ExitButton"; this.ExitButton.Size = new System.Drawing.Size(77, 37); this.ExitButton.Text = "退出"; this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click); // // copyright // this.copyright.AutoToolTip = true; this.copyright.LinkColor = System.Drawing.Color.Black; this.copyright.Name = "copyright"; this.copyright.Size = new System.Drawing.Size(213, 24); this.copyright.Text = "版权所有:广州骏媒科技 "; this.copyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // empty // this.empty.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right))); this.empty.Name = "empty"; this.empty.Size = new System.Drawing.Size(621, 24); this.empty.Spring = true; // // statusStrip // this.statusStrip.ImageScalingSize = new System.Drawing.Size(24, 24); this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.copyright, this.empty, this.mail}); this.statusStrip.Location = new System.Drawing.Point(0, 597); this.statusStrip.Name = "statusStrip"; this.statusStrip.Size = new System.Drawing.Size(970, 29); this.statusStrip.TabIndex = 34; this.statusStrip.Text = "statusStrip"; // // mail // this.mail.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); this.mail.Name = "mail"; this.mail.Size = new System.Drawing.Size(121, 24); this.mail.Text = "www.izjun.cn"; // // panel1 // this.panel1.BackColor = System.Drawing.SystemColors.Control; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panel1.Controls.Add(this.panel11); this.panel1.Controls.Add(this.panel10); this.panel1.Controls.Add(this.panel9); this.panel1.Controls.Add(this.panel8); this.panel1.Controls.Add(this.panel6); this.panel1.Controls.Add(this.vistaClock1); this.panel1.Controls.Add(this.panel5); this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.panel7); this.panel1.Controls.Add(this.panel3); this.panel1.Controls.Add(this.panel4); this.panel1.Controls.Add(this.panel_stat1); this.panel1.Dock = System.Windows.Forms.DockStyle.Right; this.panel1.Location = new System.Drawing.Point(777, 38); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(190, 556); this.panel1.TabIndex = 42; // // panel11 // this.panel11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel11.BackColor = System.Drawing.Color.White; this.panel11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel11.Controls.Add(this.STATE_REPORT); this.panel11.Controls.Add(this.label3); this.panel11.Location = new System.Drawing.Point(27, 518); this.panel11.Name = "panel11"; this.panel11.Size = new System.Drawing.Size(158, 25); this.panel11.TabIndex = 35; // // STATE_REPORT // this.STATE_REPORT.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_REPORT.AutoSize = true; this.STATE_REPORT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_REPORT.ForeColor = System.Drawing.Color.Red; this.STATE_REPORT.Location = new System.Drawing.Point(110, 3); this.STATE_REPORT.Name = "STATE_REPORT"; this.STATE_REPORT.Size = new System.Drawing.Size(64, 22); this.STATE_REPORT.TabIndex = 40; this.STATE_REPORT.Text = "未启动"; this.STATE_REPORT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label3 // this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.label3.ForeColor = System.Drawing.Color.Blue; this.label3.Location = new System.Drawing.Point(2, 3); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(154, 22); this.label3.TabIndex = 30; this.label3.Text = "数据库Report维护"; // // panel10 // this.panel10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel10.BackColor = System.Drawing.Color.White; this.panel10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel10.Controls.Add(this.STATE_DBTEST); this.panel10.Controls.Add(this.label2); this.panel10.Location = new System.Drawing.Point(27, 394); this.panel10.Name = "panel10"; this.panel10.Size = new System.Drawing.Size(158, 25); this.panel10.TabIndex = 34; // // STATE_DBTEST // this.STATE_DBTEST.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_DBTEST.AutoSize = true; this.STATE_DBTEST.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_DBTEST.ForeColor = System.Drawing.Color.Red; this.STATE_DBTEST.Location = new System.Drawing.Point(110, 3); this.STATE_DBTEST.Name = "STATE_DBTEST"; this.STATE_DBTEST.Size = new System.Drawing.Size(64, 22); this.STATE_DBTEST.TabIndex = 38; this.STATE_DBTEST.Text = "未启动"; this.STATE_DBTEST.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label2 // this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.label2.ForeColor = System.Drawing.Color.Blue; this.label2.Location = new System.Drawing.Point(2, 3); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(136, 22); this.label2.TabIndex = 30; this.label2.Text = "数据库监视线程"; // // panel9 // this.panel9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel9.BackColor = System.Drawing.Color.White; this.panel9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel9.Controls.Add(this.STATE_SUBMITOK); this.panel9.Controls.Add(this.ThreadSynchLable); this.panel9.Location = new System.Drawing.Point(27, 456); this.panel9.Name = "panel9"; this.panel9.Size = new System.Drawing.Size(158, 25); this.panel9.TabIndex = 33; // // STATE_SUBMITOK // this.STATE_SUBMITOK.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_SUBMITOK.AutoSize = true; this.STATE_SUBMITOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_SUBMITOK.ForeColor = System.Drawing.Color.Red; this.STATE_SUBMITOK.Location = new System.Drawing.Point(110, 3); this.STATE_SUBMITOK.Name = "STATE_SUBMITOK"; this.STATE_SUBMITOK.Size = new System.Drawing.Size(64, 22); this.STATE_SUBMITOK.TabIndex = 39; this.STATE_SUBMITOK.Text = "未启动"; this.STATE_SUBMITOK.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadSynchLable // this.ThreadSynchLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadSynchLable.AutoSize = true; this.ThreadSynchLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadSynchLable.ForeColor = System.Drawing.Color.Blue; this.ThreadSynchLable.Location = new System.Drawing.Point(2, 3); this.ThreadSynchLable.Name = "ThreadSynchLable"; this.ThreadSynchLable.Size = new System.Drawing.Size(126, 22); this.ThreadSynchLable.TabIndex = 30; this.ThreadSynchLable.Text = "数据库MT维护"; // // panel8 // this.panel8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel8.BackColor = System.Drawing.Color.White; this.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel8.Controls.Add(this.STATE_MOINFO); this.panel8.Controls.Add(this.ThreadOnTimeLable); this.panel8.Location = new System.Drawing.Point(27, 487); this.panel8.Name = "panel8"; this.panel8.Size = new System.Drawing.Size(158, 25); this.panel8.TabIndex = 32; // // STATE_MOINFO // this.STATE_MOINFO.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_MOINFO.AutoSize = true; this.STATE_MOINFO.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_MOINFO.ForeColor = System.Drawing.Color.Red; this.STATE_MOINFO.Location = new System.Drawing.Point(110, 3); this.STATE_MOINFO.Name = "STATE_MOINFO"; this.STATE_MOINFO.Size = new System.Drawing.Size(64, 22); this.STATE_MOINFO.TabIndex = 40; this.STATE_MOINFO.Text = "未启动"; this.STATE_MOINFO.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadOnTimeLable // this.ThreadOnTimeLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadOnTimeLable.AutoSize = true; this.ThreadOnTimeLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadOnTimeLable.ForeColor = System.Drawing.Color.Blue; this.ThreadOnTimeLable.Location = new System.Drawing.Point(2, 3); this.ThreadOnTimeLable.Name = "ThreadOnTimeLable"; this.ThreadOnTimeLable.Size = new System.Drawing.Size(128, 22); this.ThreadOnTimeLable.TabIndex = 30; this.ThreadOnTimeLable.Text = "数据库MO维护"; // // panel6 // this.panel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel6.BackColor = System.Drawing.Color.White; this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel6.Controls.Add(this.STATE_GET); this.panel6.Controls.Add(this.ThreadScanLable); this.panel6.Location = new System.Drawing.Point(27, 425); this.panel6.Name = "panel6"; this.panel6.Size = new System.Drawing.Size(158, 25); this.panel6.TabIndex = 31; // // STATE_GET // this.STATE_GET.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_GET.AutoSize = true; this.STATE_GET.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_GET.ForeColor = System.Drawing.Color.Red; this.STATE_GET.Location = new System.Drawing.Point(110, 3); this.STATE_GET.Name = "STATE_GET"; this.STATE_GET.Size = new System.Drawing.Size(64, 22); this.STATE_GET.TabIndex = 38; this.STATE_GET.Text = "未启动"; this.STATE_GET.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadScanLable // this.ThreadScanLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadScanLable.AutoSize = true; this.ThreadScanLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadScanLable.ForeColor = System.Drawing.Color.Blue; this.ThreadScanLable.Location = new System.Drawing.Point(2, 3); this.ThreadScanLable.Name = "ThreadScanLable"; this.ThreadScanLable.Size = new System.Drawing.Size(144, 22); this.ThreadScanLable.TabIndex = 30; this.ThreadScanLable.Text = "数据库MT数据源"; // // vistaClock1 // this.vistaClock1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.vistaClock1.BackColor = System.Drawing.Color.Transparent; this.vistaClock1.Location = new System.Drawing.Point(18, 4); this.vistaClock1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.vistaClock1.Name = "vistaClock1"; this.vistaClock1.PositionRect = ((MyControls.CustomRectangle)(resources.GetObject("vistaClock1.PositionRect"))); this.vistaClock1.SecondSpring = true; this.vistaClock1.ShowSecond = true; this.vistaClock1.Size = new System.Drawing.Size(150, 150); this.vistaClock1.Style = MyControls.VistaClock.VistaClockStyle.黑色; this.vistaClock1.TabIndex = 30; // // panel5 // this.panel5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel5.BackColor = System.Drawing.Color.White; this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel5.Controls.Add(this.STATE_SUBMITRESP); this.panel5.Controls.Add(this.ThreadServiceLable); this.panel5.Location = new System.Drawing.Point(27, 363); this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(158, 25); this.panel5.TabIndex = 29; // // STATE_SUBMITRESP // this.STATE_SUBMITRESP.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_SUBMITRESP.AutoSize = true; this.STATE_SUBMITRESP.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_SUBMITRESP.ForeColor = System.Drawing.Color.Red; this.STATE_SUBMITRESP.Location = new System.Drawing.Point(110, 3); this.STATE_SUBMITRESP.Name = "STATE_SUBMITRESP"; this.STATE_SUBMITRESP.Size = new System.Drawing.Size(64, 22); this.STATE_SUBMITRESP.TabIndex = 37; this.STATE_SUBMITRESP.Text = "未启动"; this.STATE_SUBMITRESP.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadServiceLable // this.ThreadServiceLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadServiceLable.AutoSize = true; this.ThreadServiceLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadServiceLable.ForeColor = System.Drawing.Color.Blue; this.ThreadServiceLable.Location = new System.Drawing.Point(2, 3); this.ThreadServiceLable.Name = "ThreadServiceLable"; this.ThreadServiceLable.Size = new System.Drawing.Size(149, 22); this.ThreadServiceLable.TabIndex = 30; this.ThreadServiceLable.Text = "SUBMIT确认线程"; // // panel2 // this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel2.BackColor = System.Drawing.Color.White; this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Controls.Add(this.STATE_SUBMIT); this.panel2.Controls.Add(this.ThreadSendLable); this.panel2.Location = new System.Drawing.Point(27, 332); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(158, 25); this.panel2.TabIndex = 28; // // STATE_SUBMIT // this.STATE_SUBMIT.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_SUBMIT.AutoSize = true; this.STATE_SUBMIT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_SUBMIT.ForeColor = System.Drawing.Color.Red; this.STATE_SUBMIT.Location = new System.Drawing.Point(110, 3); this.STATE_SUBMIT.Name = "STATE_SUBMIT"; this.STATE_SUBMIT.Size = new System.Drawing.Size(64, 22); this.STATE_SUBMIT.TabIndex = 36; this.STATE_SUBMIT.Text = "未启动"; this.STATE_SUBMIT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadSendLable // this.ThreadSendLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadSendLable.AutoSize = true; this.ThreadSendLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadSendLable.ForeColor = System.Drawing.Color.Blue; this.ThreadSendLable.Location = new System.Drawing.Point(2, 3); this.ThreadSendLable.Name = "ThreadSendLable"; this.ThreadSendLable.Size = new System.Drawing.Size(113, 22); this.ThreadSendLable.TabIndex = 30; this.ThreadSendLable.Text = "SUBMIT线程"; // // panel7 // this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel7.BackColor = System.Drawing.Color.White; this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel7.Controls.Add(this.STATE_RECEIVE); this.panel7.Controls.Add(this.ThreadClearLable); this.panel7.Location = new System.Drawing.Point(27, 301); this.panel7.Name = "panel7"; this.panel7.Size = new System.Drawing.Size(158, 25); this.panel7.TabIndex = 27; // // STATE_RECEIVE // this.STATE_RECEIVE.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_RECEIVE.AutoSize = true; this.STATE_RECEIVE.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_RECEIVE.ForeColor = System.Drawing.Color.Red; this.STATE_RECEIVE.Location = new System.Drawing.Point(110, 3); this.STATE_RECEIVE.Name = "STATE_RECEIVE"; this.STATE_RECEIVE.Size = new System.Drawing.Size(64, 22); this.STATE_RECEIVE.TabIndex = 36; this.STATE_RECEIVE.Text = "未启动"; this.STATE_RECEIVE.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadClearLable // this.ThreadClearLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadClearLable.AutoSize = true; this.ThreadClearLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadClearLable.ForeColor = System.Drawing.Color.Blue; this.ThreadClearLable.Location = new System.Drawing.Point(2, 3); this.ThreadClearLable.Name = "ThreadClearLable"; this.ThreadClearLable.Size = new System.Drawing.Size(118, 22); this.ThreadClearLable.TabIndex = 30; this.ThreadClearLable.Text = "数据分发线程"; // // panel3 // this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel3.BackColor = System.Drawing.Color.White; this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel3.Controls.Add(this.STATE_CONNECT); this.panel3.Controls.Add(this.ThreadDealLable); this.panel3.Location = new System.Drawing.Point(27, 270); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(158, 25); this.panel3.TabIndex = 24; // // STATE_CONNECT // this.STATE_CONNECT.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_CONNECT.AutoSize = true; this.STATE_CONNECT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_CONNECT.ForeColor = System.Drawing.Color.Red; this.STATE_CONNECT.Location = new System.Drawing.Point(110, 3); this.STATE_CONNECT.Name = "STATE_CONNECT"; this.STATE_CONNECT.Size = new System.Drawing.Size(64, 22); this.STATE_CONNECT.TabIndex = 35; this.STATE_CONNECT.Text = "未启动"; this.STATE_CONNECT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadDealLable // this.ThreadDealLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadDealLable.AutoSize = true; this.ThreadDealLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadDealLable.ForeColor = System.Drawing.Color.Blue; this.ThreadDealLable.Location = new System.Drawing.Point(2, 3); this.ThreadDealLable.Name = "ThreadDealLable"; this.ThreadDealLable.Size = new System.Drawing.Size(118, 22); this.ThreadDealLable.TabIndex = 30; this.ThreadDealLable.Text = "连接维护线程"; // // panel4 // this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel4.BackColor = System.Drawing.Color.White; this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel4.Controls.Add(this.STATE_CMPP); this.panel4.Controls.Add(this.ThreadGetLable); this.panel4.Location = new System.Drawing.Point(27, 239); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(158, 25); this.panel4.TabIndex = 21; // // STATE_CMPP // this.STATE_CMPP.Anchor = System.Windows.Forms.AnchorStyles.None; this.STATE_CMPP.AutoSize = true; this.STATE_CMPP.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.STATE_CMPP.ForeColor = System.Drawing.Color.Red; this.STATE_CMPP.Location = new System.Drawing.Point(110, 3); this.STATE_CMPP.Name = "STATE_CMPP"; this.STATE_CMPP.Size = new System.Drawing.Size(64, 22); this.STATE_CMPP.TabIndex = 34; this.STATE_CMPP.Text = "未启动"; this.STATE_CMPP.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ThreadGetLable // this.ThreadGetLable.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ThreadGetLable.AutoSize = true; this.ThreadGetLable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.ThreadGetLable.ForeColor = System.Drawing.Color.Blue; this.ThreadGetLable.Location = new System.Drawing.Point(2, 3); this.ThreadGetLable.Name = "ThreadGetLable"; this.ThreadGetLable.Size = new System.Drawing.Size(151, 22); this.ThreadGetLable.TabIndex = 0; this.ThreadGetLable.Text = "CMPP客户端线程"; // // panel_stat1 // this.panel_stat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panel_stat1.BackColor = System.Drawing.Color.White; this.panel_stat1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel_stat1.Controls.Add(this.label7); this.panel_stat1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel_stat1.Location = new System.Drawing.Point(1, 239); this.panel_stat1.Name = "panel_stat1"; this.panel_stat1.Size = new System.Drawing.Size(24, 305); this.panel_stat1.TabIndex = 0; // // label7 // this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.label7.BackColor = System.Drawing.Color.Transparent; this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.ForeColor = System.Drawing.Color.Blue; this.label7.Location = new System.Drawing.Point(1, 35); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(17, 239); this.label7.TabIndex = 0; this.label7.Text = "业 务 线 程 状 态"; // // MsgListBox // this.MsgListBox.Dock = System.Windows.Forms.DockStyle.Fill; this.MsgListBox.FormattingEnabled = true; this.MsgListBox.HorizontalExtent = 200; this.MsgListBox.ItemHeight = 18; this.MsgListBox.Location = new System.Drawing.Point(0, 38); this.MsgListBox.Name = "MsgListBox"; this.MsgListBox.ScrollAlwaysVisible = true; this.MsgListBox.Size = new System.Drawing.Size(777, 556); this.MsgListBox.TabIndex = 43; this.MsgListBox.DoubleClick += new System.EventHandler(this.MsgListBox_DoubleClick); // // MainForm // this.ClientSize = new System.Drawing.Size(970, 626); this.Controls.Add(this.MsgListBox); this.Controls.Add(this.panel1); this.Controls.Add(this.splitter2); this.Controls.Add(this.splitter1); this.Controls.Add(this.bindingNavigator); this.Controls.Add(this.statusStrip); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "短信平台"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.MainForm_Load); ((System.ComponentModel.ISupportInitialize)(this.bindingNavigator)).EndInit(); this.bindingNavigator.ResumeLayout(false); this.bindingNavigator.PerformLayout(); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); this.panel1.ResumeLayout(false); this.panel11.ResumeLayout(false); this.panel11.PerformLayout(); this.panel10.ResumeLayout(false); this.panel10.PerformLayout(); this.panel9.ResumeLayout(false); this.panel9.PerformLayout(); this.panel8.ResumeLayout(false); this.panel8.PerformLayout(); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); this.panel5.ResumeLayout(false); this.panel5.PerformLayout(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.panel7.ResumeLayout(false); this.panel7.PerformLayout(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.panel_stat1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } private bool IsAllThreadStop() { if ((this._cmppClient != null) && !this._cmppClient.IsStop()) { return false; } if ((this._connectThread != null) && !this._connectThread.IsStop()) { return false; } if ((this._receiveThread != null) && !this._receiveThread.IsStop()) { return false; } if ((this._moinfoThread != null) && !this._moinfoThread.IsStop()) { return false; } if ((this._reportThread != null) && !this._reportThread.IsStop()) { return false; } if ((this._submitThread != null) && !this._submitThread.IsStop()) { return false; } if ((this._submitRespThread != null) && !this._submitRespThread.IsStop()) { return false; } if ((this._getMTWaitThread != null) && !this._getMTWaitThread.IsStop()) { return false; } if ((this._submitOKThread != null) && !this._submitOKThread.IsStop()) { return false; } if ((this._dbTestThread != null) && !this._dbTestThread.IsStop()) { return false; } return true; } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (!this._allowExit) { e.Cancel = true; this.HideSystem_Click(sender, e); } try { this.msgwrite.Close(); this.msglogfile.Close(); this.errwrite.Close(); this.errlogfile.Close(); } catch (Exception) { } } private void MainForm_Load(object sender, EventArgs e) { this.Text = this.Text +"-"+ System.Configuration.ConfigurationSettings.AppSettings["LONGSERVNO"]; Application.DoEvents(); if (SysConf.Instance.AutoConnection) { this.Start(); this._isStart = true; } } private void MsgListBox_DoubleClick(object sender, EventArgs e) { if (this.MsgListBox.SelectedIndex > 0) { MessageBox.Show(this.MsgListBox.Items[this.MsgListBox.SelectedIndex].ToString(), "信息"); } } private void notifyIcon_Click(object sender, EventArgs e) { base.Visible = true; base.WindowState = FormWindowState.Normal; this.notifyIcon.Visible = false; } private void OnExitTime(object sender, EventArgs e) { this._exitWait++; if ((this._exitWait < 15) || ((this._exitWait > 15) && (this._exitWait < 30))) { if (this.IsAllThreadStop()) { this._allowExit = true; Application.Exit(); } } else if (this._exitWait == 15) { this.StopAllThreadImmediately(); } else if (((this._exitWait % 30) == 0) && (MessageBox.Show(this, "超时!是否强制退出软件?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)) { this._allowExit = true; Application.Exit(); } } private void OnLogTimer(object sender, EventArgs e) { if (this.lastLogDate != DateTime.Now.Day) { this.lastLogDate = DateTime.Now.Day; this.OpenLogFile(); this.Start(); } } private void OnMsg(string msg, MsgLevel level) { if (level <= CurrentMsgLevel) { switch (level) { case MsgLevel.Err: msg = string.Format("{0} !Error!:{1}", Utils.GetDateTime(), msg); this.AddErrLog(msg); break; case MsgLevel.Sys: msg = string.Format("{0} ~Sys~:{1}", Utils.GetDateTime(), msg); this.AddMsgLog(msg); break; case MsgLevel.Msg: msg = string.Format("{0} :{1}", Utils.GetDateTime(), msg); this.AddMsgLog(msg); break; case MsgLevel.Debug: msg = string.Format("{0} *Debug*:{1}", Utils.GetDateTime(), msg); this.AddMsgLog(msg); break; default: msg = string.Format("{0} ?Unknow?:{1}", Utils.GetDateTime(), msg); this.AddErrLog(msg); break; } if (this._isShow) { this.ShowMsg(msg); } } } private void OnSetState(Label labe, ThreadState state) { if (base.InvokeRequired) { base.Invoke(new SetStateDelegate(this.OnSetState), new object[] { labe, state }); } else { switch (state) { case ThreadState.Running: labe.Text = "运行中..."; labe.ForeColor = Color.Blue; break; case ThreadState.Stopped: labe.Text = "停止!"; labe.ForeColor = Color.Red; break; case ThreadState.Suspended: labe.Text = "挂起"; labe.ForeColor = Color.Yellow; break; } Application.DoEvents(); } } private void OnThreadState(object sender, ThreadState state) { switch (sender.GetType().Name) { case "ConnectThread": this.OnSetState(this.STATE_CONNECT, state); return; case "ReceiveThread": this.OnSetState(this.STATE_RECEIVE, state); return; case "SubmitRespThread": this.OnSetState(this.STATE_SUBMITRESP, state); return; case "SubmitThread": this.OnSetState(this.STATE_SUBMIT, state); return; case "GetMTWaitThread": this.OnSetState(this.STATE_GET, state); return; case "MOInfoThread": this.OnSetState(this.STATE_MOINFO, state); return; case "ReportThread": this.OnSetState(this.STATE_REPORT, state); return; case "SubmitOKThread": this.OnSetState(this.STATE_SUBMITOK, state); return; case "CMPPClient": this.OnSetState(this.STATE_CMPP, state); return; case "DBTestThread": this.OnSetState(this.STATE_DBTEST, state); return; } } private void OpenLogFile() { try { //while (!this.IsAllThreadStop()) //{ // this.StopAllThreadImmediately(); //} string path = @".\Syslog\"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } lock (this._SyncMsgLogLockObject) { try { this.msgwrite.Close(); this.msglogfile.Close(); this.msgwrite = null; this.msglogfile = null; } catch (Exception) { } this.logfilename = Utils.GetDate(); string str2 = string.Format("{0}Log_{1}.log", path, this.logfilename); this.msglogfile = File.Open(str2, FileMode.Append, FileAccess.Write); this.msgwrite = new StreamWriter(this.msglogfile); } lock (this._SyncErrLogLockObject) { try { this.errwrite.Close(); this.errlogfile.Close(); this.errwrite = null; this.errlogfile = null; } catch (Exception) { } this.errfilename = Utils.GetDate(); string str3 = string.Format("{0}Err_{1}.log", path, this.errfilename); this.errlogfile = File.Open(str3, FileMode.Append, FileAccess.Write); this.errwrite = new StreamWriter(this.errlogfile); } this.OnMsg("日志维护成功!", MsgLevel.Sys); } catch (Exception exception) { throw new Exception("打开日志文件错误!" + exception.Message); } } private void SetSysButton_Click(object sender, EventArgs e) { new SysForm().Show(); } private void ShowMsg(string msg) { if (base.InvokeRequired) { base.Invoke(new ShowMessageDelegate(this.ShowMsg), new object[] { msg }); } else { int count = this.MsgListBox.Items.Count; if (count > MsgListBoxMaxRow) { this.MsgListBox.Items.Clear(); } this.MsgListBox.Items.Add(msg); if (count > MsgListBoxMaxRow) { this.MsgListBox.SelectedIndex = 0; } else { this.MsgListBox.SelectedIndex = count; } Application.DoEvents(); } } private void ShowMsgButton_Click(object sender, EventArgs e) { if (!this._isShow) { string msg = string.Format("{0} :开始监视", Utils.GetDateTime()); this.ShowMsg(msg); this._isShow = true; } } private void SmsButton_Click(object sender, EventArgs e) { new SmsForm(this._submitQueue, this._submitEvents).Show(); } private void Start() { this._dbTestThread.StartRun(); this._dbTestThread.SetThreadPriority(ThreadPriority.Highest); this.OnMsg("启动....", MsgLevel.Sys); } //测试 private void StartButton_Click(object sender, EventArgs e) { if (this._isStart) { MessageBox.Show("连接已经启动!"); } else { this.Start(); this._isStart = true; } } private void Stop() { this.OnMsg("退出等待......", MsgLevel.Sys); if (this._cmppClient.IsConnected) { this._cmppClient.Terminate(1); } this._dbTestThread.Stop(); this._cmppClient.StopReceive(); this._connectThread.Stop(); this._getMTWaitThread.Stop(); this._submitThread.Stop(); this._receiveThread.Stop(); this._submitRespThread.Stop(); this._submitOKThread.Stop(); this._moinfoThread.Stop(); this._reportThread.Stop(); this._cmppClient.Exit(); this._mtWaitResetThread.Stop(); this._allowExit = true; } private void StopAllThreadImmediately() { if ((this._cmppClient != null) && !this._cmppClient.IsStop()) { this._cmppClient.StopImmediately(); } if ((this._connectThread != null) && !this._connectThread.IsStop()) { this._connectThread.StopImmediately(); } if ((this._receiveThread != null) && !this._receiveThread.IsStop()) { this._receiveThread.StopImmediately(); } if ((this._moinfoThread != null) && !this._moinfoThread.IsStop()) { this._moinfoThread.StopImmediately(); } if ((this._reportThread != null) && !this._reportThread.IsStop()) { this._reportThread.StopImmediately(); } if ((this._submitThread != null) && !this._submitThread.IsStop()) { this._submitThread.StopImmediately(); } if ((this._submitRespThread != null) && !this._submitRespThread.IsStop()) { this._submitRespThread.StopImmediately(); } if ((this._getMTWaitThread != null) && !this._getMTWaitThread.IsStop()) { this._getMTWaitThread.StopImmediately(); } if ((this._submitOKThread != null) && !this._submitOKThread.IsStop()) { this._submitOKThread.StopImmediately(); } if ((this._dbTestThread != null) && !this._dbTestThread.IsStop()) { this._dbTestThread.StopImmediately(); } } private void ThreadAllStart(bool flag) { if (flag) { if (!this._isMTWaitDataReset) { this._mtWaitResetThread.StartRun(); this._isMTWaitDataReset = true; } this._dbTestLastResult = true; this._connectThread.StartRun(); this._receiveThread.StartRun(); this._moinfoThread.StartRun(); this._reportThread.StartRun(); this._submitRespThread.StartRun(); this._submitThread.StartRun(); this._getMTWaitThread.StartRun(); this._submitOKThread.StartRun(); } else if (!flag && this._dbTestLastResult) { this._dbTestLastResult = false; this.OnMsg("数据库连接错误!请检查网络或数据库设置", MsgLevel.Err); this._cmppClient.Suspend(); this._receiveThread.Suspend(); this._submitRespThread.Suspend(); this._submitThread.Suspend(); this._getMTWaitThread.Suspend(); this._submitOKThread.Suspend(); this._moinfoThread.Suspend(); this._reportThread.Suspend(); this._connectThread.Suspend(); this._cmppClient.IsConnected = false; } } private void toolStripButton_Explain_Click(object sender, EventArgs e) { new AboutForm().Show(); } private delegate void SetStateDelegate(Label labe, ThreadState state); private delegate void ShowMessageDelegate(string msg); } }