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); }
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e) { if (SecondLifeHost != null) { string strStateName = (string)this.comboBox1.Items[this.comboBox1.SelectedIndex]; if (strStateName != "") { if (SecondLifeHost.CurrentStateName != strStateName) { SecondLifeHost.State(strStateName, true); } } } }