/// <summary> /// Disallow creation of instances beyond the one instance for the process. /// The one instance is accessible via GetLoggingScenarioSingleton() (see below). /// </summary> private LoggingScenario() { LogFileGeneratedCount = 0; channel = new Windows.Foundation.Diagnostics.LoggingChannel(DEFAULT_CHANNEL_NAME); channel.LoggingEnabled += OnChannelLoggingEnabled; SDKTemplate.App.Current.Suspending += OnAppSuspending; SDKTemplate.App.Current.Resuming += OnAppResuming; // If the app is being launched (not resumed), the // following call will activate logging if it had been // activated during the last suspend. ResumeLoggingIfApplicable(); }
protected virtual void Dispose(bool disposing) { if (isDisposed == false) { isDisposed = true; if (disposing) { if (channel != null) { channel.Dispose(); channel = null; } if (session != null) { session.Dispose(); session = null; } } } }