Globals.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / Globals.cs / 4 / Globals.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Runtime.Serialization
{ 
    using System;
    //using System.ServiceModel.Channels; 
    using System.ComponentModel; 
    using System.Xml;
    using System.Xml.Schema; 
    using System.Xml.Serialization;
    using System.Reflection;
    using System.Collections;
    using System.Collections.Generic; 
    using System.Security;
    using System.Security.Permissions; 
 
    /// 
    /// Critical - Class holds static instances used in serializer. 
    ///            Static fields are marked SecurityCritical or readonly to prevent
    ///            data from being modified or leaked to other components in appdomain.
    /// Safe - All get-only properties marked safe since they only need to be protected for write.
    ///  
    internal static class Globals
    { 
        ///  
        /// Review - changes to const could affect code generation logic; any changes should be reviewed.
        ///  
        [SecurityRequiresReview]
        internal const BindingFlags ScanAllMembers = BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;

        [SecurityCritical] 
        static XmlQualifiedName idQualifiedName;
        internal static XmlQualifiedName IdQualifiedName 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (idQualifiedName == null)
                    idQualifiedName = new XmlQualifiedName(Globals.IdLocalName, Globals.SerializationNamespace);
                return idQualifiedName; 
            }
        } 
 
        [SecurityCritical]
        static XmlQualifiedName refQualifiedName; 
        internal static XmlQualifiedName RefQualifiedName
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (refQualifiedName == null) 
                    refQualifiedName = new XmlQualifiedName(Globals.RefLocalName, Globals.SerializationNamespace); 
                return refQualifiedName;
            } 
        }

        [SecurityCritical]
        static Type typeOfObject; 
        internal static Type TypeOfObject
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfObject == null)
                    typeOfObject = typeof(object);
                return typeOfObject;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfValueType;
        internal static Type TypeOfValueType 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfValueType == null)
                    typeOfValueType = typeof(ValueType); 
                return typeOfValueType; 
            }
        } 

        [SecurityCritical]
        static Type typeOfArray;
        internal static Type TypeOfArray 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfArray == null) 
                    typeOfArray = typeof(Array);
                return typeOfArray;
            }
        } 

        [SecurityCritical] 
        static Type typeOfString; 
        internal static Type TypeOfString
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfString == null) 
                    typeOfString = typeof(string);
                return typeOfString; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfInt;
        internal static Type TypeOfInt
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfInt == null)
                    typeOfInt = typeof(int); 
                return typeOfInt;
            }
        }
 
        [SecurityCritical]
        static Type typeOfULong; 
        internal static Type TypeOfULong 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfULong == null)
                    typeOfULong = typeof(ulong); 
                return typeOfULong;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfVoid;
        internal static Type TypeOfVoid
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfVoid == null) 
                    typeOfVoid = typeof(void);
                return typeOfVoid; 
            }
        }

        [SecurityCritical] 
        static Type typeOfByteArray;
        internal static Type TypeOfByteArray 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfByteArray == null)
                    typeOfByteArray = typeof(byte[]);
                return typeOfByteArray; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfTimeSpan; 
        internal static Type TypeOfTimeSpan
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfTimeSpan == null) 
                    typeOfTimeSpan = typeof(TimeSpan); 
                return typeOfTimeSpan;
            } 
        }

        [SecurityCritical]
        static Type typeOfGuid; 
        internal static Type TypeOfGuid
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfGuid == null)
                    typeOfGuid = typeof(Guid);
                return typeOfGuid;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfDateTimeOffset;
        internal static Type TypeOfDateTimeOffset 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfDateTimeOffset == null)
                    typeOfDateTimeOffset = typeof(DateTimeOffset); 
                return typeOfDateTimeOffset; 
            }
        } 

        [SecurityCritical]
        static Type typeOfDateTimeOffsetAdapter;
        internal static Type TypeOfDateTimeOffsetAdapter 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfDateTimeOffsetAdapter == null) 
                    typeOfDateTimeOffsetAdapter = typeof(DateTimeOffsetAdapter);
                return typeOfDateTimeOffsetAdapter;
            }
        } 

        [SecurityCritical] 
        static Type typeOfUri; 
        internal static Type TypeOfUri
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfUri == null) 
                    typeOfUri = typeof(Uri);
                return typeOfUri; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfTypeEnumerable;
        internal static Type TypeOfTypeEnumerable
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfTypeEnumerable == null)
                    typeOfTypeEnumerable = typeof(IEnumerable); 
                return typeOfTypeEnumerable;
            }
        }
 
        [SecurityCritical]
        static Type typeOfStreamingContext; 
        internal static Type TypeOfStreamingContext 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfStreamingContext == null)
                    typeOfStreamingContext = typeof(StreamingContext); 
                return typeOfStreamingContext;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfISerializable;
        internal static Type TypeOfISerializable
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfISerializable == null) 
                    typeOfISerializable = typeof(ISerializable);
                return typeOfISerializable; 
            }
        }

        [SecurityCritical] 
        static Type typeOfIDeserializationCallback;
        internal static Type TypeOfIDeserializationCallback 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfIDeserializationCallback == null)
                    typeOfIDeserializationCallback = typeof(IDeserializationCallback);
                return typeOfIDeserializationCallback; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfIObjectReference; 
        internal static Type TypeOfIObjectReference
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfIObjectReference == null) 
                    typeOfIObjectReference = typeof(IObjectReference); 
                return typeOfIObjectReference;
            } 
        }

        [SecurityCritical]
        static Type typeOfXmlFormatClassWriterDelegate; 
        internal static Type TypeOfXmlFormatClassWriterDelegate
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfXmlFormatClassWriterDelegate == null)
                    typeOfXmlFormatClassWriterDelegate = typeof(XmlFormatClassWriterDelegate);
                return typeOfXmlFormatClassWriterDelegate;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfXmlFormatCollectionWriterDelegate;
        internal static Type TypeOfXmlFormatCollectionWriterDelegate 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfXmlFormatCollectionWriterDelegate == null)
                    typeOfXmlFormatCollectionWriterDelegate = typeof(XmlFormatCollectionWriterDelegate); 
                return typeOfXmlFormatCollectionWriterDelegate; 
            }
        } 

        [SecurityCritical]
        static Type typeOfXmlFormatClassReaderDelegate;
        internal static Type TypeOfXmlFormatClassReaderDelegate 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfXmlFormatClassReaderDelegate == null) 
                    typeOfXmlFormatClassReaderDelegate = typeof(XmlFormatClassReaderDelegate);
                return typeOfXmlFormatClassReaderDelegate;
            }
        } 

        [SecurityCritical] 
        static Type typeOfXmlFormatCollectionReaderDelegate; 
        internal static Type TypeOfXmlFormatCollectionReaderDelegate
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfXmlFormatCollectionReaderDelegate == null) 
                    typeOfXmlFormatCollectionReaderDelegate = typeof(XmlFormatCollectionReaderDelegate);
                return typeOfXmlFormatCollectionReaderDelegate; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfXmlFormatGetOnlyCollectionReaderDelegate;
        internal static Type TypeOfXmlFormatGetOnlyCollectionReaderDelegate
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfXmlFormatGetOnlyCollectionReaderDelegate == null)
                    typeOfXmlFormatGetOnlyCollectionReaderDelegate = typeof(XmlFormatGetOnlyCollectionReaderDelegate); 
                return typeOfXmlFormatGetOnlyCollectionReaderDelegate;
            }
        }
 
        [SecurityCritical]
        static Type typeOfKnownTypeAttribute; 
        internal static Type TypeOfKnownTypeAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfKnownTypeAttribute == null)
                    typeOfKnownTypeAttribute = typeof(KnownTypeAttribute); 
                return typeOfKnownTypeAttribute;
            } 
        } 

        ///  
        /// Critical - attrbute type used in security decision
        /// 
        [SecurityCritical]
        static Type typeOfDataContractAttribute; 
        internal static Type TypeOfDataContractAttribute
        { 
            ///  
            /// Critical - accesses critical field for attribute type
            /// Safe - controls inputs and logic 
            /// 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfDataContractAttribute == null)
                    typeOfDataContractAttribute = typeof(DataContractAttribute); 
                return typeOfDataContractAttribute; 
            }
        } 

        [SecurityCritical]
        static Type typeOfContractNamespaceAttribute;
        internal static Type TypeOfContractNamespaceAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfContractNamespaceAttribute == null) 
                    typeOfContractNamespaceAttribute = typeof(ContractNamespaceAttribute);
                return typeOfContractNamespaceAttribute;
            }
        } 

        [SecurityCritical] 
        static Type typeOfDataMemberAttribute; 
        internal static Type TypeOfDataMemberAttribute
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfDataMemberAttribute == null) 
                    typeOfDataMemberAttribute = typeof(DataMemberAttribute);
                return typeOfDataMemberAttribute; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfEnumMemberAttribute;
        internal static Type TypeOfEnumMemberAttribute
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfEnumMemberAttribute == null)
                    typeOfEnumMemberAttribute = typeof(EnumMemberAttribute); 
                return typeOfEnumMemberAttribute;
            }
        }
 
        [SecurityCritical]
        static Type typeOfCollectionDataContractAttribute; 
        internal static Type TypeOfCollectionDataContractAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfCollectionDataContractAttribute == null)
                    typeOfCollectionDataContractAttribute = typeof(CollectionDataContractAttribute); 
                return typeOfCollectionDataContractAttribute;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfOptionalFieldAttribute;
        internal static Type TypeOfOptionalFieldAttribute
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfOptionalFieldAttribute == null) 
                    typeOfOptionalFieldAttribute = typeof(OptionalFieldAttribute);
                return typeOfOptionalFieldAttribute; 
            }
        }

        [SecurityCritical] 
        static Type typeOfObjectArray;
        internal static Type TypeOfObjectArray 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfObjectArray == null)
                    typeOfObjectArray = typeof(object[]);
                return typeOfObjectArray; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfOnSerializingAttribute; 
        internal static Type TypeOfOnSerializingAttribute
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfOnSerializingAttribute == null) 
                    typeOfOnSerializingAttribute = typeof(OnSerializingAttribute); 
                return typeOfOnSerializingAttribute;
            } 
        }

        [SecurityCritical]
        static Type typeOfOnSerializedAttribute; 
        internal static Type TypeOfOnSerializedAttribute
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfOnSerializedAttribute == null)
                    typeOfOnSerializedAttribute = typeof(OnSerializedAttribute);
                return typeOfOnSerializedAttribute;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfOnDeserializingAttribute;
        internal static Type TypeOfOnDeserializingAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfOnDeserializingAttribute == null)
                    typeOfOnDeserializingAttribute = typeof(OnDeserializingAttribute); 
                return typeOfOnDeserializingAttribute; 
            }
        } 

        [SecurityCritical]
        static Type typeOfOnDeserializedAttribute;
        internal static Type TypeOfOnDeserializedAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfOnDeserializedAttribute == null) 
                    typeOfOnDeserializedAttribute = typeof(OnDeserializedAttribute);
                return typeOfOnDeserializedAttribute;
            }
        } 

        [SecurityCritical] 
        static Type typeOfFlagsAttribute; 
        internal static Type TypeOfFlagsAttribute
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfFlagsAttribute == null) 
                    typeOfFlagsAttribute = typeof(FlagsAttribute);
                return typeOfFlagsAttribute; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfSerializableAttribute;
        internal static Type TypeOfSerializableAttribute
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfSerializableAttribute == null)
                    typeOfSerializableAttribute = typeof(SerializableAttribute); 
                return typeOfSerializableAttribute;
            }
        }
 
        [SecurityCritical]
        static Type typeOfNonSerializedAttribute; 
        internal static Type TypeOfNonSerializedAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfNonSerializedAttribute == null)
                    typeOfNonSerializedAttribute = typeof(NonSerializedAttribute); 
                return typeOfNonSerializedAttribute;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfSerializationInfo;
        internal static Type TypeOfSerializationInfo
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfSerializationInfo == null) 
                    typeOfSerializationInfo = typeof(SerializationInfo);
                return typeOfSerializationInfo; 
            }
        }

        [SecurityCritical] 
        static Type typeOfSerializationInfoEnumerator;
        internal static Type TypeOfSerializationInfoEnumerator 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfSerializationInfoEnumerator == null)
                    typeOfSerializationInfoEnumerator = typeof(SerializationInfoEnumerator);
                return typeOfSerializationInfoEnumerator; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfSerializationEntry; 
        internal static Type TypeOfSerializationEntry
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfSerializationEntry == null) 
                    typeOfSerializationEntry = typeof(SerializationEntry); 
                return typeOfSerializationEntry;
            } 
        }

        [SecurityCritical]
        static Type typeOfIXmlSerializable; 
        internal static Type TypeOfIXmlSerializable
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfIXmlSerializable == null)
                    typeOfIXmlSerializable = typeof(IXmlSerializable);
                return typeOfIXmlSerializable;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfXmlSchemaProviderAttribute;
        internal static Type TypeOfXmlSchemaProviderAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfXmlSchemaProviderAttribute == null)
                    typeOfXmlSchemaProviderAttribute = typeof(XmlSchemaProviderAttribute); 
                return typeOfXmlSchemaProviderAttribute; 
            }
        } 

        [SecurityCritical]
        static Type typeOfXmlRootAttribute;
        internal static Type TypeOfXmlRootAttribute 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfXmlRootAttribute == null) 
                    typeOfXmlRootAttribute = typeof(XmlRootAttribute);
                return typeOfXmlRootAttribute;
            }
        } 

        [SecurityCritical] 
        static Type typeOfXmlQualifiedName; 
        internal static Type TypeOfXmlQualifiedName
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfXmlQualifiedName == null) 
                    typeOfXmlQualifiedName = typeof(XmlQualifiedName);
                return typeOfXmlQualifiedName; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfXmlSchemaType;
        internal static Type TypeOfXmlSchemaType
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfXmlSchemaType == null)
                    typeOfXmlSchemaType = typeof(XmlSchemaType); 
                return typeOfXmlSchemaType;
            }
        }
 
        [SecurityCritical]
        static Type typeOfXmlSerializableServices; 
        internal static Type TypeOfXmlSerializableServices 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfXmlSerializableServices == null)
                    typeOfXmlSerializableServices = typeof(XmlSerializableServices); 
                return typeOfXmlSerializableServices;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfXmlNodeArray;
        internal static Type TypeOfXmlNodeArray
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfXmlNodeArray == null) 
                    typeOfXmlNodeArray = typeof(XmlNode[]);
                return typeOfXmlNodeArray; 
            }
        }

        [SecurityCritical] 
        static Type typeOfXmlSchemaSet;
        internal static Type TypeOfXmlSchemaSet 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfXmlSchemaSet == null)
                    typeOfXmlSchemaSet = typeof(XmlSchemaSet);
                return typeOfXmlSchemaSet; 
            }
        } 
 
        [SecurityCritical]
        static object[] emptyObjectArray; 
        internal static object[] EmptyObjectArray
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (emptyObjectArray == null) 
                    emptyObjectArray = new object[0]; 
                return emptyObjectArray;
            } 
        }

        [SecurityCritical]
        static Type[] emptyTypeArray; 
        internal static Type[] EmptyTypeArray
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (emptyTypeArray == null)
                    emptyTypeArray = new Type[0];
                return emptyTypeArray;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfIPropertyChange;
        internal static Type TypeOfIPropertyChange 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfIPropertyChange == null)
                    typeOfIPropertyChange = typeof(INotifyPropertyChanged); 
                    return typeOfIPropertyChange; 
            }
        } 

        [SecurityCritical]
        static Type typeOfIExtensibleDataObject;
        internal static Type TypeOfIExtensibleDataObject 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfIExtensibleDataObject == null) 
                    typeOfIExtensibleDataObject = typeof(IExtensibleDataObject);
                return typeOfIExtensibleDataObject;
            }
        } 

        [SecurityCritical] 
        static Type typeOfExtensionDataObject; 
        internal static Type TypeOfExtensionDataObject
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfExtensionDataObject == null) 
                    typeOfExtensionDataObject = typeof(ExtensionDataObject);
                return typeOfExtensionDataObject; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfISerializableDataNode;
        internal static Type TypeOfISerializableDataNode
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfISerializableDataNode == null)
                    typeOfISerializableDataNode = typeof(ISerializableDataNode); 
                return typeOfISerializableDataNode;
            }
        }
 
        [SecurityCritical]
        static Type typeOfClassDataNode; 
        internal static Type TypeOfClassDataNode 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfClassDataNode == null)
                    typeOfClassDataNode = typeof(ClassDataNode); 
                return typeOfClassDataNode;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfCollectionDataNode;
        internal static Type TypeOfCollectionDataNode
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfCollectionDataNode == null) 
                    typeOfCollectionDataNode = typeof(CollectionDataNode);
                return typeOfCollectionDataNode; 
            }
        }

        [SecurityCritical] 
        static Type typeOfXmlDataNode;
        internal static Type TypeOfXmlDataNode 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfXmlDataNode == null)
                    typeOfXmlDataNode = typeof(XmlDataNode);
                return typeOfXmlDataNode; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfNullable; 
        internal static Type TypeOfNullable
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfNullable == null) 
                    typeOfNullable = typeof(Nullable<>); 
                return typeOfNullable;
            } 
        }

        [SecurityCritical]
        static Type typeOfReflectionPointer; 
        internal static Type TypeOfReflectionPointer
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfReflectionPointer == null)
                    typeOfReflectionPointer = typeof(System.Reflection.Pointer);
                return typeOfReflectionPointer;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfIDictionaryGeneric;
        internal static Type TypeOfIDictionaryGeneric 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfIDictionaryGeneric == null)
                    typeOfIDictionaryGeneric = typeof(IDictionary<,>); 
                return typeOfIDictionaryGeneric; 
            }
        } 

        [SecurityCritical]
        static Type typeOfIDictionary;
        internal static Type TypeOfIDictionary 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfIDictionary == null) 
                    typeOfIDictionary = typeof(IDictionary);
                return typeOfIDictionary;
            }
        } 

        [SecurityCritical] 
        static Type typeOfIListGeneric; 
        internal static Type TypeOfIListGeneric
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfIListGeneric == null) 
                    typeOfIListGeneric = typeof(IList<>);
                return typeOfIListGeneric; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfIList;
        internal static Type TypeOfIList
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfIList == null)
                    typeOfIList = typeof(IList); 
                return typeOfIList;
            }
        }
 
        [SecurityCritical]
        static Type typeOfICollectionGeneric; 
        internal static Type TypeOfICollectionGeneric 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfICollectionGeneric == null)
                    typeOfICollectionGeneric = typeof(ICollection<>); 
                return typeOfICollectionGeneric;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfICollection;
        internal static Type TypeOfICollection
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfICollection == null) 
                    typeOfICollection = typeof(ICollection);
                return typeOfICollection; 
            }
        }

        [SecurityCritical] 
        static Type typeOfIEnumerableGeneric;
        internal static Type TypeOfIEnumerableGeneric 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfIEnumerableGeneric == null)
                    typeOfIEnumerableGeneric = typeof(IEnumerable<>);
                return typeOfIEnumerableGeneric; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfIEnumerable; 
        internal static Type TypeOfIEnumerable
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfIEnumerable == null) 
                    typeOfIEnumerable = typeof(IEnumerable); 
                return typeOfIEnumerable;
            } 
        }

        [SecurityCritical]
        static Type typeOfIEnumeratorGeneric; 
        internal static Type TypeOfIEnumeratorGeneric
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfIEnumeratorGeneric == null)
                    typeOfIEnumeratorGeneric = typeof(IEnumerator<>);
                return typeOfIEnumeratorGeneric;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfIEnumerator;
        internal static Type TypeOfIEnumerator 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfIEnumerator == null)
                    typeOfIEnumerator = typeof(IEnumerator); 
                return typeOfIEnumerator; 
            }
        } 

        [SecurityCritical]
        static Type typeOfKeyValuePair;
        internal static Type TypeOfKeyValuePair 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfKeyValuePair == null) 
                    typeOfKeyValuePair = typeof(KeyValuePair<,>);
                return typeOfKeyValuePair;
            }
        } 

        [SecurityCritical] 
        static Type typeOfKeyValue; 
        internal static Type TypeOfKeyValue
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (typeOfKeyValue == null) 
                    typeOfKeyValue = typeof(KeyValue<,>);
                return typeOfKeyValue; 
            } 
        }
 
        [SecurityCritical]
        static Type typeOfIDictionaryEnumerator;
        internal static Type TypeOfIDictionaryEnumerator
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            { 
                if (typeOfIDictionaryEnumerator == null)
                    typeOfIDictionaryEnumerator = typeof(IDictionaryEnumerator); 
                return typeOfIDictionaryEnumerator;
            }
        }
 
        [SecurityCritical]
        static Type typeOfDictionaryEnumerator; 
        internal static Type TypeOfDictionaryEnumerator 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            {
                if (typeOfDictionaryEnumerator == null)
                    typeOfDictionaryEnumerator = typeof(CollectionDataContract.DictionaryEnumerator); 
                return typeOfDictionaryEnumerator;
            } 
        } 

        [SecurityCritical] 
        static Type typeOfGenericDictionaryEnumerator;
        internal static Type TypeOfGenericDictionaryEnumerator
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfGenericDictionaryEnumerator == null) 
                    typeOfGenericDictionaryEnumerator = typeof(CollectionDataContract.GenericDictionaryEnumerator<,>);
                return typeOfGenericDictionaryEnumerator; 
            }
        }

        [SecurityCritical] 
        static Type typeOfDictionaryGeneric;
        internal static Type TypeOfDictionaryGeneric 
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfDictionaryGeneric == null)
                    typeOfDictionaryGeneric = typeof(Dictionary<,>);
                return typeOfDictionaryGeneric; 
            }
        } 
 
        [SecurityCritical]
        static Type typeOfHashtable; 
        internal static Type TypeOfHashtable
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get 
            {
                if (typeOfHashtable == null) 
                    typeOfHashtable = typeof(Hashtable); 
                return typeOfHashtable;
            } 
        }

        [SecurityCritical]
        static Type typeOfListGeneric; 
        internal static Type TypeOfListGeneric
        { 
            [SecurityCritical, SecurityTreatAsSafe] 
            get
            { 
                if (typeOfListGeneric == null)
                    typeOfListGeneric = typeof(List<>);
                return typeOfListGeneric;
            } 
        }
 
        [SecurityCritical] 
        static Type typeOfXmlElement;
        internal static Type TypeOfXmlElement 
        {
            [SecurityCritical, SecurityTreatAsSafe]
            get
            { 
                if (typeOfXmlElement == null)
                    typeOfXmlElement = typeof(XmlElement); 
                return typeOfXmlElement; 
            }
        } 

        [SecurityCritical]
        static Type typeOfDBNull;
        internal static Type TypeOfDBNull 
        {
            [SecurityCritical, SecurityTreatAsSafe] 
            get 
            {
                if (typeOfDBNull == null) 
                    typeOfDBNull = typeof(DBNull);
                return typeOfDBNull;
            }
        } 

        [SecurityCritical] 
        static Uri dataContractXsdBaseNamespaceUri; 
        internal static Uri DataContractXsdBaseNamespaceUri
        { 
            [SecurityCritical, SecurityTreatAsSafe]
            get
            {
                if (dataContractXsdBaseNamespaceUri == null) 
                    dataContractXsdBaseNamespaceUri = new Uri(DataContractXsdBaseNamespace);
                return dataContractXsdBaseNamespaceUri; 
            } 
        }
 
        /// 
        /// Critical - Holds instance of SecurityPermission that we will Demand for SerializationFormatter
        ///            Should not be modified to something else
        ///  
        [SecurityCritical]
        static SecurityPermission serializationFormatterPermission; 
        public static SecurityPermission SerializationFormatterPermission 
        {
            ///  
            /// Critical - sets and accesses instance of SecurityPermission that we will Demand for SerializationFormatter
            /// 
            [SecurityCritical]
            get 
            {
                if (serializationFormatterPermission == null) 
                    serializationFormatterPermission = new SecurityPermission(SecurityPermissionFlag.SerializationFormatter); 
                return serializationFormatterPermission;
            } 
        }

        /// 
        /// Critical - Holds instance of ReflectionPermission that we will Demand for MemberAccess 
        ///            Should not be modified to something else
        ///  
        [SecurityCritical] 
        static ReflectionPermission memberAccessPermission;
        public static ReflectionPermission MemberAccessPermission 
        {
            /// 
            /// Critical - sets and accesses instance of ReflectionPermission that we will Demand for MemberAccess
            ///  
            [SecurityCritical]
            get 
            { 
                if (memberAccessPermission == null)
                    memberAccessPermission = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess); 
                return memberAccessPermission;
            }
        }
 
        public const bool DefaultIsRequired = false;
        public const bool DefaultEmitDefaultValue = true; 
        public const int DefaultOrder = 0; 
        public const bool DefaultIsReference = false;
        // The value string.Empty aids comparisons (can do simple length checks 
        //     instead of string comparison method calls in IL.)
        public readonly static string NewObjectId = string.Empty;
        public const string NullObjectId = null;
        public const string Space = " "; 
        public const string XsiPrefix = "i";
        public const string XsdPrefix = "x"; 
        public const string SerPrefix = "z"; 
        public const string SerPrefixForSchema = "ser";
        public const string ElementPrefix = "q"; 
        public const string DataContractXsdBaseNamespace = "http://schemas.datacontract.org/2004/07/";
        public const string DataContractXmlNamespace = DataContractXsdBaseNamespace + "System.Xml";
        public const string SchemaInstanceNamespace = XmlSchema.InstanceNamespace;
        public const string SchemaNamespace = XmlSchema.Namespace; 
        public const string XsiNilLocalName = "nil";
        public const string XsiTypeLocalName = "type"; 
        public const string TnsPrefix = "tns"; 
        public const string OccursUnbounded = "unbounded";
        public const string AnyTypeLocalName = "anyType"; 
        public const string StringLocalName = "string";
        public const string IntLocalName = "int";
        public const string True = "true";
        public const string False = "false"; 
        public const string ArrayPrefix = "ArrayOf";
        public const string XmlnsNamespace = "http://www.w3.org/2000/xmlns/"; 
        public const string XmlnsPrefix = "xmlns"; 
        public const string SchemaLocalName = "schema";
        public const string CollectionsNamespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays"; 
        public const string DefaultClrNamespace = "GeneratedNamespace";
        public const string DefaultTypeName = "GeneratedType";
        public const string DefaultGeneratedMember = "GeneratedMember";
        public const string DefaultFieldSuffix = "Field"; 
        public const string DefaultPropertySuffix = "Property";
        public const string DefaultMemberSuffix = "Member"; 
        public const string NameProperty = "Name"; 
        public const string NamespaceProperty = "Namespace";
        public const string OrderProperty = "Order"; 
        public const string IsReferenceProperty = "IsReference";
        public const string IsRequiredProperty = "IsRequired";
        public const string EmitDefaultValueProperty = "EmitDefaultValue";
        public const string ClrNamespaceProperty = "ClrNamespace"; 
        public const string ItemNameProperty = "ItemName";
        public const string KeyNameProperty = "KeyName"; 
        public const string ValueNameProperty = "ValueName"; 
        public const string SerializationInfoPropertyName = "SerializationInfo";
        public const string SerializationInfoFieldName = "info"; 
        public const string NodeArrayPropertyName = "Nodes";
        public const string NodeArrayFieldName = "nodesField";
        public const string ExportSchemaMethod = "ExportSchema";
        public const string IsAnyProperty = "IsAny"; 
        public const string ContextFieldName = "context";
        public const string GetObjectDataMethodName = "GetObjectData"; 
        public const string GetEnumeratorMethodName = "GetEnumerator"; 
        public const string MoveNextMethodName = "MoveNext";
        public const string AddValueMethodName = "AddValue"; 
        public const string CurrentPropertyName = "Current";
        public const string ValueProperty = "Value";
        public const string EnumeratorFieldName = "enumerator";
        public const string SerializationEntryFieldName = "entry"; 
        public const string ExtensionDataSetMethod = "set_ExtensionData";
        public const string ExtensionDataSetExplicitMethod = "System.Runtime.Serialization.IExtensibleDataObject.set_ExtensionData"; 
        public const string ExtensionDataObjectPropertyName = "ExtensionData"; 
        public const string ExtensionDataObjectFieldName = "extensionDataField";
        public const string AddMethodName = "Add"; 
        public const string GetCurrentMethodName = "get_Current";
        // NOTE: These values are used in schema below. If you modify any value, please make the same change in the schema.
        public const string SerializationNamespace = "http://schemas.microsoft.com/2003/10/Serialization/";
        public const string ClrTypeLocalName = "Type"; 
        public const string ClrAssemblyLocalName = "Assembly";
        public const string IsValueTypeLocalName = "IsValueType"; 
        public const string EnumerationValueLocalName = "EnumerationValue"; 
        public const string SurrogateDataLocalName = "Surrogate";
        public const string GenericTypeLocalName = "GenericType"; 
        public const string GenericParameterLocalName = "GenericParameter";
        public const string GenericNameAttribute = "Name";
        public const string GenericNamespaceAttribute = "Namespace";
        public const string GenericParameterNestedLevelAttribute = "NestedLevel"; 
        public const string IsDictionaryLocalName = "IsDictionary";
        public const string ActualTypeLocalName = "ActualType"; 
        public const string ActualTypeNameAttribute = "Name"; 
        public const string ActualTypeNamespaceAttribute = "Namespace";
        public const string DefaultValueLocalName = "DefaultValue"; 
        public const string EmitDefaultValueAttribute = "EmitDefaultValue";
        public const string ISerializableFactoryTypeLocalName = "FactoryType";
        public const string IdLocalName = "Id";
        public const string RefLocalName = "Ref"; 
        public const string ArraySizeLocalName = "Size";
        public const string KeyLocalName = "Key"; 
        public const string ValueLocalName = "Value"; 
        public const string MscorlibAssemblyName = "0";
        public const string SerializationSchema = @" 

  
  
   
  
   
   
  
   
  
  
  
   
  
   
   
  
   
  
  
  
     
  
   
   
    
       
      
      
    
   
  
   
     
      
     
  
  
  
   

"; 
    } 
}
 

// 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