BTDB.FieldHandler.EnumFieldHandler.SpecializeLoadForType C# (CSharp) Method

SpecializeLoadForType() public method

public SpecializeLoadForType ( Type type, IFieldHandler typeHandler ) : IFieldHandler
type System.Type
typeHandler IFieldHandler
return IFieldHandler
        public IFieldHandler SpecializeLoadForType(Type type, IFieldHandler typeHandler)
        {
            if (typeHandler == this) return this;
            var enumTypeHandler = typeHandler as EnumFieldHandler;
            if (enumTypeHandler != null)
            {
                if (_signed == enumTypeHandler._signed && new EnumConfiguration(Configuration).IsSubsetOf(new EnumConfiguration(enumTypeHandler.Configuration)))
                {
                    return typeHandler;
                }
            }
            if (_enumType == null && type.IsEnum)
            {
                if (_configuration.SequenceEqual(new EnumConfiguration(type).ToConfiguration()))
                {
                    _enumType = type;
                }
            }
            return this;
        }