private bool GetNewHost()
        {
            bool     blnResult = false;
            Assembly assembly  = CompilerHelper.CompileCSharp(editForm, CSharpCode);

            if (assembly != null)
            {
                if (SecondLifeHost != null)
                {
                    SecondLifeHost.Dispose();
                }
                SecondLifeHost = null;

                SecondLifeHost                          = new SecondLifeHost(this.mainForm, assembly, editForm.FullPathName, editForm.guid);
                SecondLifeHost.OnChat                  += editForm.ChatHandler;
                SecondLifeHost.OnMessageLinked         += editForm.MessageLinkedHandler;
                SecondLifeHost.OnDie                   += new EventHandler(host_OnDie);
                SecondLifeHost.OnReset                 += new EventHandler(SecondLifeHost_OnReset);
                SecondLifeHost.OnListenChannelsChanged += new EventHandler(SecondLifeHost_OnListenChannelsChanged);

                SecondLifeHost.OnVerboseMessage += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnVerboseMessage);
                SecondLifeHost.OnStateChange    += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnStateChange);

                SecondLifeHost.State("default", true);

                blnResult = true;
            }
            return(blnResult);
        }
Example #2
0
        public bool SyntaxCheck()
        {
            bool blnResult = false;

            //if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
            //	return false;

            if (this.IsScript)
            {
                LSL2CSharp translator = new LSL2CSharp(ConfLSL);
                string     strCSharp  = translator.Parse(SourceCode);

                if (System.Diagnostics.Debugger.IsAttached)
                {
                    for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--)
                    {
                        this.tabControl1.TabPages.RemoveAt(intI);
                    }

                    // TODO
                    TabPage tabPage = new TabPage("C#");
                    NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
                    numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp);
                    numberedTextBoxUC1.TextBox.Text     = strCSharp;
                    numberedTextBoxUC1.TextBox.ReadOnly = true;
                    numberedTextBoxUC1.Dock             = DockStyle.Fill;
                    tabPage.Controls.Add(numberedTextBoxUC1);
                    this.tabControl.TabPages.Add(tabPage);
                }
                blnResult = (null != CompilerHelper.CompileCSharp(this, strCSharp));
            }
            return(blnResult);
        }
Example #3
0
        public bool SyntaxCheck()
        {
            bool blnResult = false;

            //if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
            //	return false;

            if (this.IsScript)
            {
                string lsl = SourceCode;

                // If it is LSLI, it needs to import scripts first, before it recognizes imported functions
                if (LSLIPathHelper.IsLSLI(this.FullPathName))
                {
                    LSLIConverter converter = new LSLIConverter();
                    lsl = converter.ExpandToLSL(this);
                }

                LSL2CSharp translator = new LSL2CSharp(ConfLSL);
                string     strCSharp  = translator.Parse(lsl);

                if (System.Diagnostics.Debugger.IsAttached)
                {
                    for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--)
                    {
                        this.tabControl1.TabPages.RemoveAt(intI);
                    }

                    // TODO
                    TabPage tabPage = new TabPage("C#");
                    NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
                    numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp);
                    numberedTextBoxUC1.TextBox.Text     = strCSharp;
                    numberedTextBoxUC1.TextBox.ReadOnly = true;
                    numberedTextBoxUC1.Dock             = DockStyle.Fill;
                    tabPage.Controls.Add(numberedTextBoxUC1);
                    this.tabControl.TabPages.Add(tabPage);
                }
                blnResult = (null != CompilerHelper.CompileCSharp(this, strCSharp));
            }
            return(blnResult);
        }