예제 #1
0
 public bool EffectStressTestTriggered(string[] args)
 {
     try
     {
         if (args.Length == 3)
         {
             string effectName  = args[1];
             int    effectCount = int.Parse(args[2]);
             SysPost.InvokeMulticast(this, RunEffectStressTest, new UsEffectStressTestEventArgs(effectName, effectCount));
         }
         else
         {
             int           effectCount    = int.Parse(args[args.Length - 1]);
             List <string> effectNameList = new List <string>(args);
             effectNameList.RemoveAt(0);
             effectNameList.RemoveAt(effectNameList.Count - 1);
             string effectName = string.Join(" ", effectNameList.ToArray());
             SysPost.InvokeMulticast(this, RunEffectStressTest, new UsEffectStressTestEventArgs(effectName, effectCount));
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
         throw;
     }
     return(true);
 }
예제 #2
0
    private void OnDisconnected(object sender, EventArgs e)
    {
        _tickTimer.Stop();
        _guardTimer.Deactivate();

        SysPost.InvokeMulticast(this, LogicallyDisconnected);
    }
예제 #3
0
 private bool Handle_HandshakeResponse(eNetCmd cmd, UsCmd c)
 {
     NetUtil.Log("eNetCmd.SV_HandshakeResponse received, connection validated.", (object[])Array.Empty <object>());
     SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.LogicallyConnected);
     this._guardTimer.Deactivate();
     return(true);
 }
예제 #4
0
 public static void InvokeMulticast(object sender, MulticastDelegate md)
 {
     if ((object)md == null)
     {
         return;
     }
     SysPost.InvokeMulticast(sender, md, (EventArgs)null);
 }
예제 #5
0
    private bool Handle_HandshakeResponse(eNetCmd cmd, UsCmd c)
    {
        NetUtil.Log("eNetCmd.SV_HandshakeResponse received, connection validated.");

        SysPost.InvokeMulticast(this, LogicallyConnected);

        _guardTimer.Deactivate();
        return(true);
    }
예제 #6
0
 public void Disconnect()
 {
     if (this._tcpClient == null)
     {
         return;
     }
     this._tcpClient.Close();
     this._tcpClient = (TcpClient)null;
     this._host      = string.Empty;
     this._port      = 0;
     NetUtil.Log("connection closed.", (object[])Array.Empty <object>());
     SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.Disconnected);
 }
예제 #7
0
        public void Disconnect()
        {
            if (_tcpClient != null)
            {
                _tcpClient.Close();
                _tcpClient = null;

                _host = "";
                _port = 0;

                UsLogging.Printf("connection closed.");
                SysPost.InvokeMulticast(this, Disconnected);
            }
        }
예제 #8
0
    private void OnConnect(IAsyncResult asyncResult)
    {
        TcpClient asyncState = (TcpClient)asyncResult.AsyncState;

        try
        {
            if (!asyncState.Connected)
            {
                throw new Exception();
            }
            NetUtil.Log("connected successfully.", (object[])Array.Empty <object>());
            SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.Connected);
        }
        catch (Exception ex)
        {
            this.DisconnectOnError("connection failed while handling OnConnect().", ex);
        }
    }
예제 #9
0
 public bool QueryEffectListTriggered(string[] args)
 {
     try
     {
         if (args.Length != 1)
         {
             Log.Error((object)"Command 'get_effect_list' parameter count mismatched. ({0} expected, {1} got)", (object)1, (object)args.Length);
             return(false);
         }
         SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.QueryEffectList);
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
         throw;
     }
     return(true);
 }
예제 #10
0
 public bool StartAnalysePixelsTriggered(string[] args)
 {
     try
     {
         bool b = false;
         if (args.Length == 2 && args[1] == "refresh")
         {
             b = true;
         }
         SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.StartAnalyzePixel, (EventArgs) new UsvConsoleCmds.AnalysePixelsArgs(b));
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
         throw;
     }
     return(true);
 }
예제 #11
0
        private void Tile_Clicked(object sender, EventArgs e)
        {
            MetroTileItem ti = sender as MetroTileItem;

            if (ti == null)
            {
                return;
            }

            ti.Checked = true;
            if (m_selectedTile != null)
            {
                m_selectedTile.Checked = false;
            }

            m_selectedTile  = ti;
            m_selectedAsset = SysUtil.GetRelativePath((string)ti.Tag, m_assetRoot);
            SysPost.InvokeMulticast(this, AssetSelected);
        }
예제 #12
0
        // Called when a connection to a server is established
        private void OnConnect(IAsyncResult asyncResult)
        {
            // Retrieving TcpClient from IAsyncResult
            TcpClient tcpClient = (TcpClient)asyncResult.AsyncState;

            try
            {
                if (tcpClient.Connected) // may throw NullReference
                {
                    UsLogging.Printf("connected successfully.");
                    SysPost.InvokeMulticast(this, Connected);
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                DisconnectOnError("connection failed while handling OnConnect().", ex);
            }
        }
예제 #13
0
    public bool StartAnalysePixelsTriggered(string[] args)
    {
        try
        {
            bool bRefresh = false;
            if (args.Length == 2)
            {
                string args2 = args[1];
                if (args2 == "refresh")
                {
                    bRefresh = true;
                }
            }

            SysPost.InvokeMulticast(this, StartAnalyzePixel, new AnalysePixelsArgs(bRefresh));
        }
        catch (Exception ex)
        {
            Log.Exception(ex);
            throw;
        }

        return(true);
    }
예제 #14
0
 public bool EffectStressTestTriggered(string[] args)
 {
     try
     {
         if (args.Length == 3)
         {
             SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.RunEffectStressTest, (EventArgs) new UsvConsoleCmds.UsEffectStressTestEventArgs(args[1], int.Parse(args[2])));
         }
         else
         {
             int           effectCount = int.Parse(args[args.Length - 1]);
             List <string> stringList  = new List <string>((IEnumerable <string>)args);
             stringList.RemoveAt(0);
             stringList.RemoveAt(stringList.Count - 1);
             SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.RunEffectStressTest, (EventArgs) new UsvConsoleCmds.UsEffectStressTestEventArgs(string.Join(" ", stringList.ToArray()), effectCount));
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
         throw;
     }
     return(true);
 }
예제 #15
0
 private void OnDisconnected(object sender, EventArgs e)
 {
     this._tickTimer.Stop();
     this._guardTimer.Deactivate();
     SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.LogicallyDisconnected);
 }
예제 #16
0
 public void PostMessage_FlyToObject(int instID)
 {
     SysPost.InvokeMulticast(this, OnFlyToObject, new UsFlyToObjectEventArgs(instID));
 }
예제 #17
0
 private void OnTimeout(object sender, ElapsedEventArgs e)
 {
     SysPost.InvokeMulticast((object)this, (MulticastDelegate)this.Timeout);
 }
예제 #18
0
 void OnTimeout(object sender, System.Timers.ElapsedEventArgs e)
 {
     SysPost.InvokeMulticast(this, Timeout);
 }