Пример #1
0
        private void btnConnectPAC_Click(object sender, EventArgs e)
        {
            var clientinfo = azureLogin.GetPACClientInfo();

            if (clientinfo != null)
            {
                pacclientinfo = clientinfo;
                scopeControl.SetUrlAndLanguage(pacclientinfo.ServiceUrl, pacclientinfo.Language);
            }
        }
Пример #2
0
        private PACClientInfo ConnectPAChecker()
        {
            var clientinfo = new PACClientInfo
            {
                ServiceUrl = GetServiceUrl(),
                Language   = GetLanguage()
            };

            if (!Guid.TryParse(txtClientId.Text, out clientinfo.ClientId))
            {
                pac.ShowError("Bad Client Guid");
                return(null);
            }
            if (cbRegion.SelectedItem == null)
            {
                pac.ShowError("Select Region");
                return(null);
            }
            try
            {
                if (rbSecret.Checked)
                {
                    if (!Guid.TryParse(txtTenantId.Text, out clientinfo.TenantId))
                    {
                        pac.ShowError("Bad Tenant Guid");
                        return(null);
                    }
                    clientinfo.ClientSec = txtClientSec.Text;
                }
                if (PACHelper.GetClient(clientinfo, PromptBehavior.SelectAccount) != null)
                {
                    pac.ai.WriteEvent($"Connect OK {cbRegion.Text}");
                }
            }
            catch (Exception ex)
            {
                pac.ShowError(ex, "Connect");
                return(null);
            }
            return(clientinfo);
        }