Exemplo n.º 1
0
        void AskForUserInfo(ISquiggleEndPoint user, UserInfoState state)
        {
            var reply = Message.FromSender <GiveUserInfoMessage>(thisUser);

            reply.State     = (int)state;
            reply.Recipient = new SquiggleEndPoint(user);
            channel.SendMessage(reply);
        }
Exemplo n.º 2
0
        private async void Login_Clicked(object sender, RoutedEventArgs e)
        {
            UserInfo.UserName = UserName.Text;
            UserInfo.Password = Password.Password;
            //登陆验证模块
            JObject logIn = await API.GetAPI().Login(UserInfo.UserName, UserInfo.Password);

            if ((bool)logIn["state"])
            {
                //登陆成功后
                UserInfo.IsLogged       = true;
                errorMessage.Text       = "";
                Login_Button.Visibility = Visibility.Collapsed;
                NavMenuPrimaryListView.IsItemClickEnabled = true;
                NavMenuBottomListView.IsItemClickEnabled  = true;
                UserInfo.IsLogged = true;
                UserInfoState.Hide();
                matchesVM.AllMatches.Clear();
                JObject Matches = new JObject();
                Matches = await API.GetAPI().queryAllMatchesAsync();

                if ((bool)Matches["state"])
                {
                    foreach (var match in Matches["pingpong"])
                    {
                        matchesVM.AllMatches.Add(new Matches("pingpong", match["title"].ToString(), match["date"].ToString(), match["matchType"].ToString(),
                                                             match["matchLastTime"].ToString(), match["place"].ToString(), match["placeContain"].ToString(), match["sectionPerDay"].ToString(), match["seed"].ToString()));
                    }

                    foreach (var match in Matches["badminton"])
                    {
                        matchesVM.AllMatches.Add(new Matches("badminton", match["title"].ToString(), match["date"].ToString(), match["matchType"].ToString(),
                                                             match["matchLastTime"].ToString(), match["place"].ToString(), match["placeContain"].ToString(), match["sectionPerDay"].ToString(), match["seed"].ToString()));
                    }

                    foreach (var match in Matches["tennis"])
                    {
                        matchesVM.AllMatches.Add(new Matches("tennis", match["title"].ToString(), match["date"].ToString(), match["matchType"].ToString(),
                                                             match["matchLastTime"].ToString(), match["place"].ToString(), match["placeContain"].ToString(), match["sectionPerDay"].ToString(), match["seed"].ToString()));
                    }

                    ContentFrame.Navigate(typeof(Home));
                    TileService.UpdateTileItem();
                }
                else
                {
                    //await new MessageDialog("").ShowAsync();
                }
            }
            else
            {
                //登陆失败后
                errorMessage.Text = (string)logIn["errormessage"];
            }
        }
Exemplo n.º 3
0
        private void TestUserInfoAssertion(int number, string guid, string message, UserInfoState state)
        {
            LoggedEvent evt = _logger.Events[number];

            Assert.AreEqual(ExecutionLoggerEventType.UserInfo, evt.Type);
            Assert.IsInstanceOf(typeof(UserInfoData), evt.Data);
            UserInfoData data = (UserInfoData)evt.Data;

            Assert.AreEqual(guid, data.Guid);
            Assert.AreEqual(message, data.Message);
            Assert.AreEqual(state, data.State);
        }
Exemplo n.º 4
0
 protected void ShowUserInfo(IExecutionContext context, UserInfoState state)
 {
     if ((UserInfo != null) && !String.IsNullOrEmpty(UserInfo.MessageText))
     {
         UserInfoData info = new UserInfoData
         {
             Message = UserInfo.MessageText,
             State   = state,
             Guid    = UserInfo.MessageGuid
         };
         context.Log.AddUserInfo(info);
     }
 }
Exemplo n.º 5
0
 private void Exit_Clicked(object sender, RoutedEventArgs e)
 {
     UserInfo.UserName       = "";
     UserInfo.Password       = "";
     UserInfo.IsLogged       = false;
     UserName.Text           = "";
     Password.Password       = "";
     Login_Button.Visibility = Visibility.Visible;
     UserInfoState.Hide();
     errorMessage.Text = "";
     ContentFrame.Navigate(typeof(Home));
     BattleVM.GetBattleVM().AllBattles.Clear();
     AthleteVM.GetAthleteVM().AllAthletes.Clear();
     MatchesVM.GetMatchesVM().AllMatches.Clear();
     ResultVM.GetResultVM().AllResults.Clear();
     NavMenuPrimaryListView.IsItemClickEnabled = false;
     NavMenuBottomListView.IsItemClickEnabled  = false;
     NavMenuMatchListView.Visibility           = Visibility.Collapsed;
     NavMenuMatchInfoListView.Visibility       = Visibility.Collapsed;
     API.GetAPI().SignOut();
 }
Exemplo n.º 6
0
 private void TestUserInfoAssertion(string guid, string message, UserInfoState state)
 {
     TestUserInfoAssertion(0, guid, message, state);
 }
Exemplo n.º 7
0
 private void TestUserInfoAssertion(int number, string guid, string message, UserInfoState state)
 {
     LoggedEvent evt = _logger.Events[number];
     Assert.AreEqual(ExecutionLoggerEventType.UserInfo, evt.Type);
     Assert.IsInstanceOf(typeof(UserInfoData), evt.Data);
     UserInfoData data = (UserInfoData)evt.Data;
     Assert.AreEqual(guid, data.Guid);
     Assert.AreEqual(message, data.Message);
     Assert.AreEqual(state, data.State);
 }
Exemplo n.º 8
0
 private void TestUserInfoAssertion(string guid, string message, UserInfoState state)
 {
     TestUserInfoAssertion(0, guid, message, state);
 }