Beispiel #1
0
        private void btnOpenSdkLoginCtrl_Click(object sender, EventArgs e)
        {
            var ctrl = new CRMLoginForm1(connectionDetailId, !isNew);

            if (rdbUseCustom.Checked)
            {
                ctrl.AppId       = txtAzureAdAppId.Text;
                ctrl.RedirectUri = new Uri(txtReplyUrl.Text);
            }
            else
            {
                ctrl.AppId       = "2ad88395-b77d-4561-9441-d0e40824f9bc";
                ctrl.RedirectUri = new Uri("app://5d3e90d6-aa8e-48a8-8f2c-58b45cc67315");
            }
            ctrl.ConnectionToCrmCompleted += (loginCtrl, evt) =>
            {
                ConnectionManager = ((CRMLoginForm1)loginCtrl).CrmConnectionMgr;
                SetAuthType();
                ConnectionSucceeded?.Invoke(this, null);
            };
            ctrl.ShowDialog();
        }
Beispiel #2
0
        public void Connect(IPEndPoint ipEndPoint)
        {
            _tcpClient = new TcpClient();
            _tcpClient.ReceiveBufferSize = 256 * 256 * 32; /* omg */
            try
            {
                _tcpClient.Connect(ipEndPoint);
                ConnectionSucceeded?.Invoke(this, new ConnectionSucceededEventArgs());
            }
            catch (Exception e)
            {
                ConnectionFailed?.Invoke(this, new ConnectionFailedEventArgs(e));
                _tcpClient = null;
            }

            if (_tcpClient != null)
            {
                _manualRefusal = false;
                _thread        = new Thread(Run);
                _thread.Start();
            }
        }
Beispiel #3
0
 private void InvokeConnectionSucceeded(object sender, ConnectionSucceededEventArgs e)
 {
     ConnectionSucceeded?.Invoke(sender, e);
 }
 private void OnConnectionSucceeded(Uri server)
 {
     ConnectionSucceeded?.Invoke(this, new ConnectionSucceededEventArgs(server));
 }