System.Data.Common.DataStorage.ImplementsInterfaces C# (CSharp) Method

ImplementsInterfaces() static private method

static private ImplementsInterfaces ( StorageType typeCode, Type dataType, bool &sqlType, bool &nullable, bool &xmlSerializable, bool &changeTracking, bool &revertibleChangeTracking ) : void
typeCode StorageType
dataType System.Type
sqlType bool
nullable bool
xmlSerializable bool
changeTracking bool
revertibleChangeTracking bool
return void
        internal static void ImplementsInterfaces(
                                    StorageType typeCode,
                                    Type dataType,
                                    out bool sqlType,
                                    out bool nullable,
                                    out bool xmlSerializable,
                                    out bool changeTracking,
                                    out bool revertibleChangeTracking)
        {
            Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType");
            if (IsSqlType(typeCode))
            {
                sqlType = true;
                nullable = true;
                changeTracking = false;
                revertibleChangeTracking = false;
                xmlSerializable = true;
            }
            else if (StorageType.Empty != typeCode)
            {
                sqlType = false;
                nullable = false;
                changeTracking = false;
                revertibleChangeTracking = false;
                xmlSerializable = false;
            }
            else
            {
                // Non-standard type - look it up in the dictionary or add it if not found
                Tuple<bool, bool, bool, bool> interfaces = s_typeImplementsInterface.GetOrAdd(dataType, s_inspectTypeForInterfaces);
                sqlType = false;
                nullable = interfaces.Item1;
                changeTracking = interfaces.Item2;
                revertibleChangeTracking = interfaces.Item3;
                xmlSerializable = interfaces.Item4;
            }
            Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable");
            Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking");
            Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking");
            Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable");
        }