Example #1
0
        private void UserInfoButton_Click(object sender, EventArgs e)
        {
            SettingPanel.Controls.Clear();
            var userinfo = new UserInfoControl(userService, User);

            SettingPanel.Controls.Add(userinfo);
        }
 public void Fill(Guid caller, IEnumerable <User> users, string title, string action,
                  UserInfoControl.ButtonType type = UserInfoControl.ButtonType.Empty)
 {
     _users           = users;
     titleLabel.Text  = title;
     actionLabel.Text = action;
     userCardsLayoutPanel.Controls.Clear();
     foreach (var u in users)
     {
         var ui = new UserInfoControl(u.Id);
         ui.SetType(u.Id == caller ? UserInfoControl.ButtonType.Empty : type);
         if (_userActionEvent != null)
         {
             ui.SetEvent(UserInfoControl.Option.ActionButtonClick, _userActionEvent);
         }
         userCardsLayoutPanel.Controls.Add(ui);
     }
     if (!userCardsLayoutPanel.VerticalScroll.Visible)
     {
         Size = new Size()
         {
             Height = Height,
             Width  = Width - 17
         }
     }
     ;
 }
Example #3
0
        /// <summary>
        /// 个人信息
        /// </summary>
        private void UserInfoCollections()
        {
            this.setPanelContent.Controls.Clear();
            UserInfoControl resControl = new UserInfoControl();

            resControl.Dock = DockStyle.Fill;
            this.setPanelContent.Controls.Add(resControl);
        }
Example #4
0
        private void DisplayInfo(Conversation conversation)
        {
            var user = conversation.Participants.FirstOrDefault(u => u.Nickname != UserService.LoggedUser.Nickname);

            if (user == null)
            {
                return;
            }

            var userInfo = new UserInfoControl(user);

            userInfo.Called += OnUserCall;

            CurrentUserInfo = userInfo;
            UserInfoGrid.Children.Clear();
            UserInfoGrid.Children.Add(userInfo);
        }
        private void UpdatePlayData(UserAndFriendsApps playData)
        {
            var apps = new List <SteamApplistItemControl>(playData?.Apps?.Length ?? 0);

            //FriendPlay.Data = playData;
            FriendsList.Items.Clear();
            GamesList.Items.Clear();
            if (playData == null)
            {
                //FriendsList.Items.Add("Load up a userId above!");
                _apps = Enumerable.Empty <SteamApplistItemControl>();
            }
            else
            {
                FriendsList.Items.Add(new UserInfoControl()
                {
                    Data = new TryIdResponse <UserInfo>(true, playData.SteamUserId, playData.UserInfo)
                });
                foreach (var user in playData.Friends)
                {
                    if (user.Success)
                    {
                        var ui = new UserInfoControl()
                        {
                            Data = user
                        };
                        FriendsList.Items.Add(ui);
                    }
                }

                var dict = playData.Friends.Where(ui => ui.Success).ToDictionary(ui => ui.Id, ui => ui.Value);
                dict.Add(playData.SteamUserId, playData.UserInfo);

                foreach (var app in playData.Apps)
                {
                    var sali = new SteamApplistItemControl()
                    {
                        AppName = app.AppName,
                        Owners  = app.UserIds.Select(id => (dict.TryGetValue(id, out var ui), ui)).Where(t => t.Item1).Select(t => t.Item2).ToArray(),
                    };
                    apps.Add(sali);
                    GamesList.Items.Add(sali);
                }
                _apps = apps;
            }
        }
Example #6
0
        void ShowUserInfo(UserRecord user)
        {
            if (_AppSettings.AppMode.Equals("Service", StringComparison.InvariantCulture))
            {
                string addonMsg = MatchedResult != null?MatchedResult.Score.ToString() : "";

                ShowMessage(_AppSettings.Success_Message + ". Score=" + addonMsg);
            }
            else
            {
                ShowMessage(_AppSettings.Success_Message);
            }
            UserInfoControl userInfoControl = new UserInfoControl(StateController, user);

            userInfoControl.StateNotifyer   = _ApplicationStateChangeNotifyer;
            userInfoControl.MessageNotifyer = _ApplicationMessageNotifyer;

            AddControl(userInfoControl);
        }
Example #7
0
        XtraUserControl CreateUserControl(string text)
        {
            XtraUserControl result = new XtraUserControl();

            result.Name = text.ToLower() + "UserControl";
            result.Text = text;

            switch (text)
            {
            case AppSettings.PRODUCTION_PLAN:
                ProductionPlanControl productionPlanControl = new ProductionPlanControl();
                productionPlanControl.Parent = result;
                productionPlanControl.Dock   = DockStyle.Fill;
                break;

            case AppSettings.LABEL_PRODUCTION_INFO:
                LabelProductionInfoControl labelProductionInfoControl = new LabelProductionInfoControl();
                labelProductionInfoControl.Parent = result;
                labelProductionInfoControl.Dock   = DockStyle.Fill;
                break;

            case AppSettings.HISTORICAL_PRODUCTION:
                HistoricalProductionControl historicalProductionControl = new HistoricalProductionControl();
                historicalProductionControl.Parent = result;
                historicalProductionControl.Dock   = DockStyle.Fill;
                break;

            case AppSettings.USER_INFO:
                UserInfoControl userInfoControl = new UserInfoControl();
                userInfoControl.Parent = result;
                userInfoControl.Dock   = DockStyle.Fill;
                break;

            case AppSettings.STATION_INFO:
                StationInfoControl2 stationInfoControl = new StationInfoControl2();
                stationInfoControl.Parent = result;
                stationInfoControl.Dock   = DockStyle.Fill;
                break;
            }

            return(result);
        }
Example #8
0
 private void OnUserCall(UserInfoControl userInfoControl)
 {
     Call(userInfoControl.User);
 }