Beispiel #1
0
        private void ConnectWebApi()
        {
            ClearStatusMessage();
            txtResponse.Clear();
            if (!ValidateInputValuesForConnectionTest())
            {
                return;
            }
            WebApiClient.WebApiSetting = GetWebApiSetting();

            var task = WebApiClient.ConnectAsnyc();

            ProgressDialog.Start(ParentForm, task, false, SessionKey);

            var response = task.Result;

            if (task.Exception != null)
            {
                NLogHandler.WriteErrorLog(this, task.Exception, SessionKey);
                ShowWarningDialog(MsgErrSomethingError, "テスト接続");
                return;
            }
            if (response == null)
            {
                ShowWarningDialog(MsgErrSomethingError, "テスト接続");
                return;
            }
            txtResponse.Text = response.ToString();
            DispStatusMessage(MsgInfSuccessTestConnection);
        }