Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Type: TinyTool_SHARP.Form1
- TinyTool_SHARP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- using FluorineFx.Messaging.Api.Service;
- using FluorineFx.Net;
- using System;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Drawing;
- using System.Windows.Forms;
- using System.Xml;
- namespace TinyTool_SHARP
- {
- public class Form1 : Form, IPendingServiceCallback
- {
- private NetConnection _netConnection;
- private XmlTextReader _xmlReader;
- private IContainer components;
- private GroupBox GRP_BOX_CONN_CONFIG;
- private Label LBL_ROOM_NAME;
- private Label LBL_SERVER_IP;
- private TextBox TXT_BOX_ROOM_NAME;
- private TextBox TXT_BOX_SERVER_IP;
- private TextBox TXT_BOX_SERVER_PORT;
- private Label LBL_SERVER_PORT;
- private GroupBox GRP_OPTIONS;
- private Label LBL_COMMAND_ARG;
- private Label LBL_COMMAND_NAME;
- private Button BTN_DISCONNECT;
- private Button BTN_CONNECT;
- private TextBox TXT_BOX_CMD_ARG;
- private TextBox TXT_BOX_COMMAND;
- private LinkLabel LNK_LBL_SITE;
- private Button BTN_RUN_CMD;
- private TextBox TXT_BOX_CONN_NUM;
- private Label DYN_LBL_STATUS;
- private Label label1;
- public Form1()
- {
- this.InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- this._netConnection = new NetConnection();
- this._netConnection.OnConnect += new ConnectHandler(this._netConnection_OnConnect);
- this._netConnection.NetStatus += new NetStatusHandler(this._netConnection_NetStatus);
- this._netConnection.OnDisconnect += new DisconnectHandler(this._netConnection_OnDisconnect);
- }
- private void _netConnection_OnConnect(object sender, EventArgs e)
- {
- this.BTN_RUN_CMD.Enabled = true;
- this.BTN_CONNECT.Enabled = false;
- this.BTN_DISCONNECT.Enabled = true;
- this.DYN_LBL_STATUS.Text = "Status: Connected";
- }
- private void _netConnection_OnDisconnect(object sender, EventArgs e)
- {
- this.BTN_CONNECT.Enabled = true;
- this.BTN_RUN_CMD.Enabled = false;
- this.BTN_DISCONNECT.Enabled = false;
- this.DYN_LBL_STATUS.Text = "Status: Disconnected";
- }
- private void _netConnection_NetStatus(object sender, NetStatusEventArgs e)
- {
- if (!(e.Info["level"] as string == "error"))
- return;
- this.DYN_LBL_STATUS.Text = "Status: Error Connecting";
- }
- private void BTN_CONNECT_Click(object sender, EventArgs e)
- {
- if (!(this.TXT_BOX_ROOM_NAME.Text != ""))
- return;
- try
- {
- int num = Convert.ToInt32(this.TXT_BOX_CONN_NUM.Text);
- if (num > 0)
- {
- string[] strArray = new string[4]
- {
- this.TXT_BOX_ROOM_NAME.Text,
- "none",
- "show",
- "tinychat"
- };
- this._xmlReader = new XmlTextReader("http://tinychat.com/api/find.room/" + this.TXT_BOX_ROOM_NAME.Text);
- this._xmlReader.Read();
- string attribute = this._xmlReader.GetAttribute("rtmp");
- for (int index = 0; index < num; ++index)
- this._netConnection.Connect(attribute, (object[]) strArray);
- }
- else
- this.DYN_LBL_STATUS.Text = "Status: Connection Number Must be ( > 0 )";
- }
- catch (OverflowException ex)
- {
- this.DYN_LBL_STATUS.Text = "Status: Connection Number Larger then INT32";
- }
- catch (FormatException ex)
- {
- this.DYN_LBL_STATUS.Text = "Status: Improper Connection Number Format";
- }
- }
- private void BTN_DISCONNECT_Click(object sender, EventArgs e)
- {
- this._netConnection.Close();
- }
- private void BTN_RUN_CMD_Click(object sender, EventArgs e)
- {
- if (!(this.TXT_BOX_COMMAND.Text != "") || !(this.TXT_BOX_CMD_ARG.Text != "") || this.BTN_CONNECT.Enabled)
- return;
- this._netConnection.Call(this.TXT_BOX_COMMAND.Text, (IPendingServiceCallback) this, new object[1]
- {
- (object) this.TXT_BOX_CMD_ARG.Text
- });
- }
- private void LNK_LBL_SITE_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- Process.Start("");
- }
- public void ResultReceived(IPendingServiceCall call)
- {
- }
- protected override void Dispose(bool disposing)
- {
- if (disposing && this.components != null)
- this.components.Dispose();
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
- this.GRP_BOX_CONN_CONFIG = new GroupBox();
- this.TXT_BOX_SERVER_PORT = new TextBox();
- this.LBL_SERVER_PORT = new Label();
- this.TXT_BOX_SERVER_IP = new TextBox();
- this.LBL_SERVER_IP = new Label();
- this.TXT_BOX_ROOM_NAME = new TextBox();
- this.LBL_ROOM_NAME = new Label();
- this.GRP_OPTIONS = new GroupBox();
- this.DYN_LBL_STATUS = new Label();
- this.BTN_RUN_CMD = new Button();
- this.TXT_BOX_CMD_ARG = new TextBox();
- this.TXT_BOX_COMMAND = new TextBox();
- this.LBL_COMMAND_ARG = new Label();
- this.LBL_COMMAND_NAME = new Label();
- this.BTN_CONNECT = new Button();
- this.BTN_DISCONNECT = new Button();
- this.LNK_LBL_SITE = new LinkLabel();
- this.TXT_BOX_CONN_NUM = new TextBox();
- this.label1 = new Label();
- this.GRP_BOX_CONN_CONFIG.SuspendLayout();
- this.GRP_OPTIONS.SuspendLayout();
- this.SuspendLayout();
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.TXT_BOX_SERVER_PORT);
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.LBL_SERVER_PORT);
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.TXT_BOX_SERVER_IP);
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.LBL_SERVER_IP);
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.TXT_BOX_ROOM_NAME);
- this.GRP_BOX_CONN_CONFIG.Controls.Add((Control) this.LBL_ROOM_NAME);
- this.GRP_BOX_CONN_CONFIG.Location = new Point(8, 8);
- this.GRP_BOX_CONN_CONFIG.Name = "GRP_BOX_CONN_CONFIG";
- this.GRP_BOX_CONN_CONFIG.Size = new Size(264, 104);
- this.GRP_BOX_CONN_CONFIG.TabIndex = 0;
- this.GRP_BOX_CONN_CONFIG.TabStop = false;
- this.GRP_BOX_CONN_CONFIG.Text = "Connection Config";
- this.TXT_BOX_SERVER_PORT.Enabled = false;
- this.TXT_BOX_SERVER_PORT.Location = new Point(80, 48);
- this.TXT_BOX_SERVER_PORT.Name = "TXT_BOX_SERVER_PORT";
- this.TXT_BOX_SERVER_PORT.Size = new Size(176, 20);
- this.TXT_BOX_SERVER_PORT.TabIndex = 5;
- this.TXT_BOX_SERVER_PORT.Text = "443";
- this.LBL_SERVER_PORT.AutoSize = true;
- this.LBL_SERVER_PORT.Location = new Point(8, 48);
- this.LBL_SERVER_PORT.Name = "LBL_SERVER_PORT";
- this.LBL_SERVER_PORT.Size = new Size(63, 13);
- this.LBL_SERVER_PORT.TabIndex = 4;
- this.LBL_SERVER_PORT.Text = "Server Port:";
- this.TXT_BOX_SERVER_IP.Enabled = false;
- this.TXT_BOX_SERVER_IP.Location = new Point(80, 24);
- this.TXT_BOX_SERVER_IP.Name = "TXT_BOX_SERVER_IP";
- this.TXT_BOX_SERVER_IP.Size = new Size(176, 20);
- this.TXT_BOX_SERVER_IP.TabIndex = 3;
- this.TXT_BOX_SERVER_IP.Text = "rtmp://174.122.203.146";
- this.LBL_SERVER_IP.AutoSize = true;
- this.LBL_SERVER_IP.Location = new Point(8, 24);
- this.LBL_SERVER_IP.Name = "LBL_SERVER_IP";
- this.LBL_SERVER_IP.Size = new Size(54, 13);
- this.LBL_SERVER_IP.TabIndex = 2;
- this.LBL_SERVER_IP.Text = "Server IP:";
- this.TXT_BOX_ROOM_NAME.Location = new Point(80, 72);
- this.TXT_BOX_ROOM_NAME.Name = "TXT_BOX_ROOM_NAME";
- this.TXT_BOX_ROOM_NAME.Size = new Size(176, 20);
- this.TXT_BOX_ROOM_NAME.TabIndex = 1;
- this.TXT_BOX_ROOM_NAME.Text = "gellin";
- this.LBL_ROOM_NAME.AutoSize = true;
- this.LBL_ROOM_NAME.Location = new Point(8, 72);
- this.LBL_ROOM_NAME.Name = "LBL_ROOM_NAME";
- this.LBL_ROOM_NAME.Size = new Size(69, 13);
- this.LBL_ROOM_NAME.TabIndex = 0;
- this.LBL_ROOM_NAME.Text = "Room Name:";
- this.GRP_OPTIONS.Controls.Add((Control) this.DYN_LBL_STATUS);
- this.GRP_OPTIONS.Controls.Add((Control) this.BTN_RUN_CMD);
- this.GRP_OPTIONS.Controls.Add((Control) this.TXT_BOX_CMD_ARG);
- this.GRP_OPTIONS.Controls.Add((Control) this.TXT_BOX_COMMAND);
- this.GRP_OPTIONS.Controls.Add((Control) this.LBL_COMMAND_ARG);
- this.GRP_OPTIONS.Controls.Add((Control) this.LBL_COMMAND_NAME);
- this.GRP_OPTIONS.Location = new Point(8, 120);
- this.GRP_OPTIONS.Name = "GRP_OPTIONS";
- this.GRP_OPTIONS.Size = new Size(264, 128);
- this.GRP_OPTIONS.TabIndex = 1;
- this.GRP_OPTIONS.TabStop = false;
- this.GRP_OPTIONS.Text = "Options";
- this.DYN_LBL_STATUS.AutoSize = true;
- this.DYN_LBL_STATUS.Location = new Point(8, 104);
- this.DYN_LBL_STATUS.Name = "DYN_LBL_STATUS";
- this.DYN_LBL_STATUS.Size = new Size(109, 13);
- this.DYN_LBL_STATUS.TabIndex = 7;
- this.DYN_LBL_STATUS.Text = "Status: Disconnected";
- this.BTN_RUN_CMD.Enabled = false;
- this.BTN_RUN_CMD.Location = new Point(72, 72);
- this.BTN_RUN_CMD.Name = "BTN_RUN_CMD";
- this.BTN_RUN_CMD.Size = new Size(120, 24);
- this.BTN_RUN_CMD.TabIndex = 6;
- this.BTN_RUN_CMD.Text = "Run Command";
- this.BTN_RUN_CMD.UseVisualStyleBackColor = true;
- this.BTN_RUN_CMD.Click += new EventHandler(this.BTN_RUN_CMD_Click);
- this.TXT_BOX_CMD_ARG.Location = new Point(72, 48);
- this.TXT_BOX_CMD_ARG.Name = "TXT_BOX_CMD_ARG";
- this.TXT_BOX_CMD_ARG.Size = new Size(184, 20);
- this.TXT_BOX_CMD_ARG.TabIndex = 5;
- this.TXT_BOX_CMD_ARG.Text = "test";
- this.TXT_BOX_COMMAND.Location = new Point(72, 24);
- this.TXT_BOX_COMMAND.Name = "TXT_BOX_COMMAND";
- this.TXT_BOX_COMMAND.Size = new Size(184, 20);
- this.TXT_BOX_COMMAND.TabIndex = 4;
- this.TXT_BOX_COMMAND.Text = "nick";
- this.LBL_COMMAND_ARG.AutoSize = true;
- this.LBL_COMMAND_ARG.Location = new Point(8, 48);
- this.LBL_COMMAND_ARG.Name = "LBL_COMMAND_ARG";
- this.LBL_COMMAND_ARG.Size = new Size(53, 13);
- this.LBL_COMMAND_ARG.TabIndex = 3;
- this.LBL_COMMAND_ARG.Text = "CMD Arg:";
- this.LBL_COMMAND_NAME.AutoSize = true;
- this.LBL_COMMAND_NAME.Location = new Point(8, 24);
- this.LBL_COMMAND_NAME.Name = "LBL_COMMAND_NAME";
- this.LBL_COMMAND_NAME.Size = new Size(57, 13);
- this.LBL_COMMAND_NAME.TabIndex = 2;
- this.LBL_COMMAND_NAME.Text = "Command:";
- this.BTN_CONNECT.Location = new Point(8, 256);
- this.BTN_CONNECT.Name = "BTN_CONNECT";
- this.BTN_CONNECT.Size = new Size(104, 24);
- this.BTN_CONNECT.TabIndex = 0;
- this.BTN_CONNECT.Text = "Connect";
- this.BTN_CONNECT.UseVisualStyleBackColor = true;
- this.BTN_CONNECT.Click += new EventHandler(this.BTN_CONNECT_Click);
- this.BTN_DISCONNECT.Enabled = false;
- this.BTN_DISCONNECT.Location = new Point(168, 256);
- this.BTN_DISCONNECT.Name = "BTN_DISCONNECT";
- this.BTN_DISCONNECT.Size = new Size(104, 24);
- this.BTN_DISCONNECT.TabIndex = 1;
- this.BTN_DISCONNECT.Text = "Disconnect";
- this.BTN_DISCONNECT.UseVisualStyleBackColor = true;
- this.BTN_DISCONNECT.Click += new EventHandler(this.BTN_DISCONNECT_Click);
- this.LNK_LBL_SITE.AutoSize = true;
- this.LNK_LBL_SITE.Location = new Point(91, 296);
- this.LNK_LBL_SITE.Name = "LNK_LBL_SITE";
- this.LNK_LBL_SITE.Size = new Size(98, 13);
- this.LNK_LBL_SITE.TabIndex = 2;
- this.LNK_LBL_SITE.TabStop = true;
- this.LNK_LBL_SITE.Text = "www.uc-forum.com";
- this.LNK_LBL_SITE.LinkClicked += new LinkLabelLinkClickedEventHandler(this.LNK_LBL_SITE_LinkClicked);
- this.TXT_BOX_CONN_NUM.Location = new Point(120, 256);
- this.TXT_BOX_CONN_NUM.MaxLength = 5;
- this.TXT_BOX_CONN_NUM.Name = "TXT_BOX_CONN_NUM";
- this.TXT_BOX_CONN_NUM.Size = new Size(40, 20);
- this.TXT_BOX_CONN_NUM.TabIndex = 3;
- this.TXT_BOX_CONN_NUM.Text = "1";
- this.TXT_BOX_CONN_NUM.TextAlign = HorizontalAlignment.Center;
- this.label1.AutoSize = true;
- this.label1.Location = new Point(88, 280);
- this.label1.Name = "label1";
- this.label1.Size = new Size(105, 13);
- this.label1.TabIndex = 4;
- this.label1.Text = "Developed by: Gellin";
- this.AutoScaleDimensions = new SizeF(6f, 13f);
- this.AutoScaleMode = AutoScaleMode.Font;
- this.ClientSize = new Size(281, 314);
- this.Controls.Add((Control) this.label1);
- this.Controls.Add((Control) this.TXT_BOX_CONN_NUM);
- this.Controls.Add((Control) this.LNK_LBL_SITE);
- this.Controls.Add((Control) this.GRP_OPTIONS);
- this.Controls.Add((Control) this.GRP_BOX_CONN_CONFIG);
- this.Controls.Add((Control) this.BTN_CONNECT);
- this.Controls.Add((Control) this.BTN_DISCONNECT);
- this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
- this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "Form1";
- this.Text = " .:: TinyChat RTMP FlourineFX Testing Tool ::.";
- this.Load += new EventHandler(this.Form1_Load);
- this.GRP_BOX_CONN_CONFIG.ResumeLayout(false);
- this.GRP_BOX_CONN_CONFIG.PerformLayout();
- this.GRP_OPTIONS.ResumeLayout(false);
- this.GRP_OPTIONS.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement