示例#1
0
        public LoginViewModel(ILoginView view, IComponentContext container, SteamAuthentication steamAuthentication)
            : base(view, container)
        {
            this.steamAuthentication = steamAuthentication;
            this.steamAuthentication.TwoFactorCodeRequired.Subscribe(OnTwoFactorCodeRequired);
            this.steamAuthentication.ExceptionThrown.Subscribe(OnExceptionThrown);

            this.LoginCommand = new AsyncCommand(OnLoginCommand, CommandExecutionPolicies.OneAtATime);
        }
示例#2
0
        public void TestMethod1()
        {
            var auth = new SteamAuthentication();

            const string login         = "";
            const string password      = "";
            const string twoFactorCode = "";

            void OnR(object sender, EventArgs args)
            {
                auth.Authenticate(login, password, twoFactorCode);
            }

            auth.TwoFactorCodeRequired.Subscribe(OnR);

            auth.Authenticate(login, password, "");
        }