Beispiel #1
0
        internal override void Shutdown()
        {
            if (chat != null)
            {
                chat.Dispose();
                chat = null;
            }

            // Automatically handle notifications (blue dialogs)
            Notification.OnNotificationDisplayed -=
                new Notification.NotificationCallback(OnNotificationDisplayed);

            // Announce connect and disconnect.
            control.instance.Netcom.ClientConnected -=
                new EventHandler <EventArgs>(Network_ClientConnected);
            control.instance.Netcom.ClientDisconnected -=
                new EventHandler <DisconnectedEventArgs>(Network_Disconnected);

            control.instance.Netcom.ClientLoginStatus -=
                new EventHandler <LoginProgressEventArgs>(netcom_ClientLoginStatus);

            // Notice arrival in a new sim
            control.instance.Client.Network.SimChanged -=
                new EventHandler <SimChangedEventArgs>(Network_SimChanged);

            control.instance.Netcom.ClientLoggingIn -=
                new EventHandler <Radegast.Netcom.OverrideEventArgs>(Netcom_ClientLoggingIn);
            // Watch the coming and going of main window tabs.
            control.instance.TabConsole.OnTabAdded -=
                new TabsConsole.TabCallback(TabConsole_OnTabAdded);
            control.instance.TabConsole.OnTabRemoved -=
                new TabsConsole.TabCallback(TabConsole_OnTabRemoved);

            // Notice when the active tab changes on the graphics user interface.
            control.instance.TabConsole.OnTabSelected -=
                new TabsConsole.TabCallback(OnTabChange);

            // Handle Instant Messages too
            control.instance.Client.Self.IM -=
                new EventHandler <InstantMessageEventArgs>(OnInstantMessage);

            // Outgoing IMs
            control.instance.Netcom.InstantMessageSent -= new EventHandler <Radegast.Netcom.InstantMessageSentEventArgs>(Netcom_InstantMessageSent);

            // System notifications in chat
            control.instance.TabConsole.OnChatNotification -= new TabsConsole.ChatNotificationCallback(TabConsole_OnChatNotification);

            control.listener.DeactivateGrammar(CONVGRAMMAR);

            foreach (Mode m in conversations.Values)
            {
                m.Stop();
            }
            foreach (Mode m in interruptions)
            {
                m.Stop();
            }
            conversations.Clear();
            interruptions.Clear();
        }
Beispiel #2
0
        private void Network_ClientConnected(object sender, EventArgs e)
        {
            Talker.Say("You are connected.", Talk.BeepType.Good);
            if (chat == null)
            {
                chat = new Chat(control);

                AddConversation(chat);
                SelectConversation(chat);
            }
        }
Beispiel #3
0
        public void ActivateConversationFromTab(RadegastTab Tab)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            if (sTabControl is InventoryConsole && control.config["enabled_for_inventory"])
            {
                SelectConversation(inventory);
            }
            else if (sTabControl is ChatConsole)
            {
                if (chat == null)
                {
                    chat         = new Chat(control);
                    chat.Console = sTabControl;
                    AddConversation(chat);
                }
                SelectConversation(chat);
            }
            else if (sTabControl is FriendsConsole && control.config["enabled_for_friends"])
            {
                SelectConversation(friends);
            }
            else if (sTabControl is VoiceConsole)
            {
                SelectConversation(voice);
            }
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                SelectConversation(
                    control.instance.Groups[tab.SessionId].Name);
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                SelectConversation(tab.SessionName);
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                SelectConversation(tab.TargetName);
            }
            else if (sTabControl is ObjectsConsole && control.config["enabled_for_objects"])
            {
                SelectConversation(surroundings);
            }
        }
Beispiel #4
0
        public void ActivateConversationFromTab(RadegastTab Tab)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            if (sTabControl is InventoryConsole && control.config["enabled_for_inventory"])
            {
                SelectConversation(inventory);
            }
            else if (sTabControl is ChatConsole)
            {
                if (chat == null)
                {
                    chat = new Chat(control);
                    chat.Console = sTabControl;
                    AddConversation(chat);
                }
                SelectConversation(chat);
            }
            else if (sTabControl is FriendsConsole && control.config["enabled_for_friends"])
            {
                SelectConversation(friends);
            }
            else if (sTabControl is VoiceConsole)
            {
                SelectConversation(voice);
            }
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                SelectConversation(
                    control.instance.Groups[tab.SessionId].Name);
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                SelectConversation(tab.SessionName);
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                SelectConversation(tab.TargetName);
            }
            else if (sTabControl is ObjectsConsole && control.config["enabled_for_objects"])
            {
                SelectConversation(surroundings);
            }
        }
Beispiel #5
0
        private void Network_ClientConnected(object sender, EventArgs e)
        {
            Talker.Say("You are connected.", Talk.BeepType.Good);
            if (chat == null)
            {
                chat = new Chat(control);

                AddConversation(chat);
                SelectConversation(chat);
            }
        }
