Inheritance: System.EventArgs
コード例 #1
0
        void connector_Connected(object sender, ConnectionEventArgs e)
        {
            serverID = e.ID;

        }
コード例 #2
0
        void connector_ConnectionLost(object sender, ConnectionEventArgs e)
        {
            if (Ready2Timer != null)
            {
                Ready2Timer.Stop();
            }
            //View.ConnectionFailed();
            GameInProgress = false;
            shipSelected = false;

        }
コード例 #3
0
 void conn_ConnectionLost(object sender, ConnectionEventArgs e)
 {
     OnEvent(ConnectionLost, e);
 }
コード例 #4
0
 void conn_Connected(object sender, ConnectionEventArgs e)
 {
     OnEvent(Connected, e);
 }
コード例 #5
0
        protected virtual void OnEvent(EventHandler<ConnectionEventArgs> handler, ConnectionEventArgs e)
        {

            if (handler != null)
            {
                foreach (EventHandler<ConnectionEventArgs> singleCast in handler.GetInvocationList())
                {
                    ISynchronizeInvoke syncInvoke = singleCast.Target as ISynchronizeInvoke;
                    try
                    {
                        //This code is to make the raising of the event threadsafe with the UI thread.
                        if (syncInvoke != null && syncInvoke.InvokeRequired)
                        {
                            syncInvoke.BeginInvoke(singleCast, new object[] { this, e });
                        }
                        else
                        {
                            singleCast(this, e);
                        }
                    }
                    catch (Exception ex)
                    {
                        if (CrashOnException)
                        {
                            throw;
                        }
                        else
                        {
                            if (e != null)
                            {
                                RaiseExceptionEncountered(ex, e.ID);
                            }
                            else
                            {
                                RaiseExceptionEncountered(ex, Guid.Empty);
                            }
                        }
                    }
                }

            }
        }
コード例 #6
0
        void conn_Connected(object sender, ConnectionEventArgs e)
        {

            OnEvent(Connected, e);
        }
コード例 #7
0
        void conn_ConnectionLost(object sender, ConnectionEventArgs e)
        {

            OnEvent(ConnectionLost, e);
        }
コード例 #8
0
 void Processor_NewClientConnected(object sender, ConnectionEventArgs e)
 {
     if (sender == clientProcessor)
     {
         LastclientID = e.ID;
         StartServerConnection();
     }
     else
     {
         if (proxyType == ProxyType.OneServerConnectionToOneClientConnection)
         {
             ServersToClients.Add(e.ID, LastclientID);
             ClientsToServers.Add(LastclientID, e.ID);
             LastclientID = Guid.Empty;
         }
     }
 }
コード例 #9
0
 void ServerProcessor_Connected(object sender, ConnectionEventArgs e)
 {
     if (Connected != null)
     {
         Connected(this, e);
     }
 }