File provided for Reference Use Only By Microsoft Corporation (c) 2007

Seit ein paar Wochen, wenn ich mit Resharper zu der Implementierung von manchen Microsoft-Funktionen navigieren will, bekomme ich die ganze dll heruntergeladen und danach den ganzen Code zu sehen:

// ==++==
//   Copyright (c)  Microsoft Corporation.  All rights reserved.
// ==--==
namespace System.Globalization {
    using System.Security.Permissions; 
    using System.Runtime.Serialization; 
    using System.Text;
    using System; 
    //
    // Property             Default Description
    // PositiveSign           '+'   Character used to indicate positive values.
    // NegativeSign           '-'   Character used to indicate negative values. 
    // NumberDecimalSeparator '.'   The character used as the decimal separator.
    // NumberGroupSeparator   ','   The character used to separate groups of 
    //                              digits to the left of the decimal point. 
    // NumberDecimalDigits    2     The default number of decimal places.
    // NumberGroupSizes       3     The number of digits in each group to the 
    //                              left of the decimal point.
    // NaNSymbol             "NaN"  The string used to represent NaN values.
    // PositiveInfinitySymbol"Infinity" The string used to represent positive
    //                              infinities. 
    // NegativeInfinitySymbol"-Infinity" The string used to represent negative
    //                              infinities. 
    // Property                  Default  Description
    // CurrencyDecimalSeparator  '.'      The character used as the decimal
    //                                    separator.
    // CurrencyGroupSeparator    ','      The character used to separate groups 
    //                                    of digits to the left of the decimal
    //                                    point. 
    // CurrencyDecimalDigits     2        The default number of decimal places. 
    // CurrencyGroupSizes        3        The number of digits in each group to
    //                                    the left of the decimal point. 
    // CurrencyPositivePattern   0        The format of positive values.
    // CurrencyNegativePattern   0        The format of negative values.
    // CurrencySymbol            "$"      String used as local monetary symbol.
    // 

    [Serializable] 
    [System.Runtime.InteropServices.ComVisible(true)] 
    sealed public class NumberFormatInfo : ICloneable, IFormatProvider
    { 

        // invariantInfo is constant irrespective of your current culture.

        private static NumberFormatInfo invariantInfo;
...

Das ist wunderbar, es ist großartig zu sehen, wie die Klassen Random or DateTime aufgebaut sind. Obwohl ich keine Ahnung habe, warum das passiert… Ich hoffe allerdings, dass es kein Bug ist, und ich weiterhin den Code statt irgendeine Dokumentation sehen werde, auch wenn komischerweise am Ende der meisten Klassen der Titel dieses Artikels steht: File provided for Reference Use Only By Microsoft Corporation (c) 2007 😉

Das alles ist cool, aber noch nicht wirklich ein Grund für einen Blogeintrag. Den folgenden Kommentar wollte ich euch aber nicht vorenthalten:

        // READTHIS READTHIS READTHIS 

        // This class has an exact mapping onto a native structure defined in COMNumber.cpp

        // DO NOT UPDATE THIS WITHOUT UPDATING THAT STRUCTURE. IF YOU ADD BOOL, ADD THEM AT THE END. 

        // ALSO MAKE SURE TO UPDATE mscorlib.h in the VM directory to check field offsets. 

        // READTHIS READTHIS READTHIS

        internal int[]  numberGroupSizes = new int[] {3};
...
        internal bool m_useUserOverride=false;    // NEVER USED, DO NOT USE THIS! (Serialized in Everett)
...

😆