Beispiel #6
0
        internal override void Shutdown()
        {
            if (chat != null)
            {
                chat.Dispose();
                chat = null;
            }

            // Automatically handle notifications (blue dialogs)
            Notification.OnNotificationDisplayed -=
                new Notification.NotificationCallback(OnNotificationDisplayed);

            // Announce connect and disconnect.
            control.instance.Netcom.ClientConnected -=
                new EventHandler<EventArgs>(Network_ClientConnected);
            control.instance.Netcom.ClientDisconnected -=
                new EventHandler<DisconnectedEventArgs>(Network_Disconnected);

            control.instance.Netcom.ClientLoginStatus -=
                new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);

            // Notice arrival in a new sim
            control.instance.Client.Network.SimChanged -=
                new EventHandler<SimChangedEventArgs>(Network_SimChanged);

            control.instance.Netcom.ClientLoggingIn -=
                new EventHandler<Radegast.Netcom.OverrideEventArgs>(Netcom_ClientLoggingIn);
            // Watch the coming and going of main window tabs.
            control.instance.TabConsole.OnTabAdded -=
                new TabsConsole.TabCallback(TabConsole_OnTabAdded);
            control.instance.TabConsole.OnTabRemoved -=
                new TabsConsole.TabCallback(TabConsole_OnTabRemoved);

            // Notice when the active tab changes on the graphics user interface.
            control.instance.TabConsole.OnTabSelected -=
                new TabsConsole.TabCallback(OnTabChange);

            // Handle Instant Messages too
            control.instance.Client.Self.IM -=
                new EventHandler<InstantMessageEventArgs>(OnInstantMessage);

            // Outgoing IMs
            control.instance.Netcom.InstantMessageSent -= new EventHandler<Radegast.Netcom.InstantMessageSentEventArgs>(Netcom_InstantMessageSent);

            // System notifications in chat
            control.instance.TabConsole.OnChatNotification -= new TabsConsole.ChatNotificationCallback(TabConsole_OnChatNotification);

            control.listener.DeactivateGrammar(CONVGRAMMAR);

            foreach (Mode m in conversations.Values)
            {
                m.Stop();
            }
            foreach (Mode m in interruptions)
            {
                m.Stop();
            }
            conversations.Clear();
            interruptions.Clear();
        }
Beispiel #7
0
        public void CreateConversationFromTab(RadegastTab Tab, bool selectConversation)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            Mode newConv = null;

            // Create a conversation on first appearance of its tab.
            if (sTabControl is InventoryConsole)
                newConv = inventory = new Closet(control);
            else if (sTabControl is ChatConsole)
            {
                if (chat != null) return;
                newConv = chat = new Chat(control);
            }
            else if (sTabControl is FriendsConsole)
                newConv = friends = new Friends(control);
            else if (sTabControl is VoiceConsole)
                newConv = voice = new Voice(control);
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                AddConversation(new GroupIMSession(control, tab.SessionId));
                return;
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                AddConversation(new ConferenceIMSession(control, tab.SessionId, tab.SessionName));
                return;
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                AddConversation(new SingleIMSession(control, tab.TargetName, tab.TargetId, tab.SessionId));
                return;
            }
            else if (sTabControl is ObjectsConsole)
            {
                surroundings = new Surroundings(control);
                AddConversation(surroundings);
            }

            // If a conversation was created, switch to it.
            if (newConv != null)
            {
                AddConversation(newConv);
                // Select CHAT as soon as it is created.
                if (selectConversation && sTabControl is ChatConsole)
                    SelectConversation(newConv);
            }
        }
Beispiel #8
0
        public void CreateConversationFromTab(RadegastTab Tab, bool selectConversation)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            Mode newConv = null;

            // Create a conversation on first appearance of its tab.
            if (sTabControl is InventoryConsole && control.config["enabled_for_inventory"])
            {
                newConv = inventory = new Closet(control);
            }
            else if (sTabControl is ChatConsole)
            {
                if (chat != null)
                {
                    return;
                }
                newConv = chat = new Chat(control);
            }
            else if (sTabControl is FriendsConsole && control.config["enabled_for_friends"])
            {
                newConv = friends = new Friends(control);
            }
            else if (sTabControl is VoiceConsole)
            {
                newConv = voice = new Voice(control);
            }
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                AddConversation(new GroupIMSession(control, tab.SessionId));
                return;
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                AddConversation(new ConferenceIMSession(control, tab.SessionId, tab.SessionName));
                return;
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                AddConversation(new SingleIMSession(control, tab.TargetName, tab.TargetId, tab.SessionId));
                return;
            }
            else if (sTabControl is ObjectsConsole && control.config["enabled_for_objects"])
            {
                surroundings = new Surroundings(control);
                AddConversation(surroundings);
            }

            // If a conversation was created, switch to it.
            if (newConv != null)
            {
                AddConversation(newConv);
                // Select CHAT as soon as it is created.
                if (selectConversation && sTabControl is ChatConsole)
                {
                    SelectConversation(newConv);
                }
            }
        }