Пример #1
0
        private void MouseDoubleClicked(object sender, EventArgs arg)
        {
            // 생성규칙
            // 프로파일 -> 채팅룸리스트 -> 실제폼

            string key = ((ProFileEX)sender).IDForCheck;

            if (BtnChatMemManager.getInstance().dicChatList.ContainsKey(key))
            {
                ChatLstButton btn = (ChatLstButton)BtnChatMemManager.getInstance().dicChatList[key];
                if (BtnChatMemManager.getInstance().dicFormList.ContainsKey(key))
                {
                    BtnChatMemManager.getInstance().dicFormList[key].Focus();
                }
                else
                {
                    Form chatroom = new ChatRoomForm(key, btn.m_chatLog);
                    chatroom.Show();
                }
            }
            else
            {
                //lstCprofile.Add(new ProFileEX(new Size(300, 50), new Point(0, 50 * cnt + 1), name, this));
                int           cnt      = BtnChatMemManager.getInstance().dicChatList.Count;
                ChatLstButton btn      = new ChatLstButton(new Size(m_parent.Width, 50), new Point(0, 50 * cnt), key, m_parent);
                Form          chatroom = new ChatRoomForm(key, btn.m_chatLog);
                chatroom.Show();
                BtnChatMemManager.getInstance().dicChatList.Add(key, btn);
                BtnChatMemManager.getInstance().dicFormList.Add(key, chatroom);
            }
        }
Пример #2
0
        // chatroomform과 이 버튼과 연결고리가 필요하며, 이버튼은 창이 죽었는지 살았는지 알아야 한다.
        private void MouseDoubleClicked(object sender, EventArgs arg)
        {
            string key = ((ChatLstButton)sender).IDForCheck;

            // 폼이 죽을때 리스트에서도 없어져야함 ㅇㅇ..
            if (BtnChatMemManager.getInstance().dicFormList.ContainsKey(key))
            {
                BtnChatMemManager.getInstance().dicFormList[key].Show();
            }
            else
            {
                ChatRoomForm NForm = new ChatRoomForm(key, m_chatLog);
                NForm.Show();
                BtnChatMemManager.getInstance().dicFormList.Add(key, NForm);
            }
            profileForm.ProfileForm f = (profileForm.ProfileForm)m_parent;
            f.uncheckedMsg -= this.unCheckedMsg;
            if (f.InvokeRequired)
            {
                m_parent.Invoke((MethodInvoker) delegate { f.refreshGui(); });
            }
            else
            {
                f.refreshGui();
            }
        }
Пример #3
0
        // recieve event 연쇄
        public void getMsg(string message)
        {
            Graphics G = this.CreateGraphics();

            m_chatLog.addChat(message, false, G);
            G.Dispose();
            if (!BtnChatMemManager.getInstance().dicFormList.ContainsKey(IDForCheck))
            {
                unCheckedMsg++;
                this.Refresh();
            }
            else
            {
                ChatRoomForm form = (ChatRoomForm)BtnChatMemManager.getInstance().dicFormList[this.IDForCheck];
                if (form.InvokeRequired)
                {
                    form.Invoke((MethodInvoker) delegate() { form.Refresh(); });
                }
                else
                {
                    form.Refresh();
                }
            }
        }