Example #1
0
        public NetInfo()
        {
            _backgroundWorker = new BackgroundWorker();
            _backgroundWorker.RunWorkerCompleted += backgroundWorker_RunWorkerCompleted;

            Statistics = new NetStatistics(this);
            NetLog.Init(this);
        }
Example #2
0
        private static void NetInfo_Connected(object sender, EventArgs e)
        {
            if (_lastDisconnect != null && DateTime.Now.Subtract(_lastDisconnect.LogTime) < RECONNECT_MAX_TIME)
            {
                _lastDisconnect.Update(string.Format(MSG_RECONNECTED,
                                                     Math.Round(DateTime.Now.Subtract(_lastDisconnect.LogTime).TotalSeconds)));
            }
            else
            {
                Add(MSG_CONNECTED);
            }

            _lastDisconnect = null;
        }
Example #3
0
 private static void NetInfo_Disconnected(object sender, EventArgs e)
 {
     _lastDisconnect = new NetLog(MSG_DISCONNECTED);
     Add(_lastDisconnect);
 }
Example #4
0
 public static void Clear()
 {
     LogList.Clear();
     _lastDisconnect = null;
     LogChanged?.Invoke(null, EventArgs.Empty);
 }
Example #5
0
 private static void Add(NetLog netLog)
 {
     LogList.Add(netLog);
     LogAdded?.Invoke(netLog, EventArgs.Empty);
 }