Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string name   = textBox1.Text.Trim();
            string server = textBox2.Text.Trim();
            string Sport  = textBox3.Text.Trim();
            string nick   = textBox4.Text.Trim();

            string[] channels = richTextBox1.Text.Trim().Split(',');
            //ensure no withespace
            for (int i = 0; i < channels.Length; i++)
            {
                channels[i] = channels[i].Trim();
            }

            int port;

            if (name.Length == 0 || server.Length == 0 || Sport.Length == 0 || !int.TryParse(Sport, out port) || nick.Length == 0 || channels.Length == 0)
            {
                MessageBox.Show("Not all forms is filled!", "Missing input", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                if (this.main is ICallable)
                {
                    (this.main as ICallable).Call(this.main, new EcmaValue[] {
                        EcmaValue.String(name),
                        EcmaValue.String(server),
                        EcmaValue.Number(port),
                        EcmaValue.String(nick),
                        EcmaValue.Object(EcmaUntil.ToArray(this.state, new List <object>(channels)))
                    });
                }
                this.Close();
            }
        }
Example #2
0
 public IrcScriptWhoIs(EcmaState state, WhoIsData data)
 {
     this.data = data;
     this.Put("nick", EcmaValue.String(data.Nick));
     this.Put("channels", EcmaValue.Object(EcmaUntil.ToArray(state, new List <object>(data.Channels))));
     this.Put("isAway", EcmaValue.Boolean(data.Away));
     this.Put("awayMessage", EcmaValue.String(data.AwayMessage));
 }
Example #3
0
        private EcmaValue OpenConnection(EcmaHeadObject self, EcmaValue[] arg)
        {
            EcmaState state = this.Client.State;

            OpenConnection(
                arg[0].ToString(state),
                arg[1].ToString(state),
                arg[2].ToInt32(state),
                arg[3].ToString(state),
                EcmaUntil.ToStringArray(state, arg[4].ToObject(state))
                );
            return(EcmaValue.Undefined());
        }
Example #4
0
 public ScriptWhoIsData(EcmaState state, WhoIsData data)
 {
     this.Put("isAway", EcmaValue.Boolean(data.Away));
     this.Put("awayMessage", EcmaValue.String(data.AwayMessage));
     this.Put("channels", data.Channels == null ? EcmaValue.Object(new ArrayIntstance(state, new EcmaValue[0])) : EcmaValue.Object(EcmaUntil.ToArray(state, new List <object>(data.Channels))));
     this.Put("nick", EcmaValue.String(data.Nick));
 }