Example #1
0
        public llDialogForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.list buttons, SecondLife.integer intChannel)
        {
            InitializeComponent();

            this.host       = host;
            this.Channel    = intChannel;
            this.OwnerName  = strOwner;
            this.ObjectName = strObjectName;
            this.id         = id;

            for (int intI = 1; intI <= 12; intI++)
            {
                Button button = this.Controls["Button" + intI] as Button;
                button.Visible = false;
            }

            this.label1.Text = strOwner + "'s '" + strObjectName + "'";
            this.label2.Text = strMessage.ToString().Replace("&", "&&");

            for (int intI = 1; intI <= buttons.Count; intI++)
            {
                Button button = this.Controls["Button" + intI] as Button;
                if (button == null)
                {
                    continue;
                }
                button.Text    = buttons[intI - 1].ToString().Replace("&", "&&");
                button.Visible = true;
                button.Click  += new EventHandler(button_Click);
            }
        }
        private object[] GetArguments(string strName, string strArgs)
        {
            object[] objResult = new object[0];
            if (strArgs != "")
            {
                try {
                    string[] args       = strArgs.Trim().Split(new char[] { ',' });
                    object[] argobjects = new object[args.Length];
                    for (int intI = 0; intI < argobjects.Length; intI++)
                    {
                        string[] argument = args[intI].Trim().Split(new char[] { ' ' });
                        if (argument.Length == 2)
                        {
                            string[] arArgs;
                            string   strArgumentValue = GetArgumentValue(strName + "_" + intI);
                            string   strArgumentName  = argument[1];
                            string   strArgumentType  = argument[0];
                            switch (strArgumentType)
                            {
                            case "System.String":
                                argobjects[intI] = strArgumentValue;
                                break;

                            case "System.Int32":
                                argobjects[intI] = int.Parse(strArgumentValue);
                                break;

                            case "LSLEditor.SecondLife+Float":
                                argobjects[intI] = new SecondLife.Float(strArgumentValue);
                                break;

                            case "LSLEditor.SecondLife+integer":
                                argobjects[intI] = new SecondLife.integer(int.Parse(strArgumentValue));
                                break;

                            case "LSLEditor.SecondLife+String":
                                argobjects[intI] = new SecondLife.String(strArgumentValue);
                                break;

                            case "LSLEditor.SecondLife+key":
                                argobjects[intI] = new SecondLife.key(strArgumentValue);
                                break;

                            case "LSLEditor.SecondLife+list":
                                argobjects[intI] = new SecondLife.list(new string[] { strArgumentValue });
                                break;

                            case "LSLEditor.SecondLife+rotation":
                                arArgs           = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' });
                                argobjects[intI] = new SecondLife.rotation(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]), double.Parse(arArgs[3]));
                                break;

                            case "LSLEditor.SecondLife+vector":
                                arArgs           = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' });
                                argobjects[intI] = new SecondLife.vector(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]));
                                break;

                            default:
                                MessageBox.Show("Compiler->GetArguments->[" + strArgumentType + "][" + strArgumentName + "]");
                                argobjects[intI] = null;
                                break;
                            }
                        }
                        else
                        {
                            MessageBox.Show("Argument must be 'type name' [" + args[intI] + "]");
                            break;
                        }
                    }
                    objResult = argobjects;
                } catch { }
            }
            return(objResult);
        }
Example #3
0
        public llTextBoxForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.integer intChannel)
        {
            InitializeComponent();

            this.host       = host;
            this.Channel    = intChannel;
            this.OwnerName  = strOwner;
            this.ObjectName = strObjectName;
            this.id         = id;

            this.label1.Text = strMessage.ToString().Replace("&", "&&");
        }