public UpdateUserInfoForm(IRapidPassiveEngine engine,GlobalUserCache globalUserCache, GGUser user)
        {
            InitializeComponent();

            this.rapidPassiveEngine = engine;
            this.currentUser = user ;
            int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]);
            this.ggService = (IRemotingService)Activator.GetObject(typeof(IRemotingService), string.Format("tcp://{0}:{1}/RemotingService", ConfigurationManager.AppSettings["ServerIP"], registerPort)); ;
           
            this.skinLabel_ID.Text = user.UserID;
            this.skinTextBox_nickName.SkinTxt.Text = user.Name;
            this.skinTextBox_signature.SkinTxt.Text = user.Signature;           
            
            if (user.HeadImageIndex >= 0)
            {
                this.headImageIndex = user.HeadImageIndex;
                this.pnlImgTx.BackgroundImage = GlobalResourceManager.GetHeadImage(user); //根据ID获取头像   
            }
            else
            {                
                this.pnlImgTx.BackgroundImage = user.HeadImage;
                this.selfPhoto = true;
            }
        }        
        public static Image GetHeadImage(GGUser user, bool mine)
        {
            if (user.HeadImageIndex >= 0)
            {
                Image[] ary = (mine ? !user.OnlineOrHide : user.OfflineOrHide) ? GlobalResourceManager.headImagesGrey : GlobalResourceManager.headImages;
                if (user.HeadImageIndex < GlobalResourceManager.headImages.Length)
                {
                    return ary[user.HeadImageIndex];
                }

                return ary[0];
            }
            else
            {
                return (mine ? !user.OnlineOrHide : user.OfflineOrHide) ? user.HeadImageGrey : user.HeadImage;
            }
        } 
        public static Image GetHeadImageOnline(GGUser user)
        {
            if (user.HeadImageIndex >= 0)
            {
                if (user.HeadImageIndex < GlobalResourceManager.headImages.Length)
                {
                    return GlobalResourceManager.headImages[user.HeadImageIndex];
                }

                return GlobalResourceManager.headImages[0];
            }
            else
            {
                return user.HeadImage;
            }
        }
 public static Image GetHeadImage(GGUser user)
 {
     return GlobalResourceManager.GetHeadImage(user, false);
 }