Example #1
0
        public RoomView(ChatView parent, ChatService chat, ChatRoom room)
        {
            InitializeComponent();

            ParentView = parent;
            Chat       = chat;
            Room       = room;

            Core      = chat.Core;
            Locations = Core.Locations;

            GuiUtils.SetupToolstrip(BottomStrip, new OpusColorTable());

            if (room.Kind == RoomKind.Command_High || room.Kind == RoomKind.Live_High)
            {
                MessageTextBox.BackColor = Color.FromArgb(255, 250, 250);
            }

            else if (room.Kind == RoomKind.Command_Low || room.Kind == RoomKind.Live_Low)
            {
                MessageTextBox.BackColor = Color.FromArgb(250, 250, 255);
            }

            MemberTree.PreventCollapse = true;

            MessageTextBox.Core = Core;
            MessageTextBox.ContextMenuStrip.Items.Insert(0, new ToolStripSeparator());

            TimestampMenu = new ToolStripMenuItem("Timestamps", ViewRes.timestamp, new EventHandler(Menu_Timestamps));
            MessageTextBox.ContextMenuStrip.Items.Insert(0, TimestampMenu);


            VoiceService voices = Core.GetService(ServiceIDs.Voice) as VoiceService;

            if (voices != null)
            {
                VoiceButton = new VoiceToolstripButton(voices);
                BottomStrip.Items.Add(VoiceButton);
            }
        }
Example #2
0
        public override void Init()
        {
            InputControl.SendMessage += new TextInput.SendMessageHandler(InputControl_SendMessage);
            InputControl.SendFile    += new MethodInvoker(InputControl_SendFile);
            InputControl.IgnoreUser  += new MethodInvoker(InputControl_IgnoreUser);
            InputControl.AddBuddy    += new MethodInvoker(InputControl_AddBuddy);

            IM.ReSearchUser(UserID);
            IM_StatusUpdate(UserID);
            DisplayLog();

            InputControl.InputBox.Select();

            if (External != null)
            {
                External.Activated  += new EventHandler(External_Activated);
                External.Deactivate += new EventHandler(External_Deactivate);
            }

            if (!Core.Buddies.BuddyList.SafeContainsKey(UserID))
            {
                InputControl.AddBuddyButton.Visible = true;
            }


            VoiceService voices = Core.GetService(ServiceIDs.Voice) as VoiceService;

            if (voices != null)
            {
                VoiceButton = new VoiceToolstripButton(voices);
                InputControl.FontToolStrip.Items.Add(VoiceButton);
                VoiceButton.SetUsers(new List <ulong>()
                {
                    Core.UserID, UserID
                }, AudioDirection.Both);
            }
        }