CompressionTracing.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Sys / System / IO / compression / CompressionTracing.cs / 1305376 / CompressionTracing.cs

                            namespace System.IO.Compression 
{
    using System.Diagnostics;

    internal enum CompressionTracingSwitchLevel { 
        Off = 0,
        Informational = 1, 
        Verbose = 2 
    }
 
    internal class CompressionTracingSwitch : Switch {
        internal static CompressionTracingSwitch tracingSwitch =
            new CompressionTracingSwitch("CompressionSwitch", "Compression Library Tracing Switch");
 
        internal CompressionTracingSwitch(string displayName, string description)
            : base(displayName, description) { 
        } 

        public static bool Verbose { 
            get {
                return tracingSwitch.SwitchSetting >= (int)CompressionTracingSwitchLevel.Verbose;
            }
        } 

        public static bool Informational { 
            get { 
                return tracingSwitch.SwitchSetting >= (int)CompressionTracingSwitchLevel.Informational;
            } 
        }

#if ENABLE_TRACING
        public void SetSwitchSetting(CompressionTracingSwitchLevel level) { 
            if (level < CompressionTracingSwitchLevel.Off || level > CompressionTracingSwitchLevel.Verbose) {
                throw new ArgumentOutOfRangeException("level"); 
            } 
            this.SwitchSetting = (int)level;
        } 
#endif

    }
} 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK