public void Show()
 {
     if (m_user == null)
     {
         //需要登录
         using (UserForm form = new UserForm(true, ShortPasswrod)){
             if (form.ShowDialog() == DialogResult.OK)
             {
                 m_user = form.GetUser();
                 if (m_user != null && m_notifyIcon != null)
                 {
                     m_notifyIcon.Text = "用户:" + m_user.Name;
                     m_user.Save();
                 }
             }
         }
     }
     if (m_user == null)
     {
         return;
     }
     if (m_room == null || m_room.IsDisposed)
     {
         m_room = new RoomForm(this);
     }
     m_room.Text = "" + m_user.Name;
     m_room.Show();
     m_room.Activate();
 }
Example #2
0
		public void Show(){
			if(m_user==null){
				//需要登录
				using(UserForm form=new UserForm(true,ShortPasswrod)){
					if(form.ShowDialog() == DialogResult.OK){
						m_user = form.GetUser();
						if(m_user!=null && m_notifyIcon!=null){
							m_notifyIcon.Text="用户:"+m_user.Name;
							m_user.Save();
						}
					}
				}
			}
			if(m_user==null){
				return;
			}
			if(m_room==null || m_room.IsDisposed){
				m_room=new RoomForm(this);
			}
			m_room.Text = ""+m_user.Name;
			m_room.Show();
			m_room.Activate();
		}