From: <br...@us...> - 2008-06-18 13:22:23
|
Revision: 263 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=263&view=rev Author: brus07 Date: 2008-06-18 06:22:31 -0700 (Wed, 18 Jun 2008) Log Message: ----------- LoadingList of Dlls work in ThreadPool, because don't waint this in start program Modified Paths: -------------- ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-17 15:36:50 UTC (rev 262) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-18 13:22:31 UTC (rev 263) @@ -28,6 +28,12 @@ { kernel = new AcmContester.Mediator.Library.MediatorKernel(); kernel.onWorkingData += WorkingData; + System.Threading.ThreadPool.QueueUserWorkItem(RunLoadDll); + //kernel.LoadLists(); + } + + void RunLoadDll(Object ob) + { kernel.LoadLists(); } @@ -61,7 +67,8 @@ private void Disconnnect() { - kernel.SendToAll("stop"); + if (kernel != null) + kernel.SendToAll("stop"); } Modified: ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-17 15:36:50 UTC (rev 262) +++ ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-18 13:22:31 UTC (rev 263) @@ -18,7 +18,6 @@ plugin.onDataArrived += DataArrivedFromClientList; plugin.onWorkingData += WorkingData; } - testerSideList = PluginsLoader<BaseMediatorPlugin>.Load("Dll_Tester"); foreach (BaseMediatorPlugin plugin in testerSideList) { @@ -37,16 +36,22 @@ private void DataArrivedFromClientList(string message) { - for (int index = 0; index < testerSideList.Count; index++) + if (testerSideList != null) { - ((BaseMediatorPlugin)testerSideList[index]).Send(message); + for (int index = 0; index < testerSideList.Count; index++) + { + ((BaseMediatorPlugin)testerSideList[index]).Send(message); + } } } private void DataArrivedFromTesterList(string message) { - for (int index = 0; index < clientSideList.Count; index++) + if (clientSideList != null) { - ((BaseMediatorPlugin)clientSideList[index]).Send(message); + for (int index = 0; index < clientSideList.Count; index++) + { + ((BaseMediatorPlugin)clientSideList[index]).Send(message); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-26 18:22:45
|
Revision: 280 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=280&view=rev Author: brus07 Date: 2008-06-26 11:22:52 -0700 (Thu, 26 Jun 2008) Log Message: ----------- Deleted CountClientStatus string from statusbar. Modified Paths: -------------- ACMServer/trunk/ACMServer/Mediator/Form1.Designer.cs ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Mediator/Form1.resx Modified: ACMServer/trunk/ACMServer/Mediator/Form1.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.Designer.cs 2008-06-23 21:02:46 UTC (rev 279) +++ ACMServer/trunk/ACMServer/Mediator/Form1.Designer.cs 2008-06-26 18:22:52 UTC (rev 280) @@ -33,13 +33,10 @@ this.label1 = new System.Windows.Forms.Label(); this.button3 = new System.Windows.Forms.Button(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); - this.timerCountSocketClients = new System.Windows.Forms.Timer(this.components); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox3 = new System.Windows.Forms.TextBox(); this.timerUpdateTextLog = new System.Windows.Forms.Timer(this.components); - this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // button2 @@ -75,25 +72,12 @@ // // statusStrip1 // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel1}); this.statusStrip1.Location = new System.Drawing.Point(0, 295); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(369, 22); this.statusStrip1.TabIndex = 9; this.statusStrip1.Text = "statusStrip1"; // - // toolStripStatusLabel1 - // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17); - this.toolStripStatusLabel1.Text = "toolStripStatusLabel1"; - // - // timerCountSocketClients - // - this.timerCountSocketClients.Enabled = true; - this.timerCountSocketClients.Tick += new System.EventHandler(this.timer1_Tick); - // // textBox1 // this.textBox1.Location = new System.Drawing.Point(12, 95); @@ -145,8 +129,6 @@ this.Text = "Gate"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -158,8 +140,6 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button3; private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; - private System.Windows.Forms.Timer timerCountSocketClients; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox3; Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-23 21:02:46 UTC (rev 279) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-26 18:22:52 UTC (rev 280) @@ -77,20 +77,6 @@ Disconnnect(); } - private void timer1_Tick(object sender, EventArgs e) - { - string mes = "CountOfClients: "; - /* - AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); - SocketServerPlugin b2 = (SocketServerPlugin)socketCreater.GetInstance(); - if (b2 != null) - mes += b2.CountClients().ToString(); - else - mes += "0"; - */ - toolStripStatusLabel1.Text = mes; - } - private void Form1_Load(object sender, EventArgs e) { button2_Click(this, null); Modified: ACMServer/trunk/ACMServer/Mediator/Form1.resx =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.resx 2008-06-23 21:02:46 UTC (rev 279) +++ ACMServer/trunk/ACMServer/Mediator/Form1.resx 2008-06-26 18:22:52 UTC (rev 280) @@ -120,9 +120,6 @@ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="timerCountSocketClients.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>127, 17</value> - </metadata> <metadata name="timerUpdateTextLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>300, 17</value> </metadata> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-28 11:28:59
|
Revision: 285 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=285&view=rev Author: brus07 Date: 2008-06-28 04:29:06 -0700 (Sat, 28 Jun 2008) Log Message: ----------- Change class name Modified Paths: -------------- ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-28 11:13:25 UTC (rev 284) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-28 11:29:06 UTC (rev 285) @@ -32,12 +32,12 @@ void RunLoadDll(Object ob) { - kernel.AddControl += new EventHandler<AcmContester.Mediator.Library.MediatorKernel.ControlEventArds>(kernel_AddControl); + kernel.AddControl += new EventHandler<AcmContester.Mediator.Library.MediatorKernel.ControlEventArgs>(kernel_AddControl); kernel.LoadLists(); } - delegate void AddControlCallback(object sender, AcmContester.Mediator.Library.MediatorKernel.ControlEventArds e); - void kernel_AddControl(object sender, AcmContester.Mediator.Library.MediatorKernel.ControlEventArds e) + delegate void AddControlCallback(object sender, AcmContester.Mediator.Library.MediatorKernel.ControlEventArgs e); + void kernel_AddControl(object sender, AcmContester.Mediator.Library.MediatorKernel.ControlEventArgs e) { if (this.tabControl1.InvokeRequired) { Modified: ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-28 11:13:25 UTC (rev 284) +++ ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-28 11:29:06 UTC (rev 285) @@ -13,11 +13,11 @@ public Panel panel; - internal sealed class ControlEventArds : EventArgs + internal sealed class ControlEventArgs : EventArgs { Control control; string name; - public ControlEventArds(Control in_Control, string in_Name) + public ControlEventArgs(Control in_Control, string in_Name) { control = in_Control; name = in_Name; @@ -39,7 +39,7 @@ } - public event EventHandler<ControlEventArds> AddControl; + public event EventHandler<ControlEventArgs> AddControl; public void LoadLists() { @@ -50,7 +50,7 @@ plugin.onWorkingData += WorkingData; if (plugin.Control != null) { - this.OnAddControl(new ControlEventArds(plugin.Control, plugin.GetType().Name)); + this.OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); } } clientSideList = PluginsLoader<BaseMediatorPlugin>.Load("Dll_Web"); @@ -60,14 +60,14 @@ plugin.onWorkingData += WorkingData; if (plugin.Control != null) { - this.OnAddControl(new ControlEventArds(plugin.Control, plugin.GetType().Name)); + this.OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); } } } - private void OnAddControl(ControlEventArds e) + private void OnAddControl(ControlEventArgs e) { - EventHandler<ControlEventArds> temp = AddControl; + EventHandler<ControlEventArgs> temp = AddControl; if (temp != null) temp(this, e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |