예제 #1
0
        public void createUser()
        {
            if (isValid())
            {
                _userData.userName = _userName;
                _userData.password = _password;

                object   obj = _socketHandler.createUser(new PrivateProfile(_userName, _firstName, _lastName, _password, selectedAvatarName));
                Feedback fb  = JsonConvert.DeserializeObject <Feedback>(obj.ToString());

                if (fb.status)
                {
                    _events.PublishOnUIThread(new appSuccessEvent(fb.log_message));
                    _events.PublishOnUIThread(new goBackEvent());
                }
                else
                {
                    _events.PublishOnUIThread(new appWarningEvent(fb.log_message));
                    //print error
                }
            }
            else
            {
                // print donnes invalides
                _events.PublishOnUIThread(new appWarningEvent("Please make sure no fields are empty and that your passwords match"));
            }
        }