Esempio n. 1
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);
            }
        }
Esempio n. 2
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);
                }
            }
        }