private void StartNetworkMonitor() { NetworkModel.logger.Log(0, "Network throughput monitoring active"); this._networkStateMonitor = ServiceLocatorExtensions.ResolveType <INetworkStateMonitorFactory>(ObjectExtensions.GetServiceLocator(this), null).Create(TimeSpan.FromSeconds(2.0), string.Format("NetworkModel {0}", this.GetHashCode())); this._networkStateMonitor.add_MeasurementCollected(new EventHandler <NetworkSnapshotEventArgs>(this.NetworkStateMonitorOnMeasurementCollected)); this._networkStateMonitor.Start(); }
private void Dispose(bool doDispose) { if (doDispose) { GC.SuppressFinalize(this); this._networkStateMonitor.Stop(); NetworkModel.logger.Log(0, "Network throughput monitoring stopped"); this._networkStateMonitor.Dispose(); this._networkStateMonitor = null; NetworkModel.logger.Log(0, new TraceMessage(string.Empty, "C:\\BuildAgent\\work\\f239b39ee858ff87\\VyprVPNUI\\Models\\NetworkModel.cs", 171, "Dispose").ToString()); } }