コード例 #1
0
ファイル: FormLogin.cs プロジェクト: Jackjet/BIP
        private void Login()
        {
            if (!_isLogining)
            {
                _isLogining = true;
                SysUser user = null;

                try
                {
                    SysUser loginUser = new SysUser();
                    loginUser.UserAccount  = txtAccount.Text.Trim();
                    loginUser.UserPassword = txtPassword.Text.Trim();
                    List <Object> list = this.FindList <Object>("com.ccf.bip.biz.system.user.service.UserService", "login", new object[] { loginUser });
                    user           = list[0] as SysUser;
                    Globals.Tocken = list[1].ToString();
                    //Thread.Sleep(3000);
                    LoginDelegate deg = new LoginDelegate(CompleteLogin);
                    this.Invoke(deg, user);
                }
                catch (Exception ex)
                {
                    ErrorDelegate errDeg = new ErrorDelegate(OnError);
                    this.Invoke(errDeg, ex.Message);
                }
            }
        }
コード例 #2
0
ファイル: StartView.cs プロジェクト: Molnia107/twitterBot
        public StartView(LoginDelegate loginDelegate, LogoutDelegate logoutDelegate)
        {
            _loginDelegate  = loginDelegate;
            _logoutDelegate = logoutDelegate;

            _welcomeLabel = new UILabel();
            _loginButton  = UIButton.FromType(UIButtonType.System);
            _logoutButton = UIButton.FromType(UIButtonType.System);

            _webView = new UIWebView();
            _webView.ShouldStartLoad += WebViewAuth_ShouldStartLoad;


            _welcomeLabel.Text = Strings.Welcome;
            _welcomeLabel.SizeToFit();
            _loginButton.SetTitle(Strings.Login, UIControlState.Normal);
            _loginButton.SizeToFit();
            _logoutButton.SetTitle(Strings.Logout, UIControlState.Normal);
            _logoutButton.SizeToFit();

            AddSubview(_welcomeLabel);
            AddSubview(_loginButton);
            AddSubview(_logoutButton);

            BackgroundColor = UIColor.White;
        }
コード例 #3
0
        private void LoginFinished(IAsyncResult ar)
        {
            AsyncResult   result = (AsyncResult)ar;
            LoginDelegate login  = (LoginDelegate)result.AsyncDelegate;
            string        error  = login.EndInvoke(ar);

            LoginCompleted?.Invoke(error);
        }
コード例 #4
0
        public void GetLoginData(string reg, string summName, bool loginTypeFlg)
        {
            // 実行するデリゲートを作成
            LoginDelegate sampleDelegate =
                new LoginDelegate(this.LoginDelegatingMethod);

            // コールバック関数
            AsyncCallback callback = new AsyncCallback(this.LoginCallBackMethod);

            // 非同期実行の呼び出し
            IAsyncResult ar =
                sampleDelegate.BeginInvoke(reg, summName, loginTypeFlg, callback, null);
        }
コード例 #5
0
        void LoginEnd(IAsyncResult result)
        {
            AsyncResult asyncResult = (AsyncResult)result;

            LoginDelegate login       = (LoginDelegate)asyncResult.AsyncDelegate;
            int           loginresult = login.EndInvoke(result);

            if (loginresult == 1)
            {
            }
            else
            {
            }
        }
コード例 #6
0
        // コールバック関数:スレッド終了後の処理を記述
        private void LoginCallBackMethod(IAsyncResult ar)
        {
            // AsyncResultに変換
            AsyncResult asyncResult = ar as AsyncResult;

            // 非同期の呼び出しが行われたデリゲート オブジェクトを取得
            LoginDelegate sampleDelegate =
                asyncResult.AsyncDelegate as LoginDelegate;

            Dispatcher.Invoke(() =>
            {
                // 処理結果取得
                LoginState LoginStateRet = sampleDelegate.EndInvoke(ar);

                this.DataContext = null;

                this.ControlStateReBack();

                ((LoginViewModel)this._loginView.DataContext).ErrorMsg = LoginStateRet.LoginErrorMessage;

                // Set property or change UI compomponents.
                if (!LoginStateRet.LoginErrorFlg)
                {
                    if (LoginStateRet.LoginTypeFlg)
                    {
                        this.LoginChildWindow.IsOpen = false;
                        if (!_viewModel.ShowCloseButtonFlg)
                        {
                            _viewModel.ShowCloseButtonFlg = true;
                        }
                    }

                    this.SummonerDView.DataContext = new SummonerDetailViewModel(_loginSummoner);
                }

                this.DataContext = _viewModel;
                this.MainTabControl.SelectedIndex    = 0;
                this.MainSubTabControl.SelectedIndex = 0;
            });
        }
コード例 #7
0
    public void SendLogin(object _data)
    {
        LoginDelegate loginDelegate = new LoginDelegate(this, _data as LoginVO);

        loginDelegate.LoginService();
    }
コード例 #8
0
        public void LoginAsync(string username, string password, bool saveToken = false)
        {
            LoginDelegate login = LoginSync;

            login.BeginInvoke(username, password, saveToken, LoginFinished, null);
        }
コード例 #9
0
ファイル: Adapter.cs プロジェクト: BabakShomali/Fragenkatalog
 public void RegistriereLoginHandler(LoginDelegate ld)
 {
     LoginHandler = ld;
 }
コード例 #10
0
 private MessageDispatcher()
 {
     loginDelegate += LoginController.Instance.OnMessageResponse;
 }
コード例 #11
0
        private void buttonPressionTest_Click(object sender, EventArgs e)
        {
            try
            {

                _isConCurrentTesting = true;
                textBoxRetCstmResult.Text = "";
                textBoxRespUpdtCstm.Text = "";
                int.TryParse(textBoxDataCount.Text.Trim(), out _dataCount);
                int testCount;
                if (_dataCount > 0)
                    testCount = _dataCount;
                else
                {
                    return;
                }
                Dictionary<Guid, MessageData> datalist = new Dictionary<Guid, MessageData>();
                StringBuilder retmsg = new StringBuilder();
                while (testCount > 0)
                {
                    //Random random = new Random();
                    //switch (random.Next(3))
                    //{
                    //    case 2:
                    //        KeyValuePair<Guid, MessageData> data2 = GetUpdateCstmData();
                    //        datalist.Add(data2.Key, data2.Value);
                    //        break;
                    //    default:
                    //    case 1:
                    //        KeyValuePair<Guid, MessageData> data1 = GetRetrieveCstmTestData();
                    //        datalist.Add(data1.Key, data1.Value);
                    //        break;
                    //}

                    //同步接口

                    LoginDelegate login = new LoginDelegate(OnLoginTest);
                    login.BeginInvoke(testCount, retmsg, null, null);
                    testCount--;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //_begin = DateTime.Now.Ticks;
            //foreach ( KeyValuePair<Guid, MessageData> data in datalist)
            //{
            //    DispatchMsg(data.Value);
            //}
         

        }
コード例 #12
0
ファイル: Login.cs プロジェクト: shafin1911/Foodies-Review
 public Login()
 {
     InitializeComponent();
     loginDel  = null;
     loginDel += loginCheck;
 }