Exemple #1
0
        public override void Execute(object parameter)
        {
            if (parameter == null)
            {
                return;
            }

            var para = (QuickConnectEventArgs)parameter;

            if (string.IsNullOrEmpty(para.Text) || para.Key == null)
            {
                return;
            }

            //Was the return-Key pressed?
            if (para.Key == Key.Enter)
            {
                //Create and get new QuickConnect-Connection
                var qcItem = QuickConnect.DoQuickConnect(para.Text, (para.SelectedProtocol == null ? "" : para.SelectedProtocol.GetProtocolIdentifer()));

                //Open connection
                var evArgs = new ConnectEventArgs();
                evArgs.ConnectionItem = qcItem;
                OnConnectEvent(evArgs);

                //Refresh ConnectionTreeView
                var evArgs2 = new ReloadConnectionListEventArgs();
                evArgs2.AddedConnection = qcItem;
                OnReloadConnectionList(evArgs2);
            }
        }
Exemple #2
0
        public static Task <Client> FacebookOAuthConnectAsync(this QuickConnect quickConnect, string gameId, string accessToken, string partnerId, string[] playerInsightSegments)
        {
            var tcs = new TaskCompletionSource <Client>();

            quickConnect.FacebookOAuthConnect(gameId, accessToken, partnerId, playerInsightSegments, tcs.SetResult, tcs.SetException);
            return(tcs.Task);
        }
Exemple #3
0
        public static Task <Client> KongregateConnectAsync(this QuickConnect quickConnect, string gameId, string userId, string gameAuthToken, string[] playerInsightSegments)
        {
            var tcs = new TaskCompletionSource <Client>();

            quickConnect.KongregateConnect(gameId, userId, gameAuthToken, playerInsightSegments, tcs.SetResult, tcs.SetException);
            return(tcs.Task);
        }
Exemple #4
0
        public static Task <Client> SimpleConnectAsync(this QuickConnect quickConnect, string gameId, string usernameOrEmail, string password, string[] playerInsightSegments)
        {
            var tcs = new TaskCompletionSource <Client>();

            quickConnect.SimpleConnect(gameId, usernameOrEmail, password, playerInsightSegments, tcs.SetResult, tcs.SetException);
            return(tcs.Task);
        }
 private void ShowQuickConnect()
 {
     using (var qc = new QuickConnect(this.persistence))
     {
         if (qc.ShowDialog(this) == DialogResult.OK && !string.IsNullOrEmpty(qc.ConnectionName))
             this.connectionsUiFactory.ConnectByFavoriteNames(new List<string>(){ qc.ConnectionName} );
     }
 }