Exemplo n.º 1
0
        /// <summary>
        /// Handles the LoginFinished event of the CommerceCallback control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="LoginFinishedEventArgs"/> instance containing the event data.</param>
        private void CommerceCallback_LoginFinished(object sender, LoginFinishedEventArgs e)
        {
            var handler = this.LoginFinished;

            if (handler != null)
            {
                handler.Invoke(this, e);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the LoginFinished event of the Instance control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="LoginFinishedEventArgs"/> instance containing the event data.</param>
        private void Instance_LoginFinished(object sender, LoginFinishedEventArgs e)
        {
            if (e.Code == 0)
            {
                this.accountInfo     = e.Account;
                this.ButtonText.text = "Pay";
                this.StatusText.text = "Login success! \n    OpenId: " + e.Account.OpenId + "    NickName: "
                                       + e.Account.NickName + "\n    Avatar: " + e.Account.Avatar + "    Gender: " + e.Account.Gender;
            }
            else
            {
                this.ButtonText.text = "Login";
                this.StatusText.text = "Login failed! \n    ErrorCode: " + e.Code;
            }

            this.isLogining = false;
        }