mda.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / mda.cs / 1 / mda.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 

using System.Runtime.CompilerServices; 
 
namespace System
{ 
#if MDA_SUPPORTED
    internal static class Mda
    {
        private enum MdaState { 
            Unknown = 0,
            Enabled = 1, 
            Disabled = 2 
        }
 
        private static MdaState _streamWriterMDAState = MdaState.Unknown;

        internal static bool StreamWriterBufferMDAEnabled {
            get { 
                if (_streamWriterMDAState == 0) {
                    if (IsStreamWriterBufferedDataLostEnabled()) 
                        _streamWriterMDAState = MdaState.Enabled; 
                    else
                        _streamWriterMDAState = MdaState.Disabled; 
                }

                return _streamWriterMDAState == MdaState.Enabled;
            } 
        }
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void MemberInfoCacheCreation();
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)]
        internal static extern void DateTimeInvalidLocalFormat();

        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void StreamWriterBufferedDataLost(String text);
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern bool IsStreamWriterBufferedDataLostEnabled();
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)]
        internal static extern bool IsInvalidGCHandleCookieProbeEnabled();

        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void FireInvalidGCHandleCookieProbe(IntPtr cookie);
    } 
#endif 
}

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

using System.Runtime.CompilerServices; 
 
namespace System
{ 
#if MDA_SUPPORTED
    internal static class Mda
    {
        private enum MdaState { 
            Unknown = 0,
            Enabled = 1, 
            Disabled = 2 
        }
 
        private static MdaState _streamWriterMDAState = MdaState.Unknown;

        internal static bool StreamWriterBufferMDAEnabled {
            get { 
                if (_streamWriterMDAState == 0) {
                    if (IsStreamWriterBufferedDataLostEnabled()) 
                        _streamWriterMDAState = MdaState.Enabled; 
                    else
                        _streamWriterMDAState = MdaState.Disabled; 
                }

                return _streamWriterMDAState == MdaState.Enabled;
            } 
        }
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void MemberInfoCacheCreation();
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)]
        internal static extern void DateTimeInvalidLocalFormat();

        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void StreamWriterBufferedDataLost(String text);
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern bool IsStreamWriterBufferedDataLostEnabled();
 
        [MethodImplAttribute(MethodImplOptions.InternalCall)]
        internal static extern bool IsInvalidGCHandleCookieProbeEnabled();

        [MethodImplAttribute(MethodImplOptions.InternalCall)] 
        internal static extern void FireInvalidGCHandleCookieProbe(IntPtr cookie);
    } 
#endif 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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