diff --git a/NativeAppWin/Form1.Designer.cs b/NativeAppWin/Form1.Designer.cs
deleted file mode 100644
index d700e6c..0000000
--- a/NativeAppWin/Form1.Designer.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-namespace NativeAppWin
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.listBox1 = new System.Windows.Forms.ListBox();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.button5 = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.AutoSize = true;
- this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.groupBox1.Controls.Add(this.richTextBox1);
- this.groupBox1.Controls.Add(this.listBox1);
- this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.groupBox1.Location = new System.Drawing.Point(0, 0);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(692, 307);
- this.groupBox1.TabIndex = 6;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "msgs received";
- //
- // richTextBox1
- //
- this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.richTextBox1.Location = new System.Drawing.Point(272, 16);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(417, 288);
- this.richTextBox1.TabIndex = 4;
- this.richTextBox1.Text = "";
- //
- // listBox1
- //
- this.listBox1.Dock = System.Windows.Forms.DockStyle.Left;
- this.listBox1.FormattingEnabled = true;
- this.listBox1.Location = new System.Drawing.Point(3, 16);
- this.listBox1.Name = "listBox1";
- this.listBox1.Size = new System.Drawing.Size(269, 288);
- this.listBox1.TabIndex = 5;
- this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.button5);
- this.groupBox2.Controls.Add(this.textBox2);
- this.groupBox2.Controls.Add(this.button4);
- this.groupBox2.Controls.Add(this.button3);
- this.groupBox2.Controls.Add(this.checkBox2);
- this.groupBox2.Controls.Add(this.checkBox1);
- this.groupBox2.Controls.Add(this.textBox1);
- this.groupBox2.Controls.Add(this.button2);
- this.groupBox2.Controls.Add(this.button1);
- this.groupBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.groupBox2.Location = new System.Drawing.Point(0, 307);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(692, 93);
- this.groupBox2.TabIndex = 8;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "send msgs";
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(9, 48);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(114, 23);
- this.button4.TabIndex = 11;
- this.button4.Text = "CommandSub";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(556, 15);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(102, 23);
- this.button3.TabIndex = 10;
- this.button3.Text = "Send EMU Cmd";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // checkBox2
- //
- this.checkBox2.AutoSize = true;
- this.checkBox2.Location = new System.Drawing.Point(470, 19);
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(76, 17);
- this.checkBox2.TabIndex = 9;
- this.checkBox2.Text = "showResp";
- this.checkBox2.UseVisualStyleBackColor = true;
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(383, 19);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(72, 17);
- this.checkBox1.TabIndex = 8;
- this.checkBox1.Text = "showCmd";
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(276, 21);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(100, 20);
- this.textBox1.TabIndex = 7;
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.button2.Location = new System.Drawing.Point(139, 19);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(120, 23);
- this.button2.TabIndex = 6;
- this.button2.Text = "get token";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(9, 19);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(114, 23);
- this.button1.TabIndex = 5;
- this.button1.Text = "Start listening";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(276, 51);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(100, 20);
- this.textBox2.TabIndex = 12;
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(383, 49);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(138, 23);
- this.button5.TabIndex = 13;
- this.button5.Text = "CmdInterceptionRS";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(692, 400);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.groupBox2);
- this.Name = "Form1";
- this.Load += new System.EventHandler(this.Form1_Load);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.ListBox listBox1;
- private System.Windows.Forms.RichTextBox richTextBox1;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.CheckBox checkBox2;
- private System.Windows.Forms.CheckBox checkBox1;
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button5;
- private System.Windows.Forms.TextBox textBox2;
- }
-}
-
diff --git a/NativeAppWin/FormMain.Designer.cs b/NativeAppWin/FormMain.Designer.cs
new file mode 100644
index 0000000..09814ef
--- /dev/null
+++ b/NativeAppWin/FormMain.Designer.cs
@@ -0,0 +1,221 @@
+namespace NativeAppWin
+{
+ partial class FormMain
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.richTextBoxMessageDetail = new System.Windows.Forms.RichTextBox();
+ this.listBoxMessages = new System.Windows.Forms.ListBox();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.buttonCmdInterceptionRS = new System.Windows.Forms.Button();
+ this.textBoxCmdInterception = new System.Windows.Forms.TextBox();
+ this.buttonCmdSubscribe = new System.Windows.Forms.Button();
+ this.buttonSendEmuCmd = new System.Windows.Forms.Button();
+ this.checkBox2 = new System.Windows.Forms.CheckBox();
+ this.checkBoxShowCmd = new System.Windows.Forms.CheckBox();
+ this.textBoxSendEmuCmd = new System.Windows.Forms.TextBox();
+ this.buttonGetToken = new System.Windows.Forms.Button();
+ this.buttonStartListening = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.AutoSize = true;
+ this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.groupBox1.Controls.Add(this.richTextBoxMessageDetail);
+ this.groupBox1.Controls.Add(this.listBoxMessages);
+ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox1.Location = new System.Drawing.Point(0, 0);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(692, 312);
+ this.groupBox1.TabIndex = 6;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Messages";
+ //
+ // richTextBoxMessageDetail
+ //
+ this.richTextBoxMessageDetail.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.richTextBoxMessageDetail.Location = new System.Drawing.Point(272, 16);
+ this.richTextBoxMessageDetail.Name = "richTextBoxMessageDetail";
+ this.richTextBoxMessageDetail.Size = new System.Drawing.Size(417, 293);
+ this.richTextBoxMessageDetail.TabIndex = 4;
+ this.richTextBoxMessageDetail.Text = "";
+ //
+ // listBoxMessages
+ //
+ this.listBoxMessages.Dock = System.Windows.Forms.DockStyle.Left;
+ this.listBoxMessages.FormattingEnabled = true;
+ this.listBoxMessages.Location = new System.Drawing.Point(3, 16);
+ this.listBoxMessages.Name = "listBoxMessages";
+ this.listBoxMessages.Size = new System.Drawing.Size(269, 293);
+ this.listBoxMessages.TabIndex = 5;
+ this.listBoxMessages.SelectedIndexChanged += new System.EventHandler(this.listBoxMessages_SelectedIndexChanged);
+ //
+ // groupBox2
+ //
+ this.groupBox2.Controls.Add(this.buttonCmdInterceptionRS);
+ this.groupBox2.Controls.Add(this.textBoxCmdInterception);
+ this.groupBox2.Controls.Add(this.buttonCmdSubscribe);
+ this.groupBox2.Controls.Add(this.buttonSendEmuCmd);
+ this.groupBox2.Controls.Add(this.checkBox2);
+ this.groupBox2.Controls.Add(this.checkBoxShowCmd);
+ this.groupBox2.Controls.Add(this.textBoxSendEmuCmd);
+ this.groupBox2.Controls.Add(this.buttonGetToken);
+ this.groupBox2.Controls.Add(this.buttonStartListening);
+ this.groupBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.groupBox2.Location = new System.Drawing.Point(0, 312);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(692, 103);
+ this.groupBox2.TabIndex = 8;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "Send Message Actions";
+ //
+ // buttonCmdInterceptionRS
+ //
+ this.buttonCmdInterceptionRS.Location = new System.Drawing.Point(407, 19);
+ this.buttonCmdInterceptionRS.Name = "buttonCmdInterceptionRS";
+ this.buttonCmdInterceptionRS.Size = new System.Drawing.Size(112, 23);
+ this.buttonCmdInterceptionRS.TabIndex = 13;
+ this.buttonCmdInterceptionRS.Text = "CmdInterceptionRS";
+ this.buttonCmdInterceptionRS.UseVisualStyleBackColor = true;
+ this.buttonCmdInterceptionRS.Click += new System.EventHandler(this.buttonCmdInterceptionRS_Click);
+ //
+ // textBoxCmdInterception
+ //
+ this.textBoxCmdInterception.Location = new System.Drawing.Point(286, 21);
+ this.textBoxCmdInterception.Name = "textBoxCmdInterception";
+ this.textBoxCmdInterception.Size = new System.Drawing.Size(114, 20);
+ this.textBoxCmdInterception.TabIndex = 12;
+ //
+ // buttonCmdSubscribe
+ //
+ this.buttonCmdSubscribe.Location = new System.Drawing.Point(9, 58);
+ this.buttonCmdSubscribe.Name = "buttonCmdSubscribe";
+ this.buttonCmdSubscribe.Size = new System.Drawing.Size(114, 23);
+ this.buttonCmdSubscribe.TabIndex = 11;
+ this.buttonCmdSubscribe.Text = "Cmd Subscribe";
+ this.buttonCmdSubscribe.UseVisualStyleBackColor = true;
+ this.buttonCmdSubscribe.Click += new System.EventHandler(this.buttonCmdSubscribe_Click);
+ //
+ // buttonSendEmuCmd
+ //
+ this.buttonSendEmuCmd.Location = new System.Drawing.Point(406, 58);
+ this.buttonSendEmuCmd.Name = "buttonSendEmuCmd";
+ this.buttonSendEmuCmd.Size = new System.Drawing.Size(113, 23);
+ this.buttonSendEmuCmd.TabIndex = 10;
+ this.buttonSendEmuCmd.Text = "Send EMU Cmd";
+ this.buttonSendEmuCmd.UseVisualStyleBackColor = true;
+ this.buttonSendEmuCmd.Click += new System.EventHandler(this.buttonSendEmuCmd_Click);
+ //
+ // checkBox2
+ //
+ this.checkBox2.AutoSize = true;
+ this.checkBox2.Location = new System.Drawing.Point(366, 86);
+ this.checkBox2.Name = "checkBox2";
+ this.checkBox2.Size = new System.Drawing.Size(76, 17);
+ this.checkBox2.TabIndex = 9;
+ this.checkBox2.Text = "showResp";
+ this.checkBox2.UseVisualStyleBackColor = true;
+ //
+ // checkBoxShowCmd
+ //
+ this.checkBoxShowCmd.AutoSize = true;
+ this.checkBoxShowCmd.Location = new System.Drawing.Point(288, 86);
+ this.checkBoxShowCmd.Name = "checkBoxShowCmd";
+ this.checkBoxShowCmd.Size = new System.Drawing.Size(72, 17);
+ this.checkBoxShowCmd.TabIndex = 8;
+ this.checkBoxShowCmd.Text = "showCmd";
+ this.checkBoxShowCmd.UseVisualStyleBackColor = true;
+ //
+ // textBoxSendEmuCmd
+ //
+ this.textBoxSendEmuCmd.Location = new System.Drawing.Point(286, 60);
+ this.textBoxSendEmuCmd.Name = "textBoxSendEmuCmd";
+ this.textBoxSendEmuCmd.Size = new System.Drawing.Size(114, 20);
+ this.textBoxSendEmuCmd.TabIndex = 7;
+ //
+ // buttonGetToken
+ //
+ this.buttonGetToken.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.buttonGetToken.Location = new System.Drawing.Point(142, 19);
+ this.buttonGetToken.Name = "buttonGetToken";
+ this.buttonGetToken.Size = new System.Drawing.Size(120, 23);
+ this.buttonGetToken.TabIndex = 6;
+ this.buttonGetToken.Text = "Get Token";
+ this.buttonGetToken.UseVisualStyleBackColor = true;
+ this.buttonGetToken.Click += new System.EventHandler(this.buttonGetToken_Click);
+ //
+ // buttonStartListening
+ //
+ this.buttonStartListening.Location = new System.Drawing.Point(9, 19);
+ this.buttonStartListening.Name = "buttonStartListening";
+ this.buttonStartListening.Size = new System.Drawing.Size(114, 23);
+ this.buttonStartListening.TabIndex = 5;
+ this.buttonStartListening.Text = "Start listening";
+ this.buttonStartListening.UseVisualStyleBackColor = true;
+ this.buttonStartListening.Click += new System.EventHandler(this.buttonStartListening_Click);
+ //
+ // FormMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(692, 415);
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.groupBox2);
+ this.Name = "FormMain";
+ this.Text = "Sabre Native API Tester";
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed);
+ this.Load += new System.EventHandler(this.FormMain_Load);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.ListBox listBoxMessages;
+ private System.Windows.Forms.RichTextBox richTextBoxMessageDetail;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.Button buttonGetToken;
+ private System.Windows.Forms.Button buttonStartListening;
+ private System.Windows.Forms.Button buttonSendEmuCmd;
+ private System.Windows.Forms.CheckBox checkBox2;
+ private System.Windows.Forms.CheckBox checkBoxShowCmd;
+ private System.Windows.Forms.TextBox textBoxSendEmuCmd;
+ private System.Windows.Forms.Button buttonCmdSubscribe;
+ private System.Windows.Forms.Button buttonCmdInterceptionRS;
+ private System.Windows.Forms.TextBox textBoxCmdInterception;
+ }
+}
+
diff --git a/NativeAppWin/Form1.cs b/NativeAppWin/FormMain.cs
similarity index 75%
rename from NativeAppWin/Form1.cs
rename to NativeAppWin/FormMain.cs
index af4e59c..373559a 100644
--- a/NativeAppWin/Form1.cs
+++ b/NativeAppWin/FormMain.cs
@@ -17,14 +17,12 @@
namespace NativeAppWin
{
- public partial class Form1 : Form
+ public partial class FormMain : Form
{
-
private static String RQ_QUEUE_SUFFIX = "_request";
private static String RS_QUEUE_SUFFIX = "_response";
private bool isListening = false;
-
protected static AutoResetEvent semaphore = new AutoResetEvent(false);
protected static ITextMessage message = null;
@@ -37,36 +35,30 @@ public partial class Form1 : Form
IMessageProducer producer;
IMessageConsumer consumer;
-
private int totMsgSent = 0;
private int totMsgReceived = 0;
protected String athID = null;
-
protected static List msgCache = new List();
-
protected static Dictionary msgsCache = new Dictionary();
- public Form1()
+ public FormMain()
{
InitializeComponent();
-
-
}
private void StartSession()
{
-
- //authentication data to connect to NativeAPI Bridge RedApp (ActiveMQ Broker)
+ // authentication data to connect to NativeAPI Bridge RedApp (ActiveMQ Broker)
String user = "admin";
String password = "password";
String host = "localhost";
int port = int.Parse("61616");
- String redAppID = "com.sabre.tn.redapp.example.nativeApi";
- String userID = System.Environment.GetEnvironmentVariable("USERNAME");
- String domainID = System.Environment.GetEnvironmentVariable("USERDOMAIN");
+ String redAppID = "com.company.app.goes.here"; // from your eclipse workspace, project
+ String userID = Environment.GetEnvironmentVariable("USERNAME");
+ String domainID = Environment.GetEnvironmentVariable("USERDOMAIN");
- //Create connection
+ // Create connection
Uri connectUri = new Uri("activemq:tcp://" + host + ":" + port);
IConnectionFactory factory = new NMSConnectionFactory(connectUri);
connection = factory.CreateConnection(user, password);
@@ -79,44 +71,34 @@ private void StartSession()
destinationRQ = SessionUtil.GetDestination(session, redAppID + "_" + domainID + "\\" + userID + RQ_QUEUE_SUFFIX);
destinationRS = SessionUtil.GetDestination(session, redAppID + "_" + domainID + "\\" + userID + RS_QUEUE_SUFFIX);
-
-
// create request producer
producer = session.CreateProducer(destinationRQ);
producer.DeliveryMode = MsgDeliveryMode.Persistent;
-
-
// create a consumee for responses queue, would receive and "parse" all messages from Bridge RedApp
// note that it will work "assynchronously", that is, the broker can "push" messages to client, without need to "pool"
consumer = session.CreateConsumer(destinationRS);
consumer.Listener += new MessageListener(onMessageAuto);
-
}
private String getSessionTokenRQ()
{
String body = "";
return body;
-
-
}
private String executeInEmuRQ(String pCommand)
{
- String body = "" + pCommand + "";
+ String body = "" + pCommand + "";
return body;
-
}
-
private String eventSubscriptionRQ()
{
String body = "";
return body;
}
-
private String commandtSubscriptionRQ()
{
String body = "";
@@ -125,10 +107,8 @@ private String commandtSubscriptionRQ()
private String commandInterceptionRS(String pCommand)
{
-
String body = "";
return body;
-
}
private void EndSession()
@@ -143,29 +123,22 @@ private void stopListening()
{
consumer.Close();
consumer.Listener -= null;
-
-
}
private void startListening()
{
SendMessage(eventSubscriptionRQ());
-
-
}
- private void Form1_Load(object sender, EventArgs e)
+ private void FormMain_Load(object sender, EventArgs e)
{
StartSession();
-
}
- private void Form1_FormClosed(object sender, EventArgs e)
+ private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
{
EndSession();
}
-
-
private void SendMessage(String body)
{
@@ -178,16 +151,13 @@ private void SendMessage(String body)
totMsgSent++;
String msgID = "out->" + totMsgSent + "-" + rootName;
cacheMsgs(msgID, msg.Text);
-
}
-
-
protected void onMessageAuto(IMessage rcvdMsg)
{
ITextMessage tmpmessage = rcvdMsg as ITextMessage;
- XmlDocument doc = new XmlDocument();
+ XmlDocument doc = new XmlDocument();
doc.LoadXml(tmpmessage.Text);
String rootName = doc.DocumentElement.Name;
@@ -195,18 +165,12 @@ protected void onMessageAuto(IMessage rcvdMsg)
String msgID = "in<-" + totMsgReceived + "-" + rootName;
cacheMsgs(msgID, tmpmessage.Text);
-
-
}
-
-
private void cacheMsgs(String msgID,String msgText)
{
msgsCache.Add(msgID, msgText);
addMsgList(msgID);
-
-
}
delegate void refreshCountCb(String text);
@@ -216,104 +180,91 @@ private void refreshCount(String text)
{
refreshCountCb cb = new refreshCountCb(refreshCount);
this.groupBox1.Invoke(cb,new object[] { text });
-
-
- }else
+ }
+ else
{
this.groupBox1.Text = text;
-
}
}
delegate void refreshListCb(List msgs);
private void refreshList(List msgs)
{
- if (this.listBox1.InvokeRequired)
+ if (this.listBoxMessages.InvokeRequired)
{
refreshListCb cb = new refreshListCb(refreshList);
- this.listBox1.Invoke(cb, new object[] { msgs });
-
-
- }else
+ this.listBoxMessages.Invoke(cb, new object[] { msgs });
+ }
+ else
{
- this.listBox1.Items.Clear();
+ this.listBoxMessages.Items.Clear();
int tam = msgCache.Count;
int i = 0;
for (i = 0; i < tam; i++)
{
- this.listBox1.Items.Add("Item" + i);
+ this.listBoxMessages.Items.Add("Item" + i);
}
-
}
}
delegate void addMsgListCb(String msgID);
private void addMsgList(String msgID)
{
- if (this.listBox1.InvokeRequired)
+ if (this.listBoxMessages.InvokeRequired)
{
addMsgListCb cb = new addMsgListCb(addMsgList);
- this.listBox1.Invoke(cb, new object[] { msgID });
-
-
+ this.listBoxMessages.Invoke(cb, new object[] { msgID });
}
else
{
-
- this.listBox1.Items.Add(msgID);
-
-
+ this.listBoxMessages.Items.Add(msgID);
}
}
-
-
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
+ private void listBoxMessages_SelectedIndexChanged(object sender, EventArgs e)
{
- if (this.listBox1.SelectedIndex >= 0)
+ if (this.listBoxMessages.SelectedIndex >= 0)
{
- this.richTextBox1.Clear();
- String msgID = this.listBox1.GetItemText(this.listBox1.GetItemText(this.listBox1.SelectedItem));
+ this.richTextBoxMessageDetail.Clear();
+ String msgID = this.listBoxMessages.GetItemText(this.listBoxMessages.GetItemText(this.listBoxMessages.SelectedItem));
if (msgsCache.ContainsKey(msgID))
- this.richTextBox1.Text = msgsCache[msgID];
+ this.richTextBoxMessageDetail.Text = msgsCache[msgID];
else
- this.richTextBox1.Text = "";
-
+ this.richTextBoxMessageDetail.Text = "";
}
}
- private void button1_Click(object sender, EventArgs e)
+ private void buttonStartListening_Click(object sender, EventArgs e)
{
if (!isListening)
{
startListening();
- this.button1.Text = "listening Events";
+ this.buttonStartListening.Text = "listening Events";
}
+
isListening = !isListening;
}
-
- private void button2_Click(object sender, EventArgs e)
+ private void buttonGetToken_Click(object sender, EventArgs e)
{
SendMessage(getSessionTokenRQ());
}
-
- private void button3_Click(object sender, EventArgs e)
+ private void buttonSendEmuCmd_Click(object sender, EventArgs e)
{
- SendMessage(executeInEmuRQ(this.textBox1.Text));
+ SendMessage(executeInEmuRQ(this.textBoxSendEmuCmd.Text));
}
- private void button4_Click(object sender, EventArgs e)
+ private void buttonCmdSubscribe_Click(object sender, EventArgs e)
{
SendMessage(commandtSubscriptionRQ());
}
- private void button5_Click(object sender, EventArgs e)
+ private void buttonCmdInterceptionRS_Click(object sender, EventArgs e)
{
- SendMessage(commandInterceptionRS(this.textBox2.Text));
-
+ SendMessage(commandInterceptionRS(this.textBoxCmdInterception.Text));
}
+
}
}
diff --git a/NativeAppWin/Form1.resx b/NativeAppWin/FormMain.resx
similarity index 100%
rename from NativeAppWin/Form1.resx
rename to NativeAppWin/FormMain.resx
diff --git a/NativeAppWin/NativeAppWin.csproj b/NativeAppWin/NativeAppWin.csproj
index 76bb5c6..d1942b7 100644
--- a/NativeAppWin/NativeAppWin.csproj
+++ b/NativeAppWin/NativeAppWin.csproj
@@ -61,12 +61,6 @@
false
-
- ..\..\..\resources\Apache.NMS.ActiveMQ-1.7.2-bin\lib\Apache.NMS\net-4.0\Apache.NMS.dll
-
-
- ..\..\..\resources\Apache.NMS.ActiveMQ-1.7.2-bin\build\net-4.0\release\Apache.NMS.ActiveMQ.dll
-
@@ -80,16 +74,16 @@
-
+
Form
-
- Form1.cs
+
+ FormMain.cs
-
- Form1.cs
+
+ FormMain.cs
ResXFileCodeGenerator
@@ -100,7 +94,6 @@
True
Resources.resx
-
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -129,6 +122,14 @@
false
+
+
+ 1.8.0
+
+
+ 1.8.0
+
+