summaryrefslogtreecommitdiff
path: root/CSharp
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp')
-rw-r--r--CSharp/Ivy/IvyProbe/IvyProbe.cs186
1 files changed, 17 insertions, 169 deletions
diff --git a/CSharp/Ivy/IvyProbe/IvyProbe.cs b/CSharp/Ivy/IvyProbe/IvyProbe.cs
index 674b8af..4ce78d1 100644
--- a/CSharp/Ivy/IvyProbe/IvyProbe.cs
+++ b/CSharp/Ivy/IvyProbe/IvyProbe.cs
@@ -1,4 +1,4 @@
-namespace IvyTest
+namespace IvyProbe
{
using System;
using System.Windows.Forms;
@@ -8,33 +8,24 @@ namespace IvyTest
using System.Runtime.Serialization.Formatters.Binary;
- class IvyTest : System.Windows.Forms.Form
+ partial class IvyProbe : System.Windows.Forms.Form
{
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox tbRegexp;
- private System.Windows.Forms.TextBox tbMsg;
- private System.Windows.Forms.Button btBind;
- private System.Windows.Forms.Button btSend;
- private System.Windows.Forms.TextBox ta;
-
- /// <summary>
- /// Variable nécessaire au concepteur.
- /// </summary>
- private System.ComponentModel.Container components = null;
internal Ivy bus;
- private System.Windows.Forms.Button btBindSimple;
- private System.Windows.Forms.Button btUnbind;
- public IvyTest()
+
+ public IvyProbe()
{
//TEST of formatter
- FileStream fs = new FileStream("DataFile.dat", FileMode.Create);
- IvyTCPMessage msg = new IvyTCPMessage(IvyTCPMessage.MessageType.Msg, 2, null);
- IvyTCPFormatter formatter = new IvyTCPFormatter();
- formatter.Serialize(fs, msg );
- fs.Close();
-
+ try
+ {
+ FileStream fs = new FileStream("DataFile.dat", FileMode.Create);
+ IvyTCPMessage msg = new IvyTCPMessage(IvyTCPMessage.MessageType.Msg, 2, new IvyArgument("pipo"));
+ IvyTCPFormatter formatter = new IvyTCPFormatter();
+ formatter.Serialize(fs, msg);
+ fs.Close();
+ }catch(Exception)
+ {
+ }
//
// Requis pour la prise en charge du Concepteur Windows Forms
//
@@ -51,151 +42,7 @@ namespace IvyTest
bus.start(null);
}
- /// <summary>
- /// Nettoyage des ressources utilisées.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- stop();
- bus = null;
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
- /// le contenu de cette méthode avec l'éditeur de code.
- /// </summary>
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.tbRegexp = new System.Windows.Forms.TextBox();
- this.tbMsg = new System.Windows.Forms.TextBox();
- this.ta = new System.Windows.Forms.TextBox();
- this.btBind = new System.Windows.Forms.Button();
- this.btSend = new System.Windows.Forms.Button();
- this.btUnbind = new System.Windows.Forms.Button();
- this.btBindSimple = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(8, 8);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(24, 16);
- this.label1.TabIndex = 0;
- this.label1.Text = "exp:";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(8, 248);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(56, 16);
- this.label2.TabIndex = 1;
- this.label2.Text = "Msg:";
- //
- // tbRegexp
- //
- this.tbRegexp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.tbRegexp.Location = new System.Drawing.Point(32, 0);
- this.tbRegexp.Name = "tbRegexp";
- this.tbRegexp.Size = new System.Drawing.Size(216, 20);
- this.tbRegexp.TabIndex = 2;
- this.tbRegexp.Text = "(.*)";
- this.tbRegexp.TextChanged += new System.EventHandler(this.tbRegexp_TextChanged);
- //
- // tbMsg
- //
- this.tbMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.tbMsg.Location = new System.Drawing.Point(72, 240);
- this.tbMsg.Name = "tbMsg";
- this.tbMsg.Size = new System.Drawing.Size(232, 20);
- this.tbMsg.TabIndex = 3;
- this.tbMsg.Text = "msg";
- this.tbMsg.TextChanged += new System.EventHandler(this.tbMsg_TextChanged);
- //
- // ta
- //
- this.ta.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.ta.Location = new System.Drawing.Point(0, 32);
- this.ta.Multiline = true;
- this.ta.Name = "ta";
- this.ta.Size = new System.Drawing.Size(384, 200);
- this.ta.TabIndex = 4;
- this.ta.Text = "";
- //
- // btBind
- //
- this.btBind.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btBind.Location = new System.Drawing.Point(248, 0);
- this.btBind.Name = "btBind";
- this.btBind.Size = new System.Drawing.Size(40, 32);
- this.btBind.TabIndex = 5;
- this.btBind.Text = "bind regexp";
- this.btBind.Click += new System.EventHandler(this.RegexpCB);
- //
- // btSend
- //
- this.btSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btSend.Location = new System.Drawing.Point(312, 240);
- this.btSend.Name = "btSend";
- this.btSend.Size = new System.Drawing.Size(64, 24);
- this.btSend.TabIndex = 6;
- this.btSend.Text = "Send";
- this.btSend.Click += new System.EventHandler(this.SendCB);
- //
- // btUnbind
- //
- this.btUnbind.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btUnbind.Location = new System.Drawing.Point(336, 0);
- this.btUnbind.Name = "btUnbind";
- this.btUnbind.Size = new System.Drawing.Size(48, 24);
- this.btUnbind.TabIndex = 7;
- this.btUnbind.Text = "unbind";
- this.btUnbind.Click += new System.EventHandler(this.btUnbind_Click);
- //
- // btBindSimple
- //
- this.btBindSimple.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btBindSimple.Location = new System.Drawing.Point(288, 0);
- this.btBindSimple.Name = "btBindSimple";
- this.btBindSimple.Size = new System.Drawing.Size(40, 32);
- this.btBindSimple.TabIndex = 8;
- this.btBindSimple.Text = "bind simple";
- this.btBindSimple.Click += new System.EventHandler(this.ExpressionCB);
- //
- // IvyTest
- //
- this.AcceptButton = this.btSend;
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(384, 266);
- this.Controls.Add(this.btBindSimple);
- this.Controls.Add(this.btUnbind);
- this.Controls.Add(this.btSend);
- this.Controls.Add(this.btBind);
- this.Controls.Add(this.ta);
- this.Controls.Add(this.tbMsg);
- this.Controls.Add(this.tbRegexp);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Name = "IvyTest";
- this.Text = "IvyTest";
- this.ResumeLayout(false);
-
- }
- #endregion
public void stop()
{
bus.clientConnected -= new Ivy.ClientConnectedHandler( connect );
@@ -270,8 +117,9 @@ namespace IvyTest
[STAThread]
public static void Main(System.String[] args)
{
- IvyTest tb = new IvyTest();
- Application.Run(tb);
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new IvyProbe());
}