예제 #1
0
 public void CloseForm(IManagedForm sender)
 {
     lock (this.locker)
     {
         if (this.formDictionary.ContainsKey(sender.FormID))
         {
             this.formDictionary.Remove(sender.FormID);
         }
     }
 }
예제 #2
0
 public void Add(IManagedForm form)
 {
     lock (this.locker)
     {
         if (this.formDictionary.ContainsKey(form.FormID))
         {
             IManagedForm local = this.formDictionary[form.FormID];
             //local.CurrentForm.FormClosed -= new FormClosedEventHandler(this.form_FormClosed);
             this.formDictionary.Remove(form.FormID);
         }
         //form.CurrentForm.FormClosed += new FormClosedEventHandler(this.form_FormClosed);
         this.formDictionary.Add(form.FormID, form);
     }
 }
예제 #3
0
        internal void ActivateOrCreateFormSend(string userid, IMUserInfo chatuser)
        {
            lock (locker)
            {
                IManagedForm form = GetForm(userid);

                if (form == null)
                {
                    chatMain f = new chatMain(chatuser);
                    form = f;
                    Add(f);
                    f.Show();
                }
                (form as chatMain).Activate();
                if (Common.ContainsMsg(userid))
                {
                    (form as chatMain).ShowOtherTextChat(userid, Common.GetMsgContractList(userid));
                    Common.RemoveMsg(userid);
                }
            }
        }
예제 #4
0
        internal void ActivateOrCreateFormSend(IMUserInfo chatuser)
        {
            lock (locker)
            {
                IManagedForm form = GetForm(chatuser.ID);

                if (form == null)
                {
                    frmchatMain f = new frmchatMain(chatuser);
                    form = f;
                    Add(f);
                }
                (form as frmchatMain).Show();
                (form as frmchatMain).Activate();
                if (Common.ContainsMsg(chatuser.ID))
                {
                    (form as frmchatMain).ShowOtherTextChat(chatuser.ID, Common.GetMsgContractList(chatuser.ID));
                    Common.RemoveMsg(chatuser.ID);
                }
            }
        }