Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        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;
                    }
                }
            }
        }
        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;
                    }                    
                }
            }
        }
        /// <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();
        }