From: <br...@us...> - 2008-08-02 12:39:01
|
Revision: 304 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=304&view=rev Author: brus07 Date: 2008-08-02 12:39:10 +0000 (Sat, 02 Aug 2008) Log Message: ----------- Show in statusBar status about checking webSite. Status can be "Checking..." or empty. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.resx Modified: ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-07-30 20:45:49 UTC (rev 303) +++ ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2008-08-02 12:39:10 UTC (rev 304) @@ -11,6 +11,9 @@ public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; + public event EventHandler onChecking; + public event EventHandler onChecked; + private IGetter getter = new WebGetter(); public WebConnector() @@ -38,13 +41,26 @@ private void OnTimedEvent(object source, ElapsedEventArgs e) { timer.Enabled = false; + OnChecking(); object ob = getter.GetInfoFromSite(); + OnChecked(); if (ob != null) { DataArrived(ob); } timer.Enabled = true; } + + private void OnChecking() + { + if (onChecking != null) + onChecking(this, null); + } + private void OnChecked() + { + if (onChecked != null) + onChecked(this, null); + } private void DataArrived(object Data) { Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-07-30 20:45:49 UTC (rev 303) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-08-02 12:39:10 UTC (rev 304) @@ -14,6 +14,9 @@ webGate.onDataArrived += DataArrived; base.Control = new WebGatePluginUserControl(); + + webGate.onChecked += OnChecked; + webGate.onChecking += OnChecking; } public override void Send(string message) @@ -26,10 +29,24 @@ protected override void DataArrived(string message) { - string text = "Arrived: " + message.Length + " bytes" + Environment.NewLine; + string text = "Arrived: " + message.Length + " bytes"; ((WebGatePluginUserControl)base.Control).AddText(text); base.DataArrived(message); } + + private void OnChecked(object o,EventArgs a) + { + SetStatusLabel(""); + } + private void OnChecking(object o,EventArgs a) + { + SetStatusLabel("Checking..."); + } + + private void SetStatusLabel(string str) + { + ((WebGatePluginUserControl)base.Control).MainStatusMessage = str; + } } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.Designer.cs 2008-07-30 20:45:49 UTC (rev 303) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.Designer.cs 2008-08-02 12:39:10 UTC (rev 304) @@ -34,7 +34,10 @@ this.CheckingIntervalNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.MainToolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); ((System.ComponentModel.ISupportInitialize)(this.CheckingIntervalNumericUpDown)).BeginInit(); + this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // textBox2 @@ -45,7 +48,7 @@ this.textBox2.Location = new System.Drawing.Point(3, 58); this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(263, 167); + this.textBox2.Size = new System.Drawing.Size(263, 145); this.textBox2.TabIndex = 2; // // setAddressButton @@ -114,10 +117,26 @@ this.label2.TabIndex = 7; this.label2.Text = "seconds."; // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MainToolStripStatusLabel}); + this.statusStrip1.Location = new System.Drawing.Point(0, 206); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(269, 22); + this.statusStrip1.TabIndex = 8; + this.statusStrip1.Text = "statusStrip1"; + // + // MainToolStripStatusLabel + // + this.MainToolStripStatusLabel.Name = "MainToolStripStatusLabel"; + this.MainToolStripStatusLabel.Size = new System.Drawing.Size(0, 17); + // // WebGatePluginUserControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.statusStrip1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.CheckingIntervalNumericUpDown); @@ -128,6 +147,8 @@ this.Size = new System.Drawing.Size(269, 228); this.Load += new System.EventHandler(this.WebGatePluginUserControl_Load); ((System.ComponentModel.ISupportInitialize)(this.CheckingIntervalNumericUpDown)).EndInit(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -141,5 +162,7 @@ private System.Windows.Forms.NumericUpDown CheckingIntervalNumericUpDown; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel MainToolStripStatusLabel; } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.cs 2008-07-30 20:45:49 UTC (rev 303) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.cs 2008-08-02 12:39:10 UTC (rev 304) @@ -54,5 +54,13 @@ } } } + + public string MainStatusMessage + { + set + { + MainToolStripStatusLabel.Text = value; + } + } } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.resx =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.resx 2008-07-30 20:45:49 UTC (rev 303) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePluginUserControl.resx 2008-08-02 12:39:10 UTC (rev 304) @@ -117,4 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |