Example #1
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;

                if (disposing)
                {
                    if (_localCounter != null)
                    {
                        _localCounter.Dispose();
                        _localCounter = null;
                    }

                    if (_remoteCounter != null)
                    {
                        _remoteCounter.Dispose();
                        _remoteCounter = null;
                    }
                }

                base.Dispose(disposing);
            }
        }
Example #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="localID">本地编号</param>
 /// <param name="localCycle">EC周期</param>
 public EcDefenseStrategy(uint localID, uint localCycle)
 {
     _localCounter = new EcCounter(localID, localCycle, 0);
 }
Example #3
0
 public void StartRemoteCounter(uint remoteID, uint interval, uint initialValue)
 {
     _remoteCounter = new EcCounter(remoteID, interval, initialValue);
 }