System.Xml.XmlReader.HasValueInternal C# (CSharp) Method

HasValueInternal() static private method

static private HasValueInternal ( System.Xml.XmlNodeType nodeType ) : bool
nodeType System.Xml.XmlNodeType
return bool
        static internal bool HasValueInternal(XmlNodeType nodeType)
        {
#if DEBUG
            // This code verifies HasValueBitmap mapping of XmlNodeType to a bool specifying
            // whether the node can have a non-empty Value
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.None)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Element)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Attribute)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Text)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.CDATA)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EntityReference)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Entity)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Comment)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Document)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentType)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Notation)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Whitespace)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndElement)));
            Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndEntity)));
            Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
#endif
            return 0 != (s_hasValueBitmap & (1 << (int)nodeType));
        }