コード例 #1
0
        private static void Connection_ConnectionResult(object sender, ConnectionResultEventArgs e)
        {
            if (!(sender is IXenConnection conn))
            {
                return;
            }

            Form ownerForm = Program.MainWindow;

            if (connectionDialogs.TryGetValue(conn, out var dlg))
            {
                var form = dlg.GetOwnerForm();
                if (form != null)
                {
                    ownerForm = form;
                }

                dlg.CloseConnectingDialog();
            }

            if (e.Connected || e.Error == null)
            {
                return;
            }

            Program.Invoke(Program.MainWindow, () => ShowConnectingDialogError(ownerForm, conn, e.Error));
        }
コード例 #2
0
        internal static void Connection_ConnectionResult(object sender, ConnectionResultEventArgs e)
        {
            // Show connection error
            if (e.Connected || e.Error == null)
            {
                return;
            }

            IXenConnection connection = (IXenConnection)sender;

            Program.Invoke(Program.MainWindow,
                           delegate()
            {
                ShowConnectingDialogError_(Program.MainWindow, connection, e.Error);
            });
        }