internal Chat(PluginControl pc) : base(pc) { // We want to process incoming chat control.instance.Client.Self.ChatFromSimulator += new EventHandler <ChatEventArgs>(OnChat); control.instance.Client.Self.AlertMessage += new EventHandler <AlertMessageEventArgs>(OnAlertMessage); Radegast.RadegastTab chatTab = control.instance.TabConsole.Tabs["chat"]; Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control; nearby = chatscreen.lvwObjects; nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged); nearby.GotFocus += new EventHandler(nearby_GotFocus); chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus); Title = "chat"; // Make a recognition grammar to improve accuracy. Listener.CreateGrammar("chat", new string[] { MUTE_OBJECTS, UNMUTE_OBJECTS }); }
public void Dispose() { control.instance.Client.Self.ChatFromSimulator -= new EventHandler <ChatEventArgs>(OnChat); control.instance.Client.Self.AlertMessage -= new EventHandler <AlertMessageEventArgs>(OnAlertMessage); if (control.instance.TabConsole != null && control.instance.TabConsole.TabExists("chat")) { Radegast.RadegastTab chatTab = control.instance.TabConsole.Tabs["chat"]; Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control; nearby = chatscreen.lvwObjects; nearby.SelectedIndexChanged -= new EventHandler(nearby_SelectedIndexChanged); nearby.GotFocus -= new EventHandler(nearby_GotFocus); chatscreen.ChatInputText.GotFocus -= new EventHandler(cbxInput_GotFocus); } nearby = null; }