Example #1
0
        protected virtual void OnLoadingValueType()
        {
            if (ValueType != null)
            {
                if (ValueType.IsValueType)
                {
                    m_bAllowNull = false;
                    if (ValueType.IsEnum)
                    {
                        System.Reflection.FieldInfo[] fields = ValueType.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                        m_DefaultValue = fields[0].GetValue(null);
                    }
                    else
                    {
                        m_DefaultValue = Activator.CreateInstance(ValueType);
                    }
                }
                else
                {
                    m_DefaultValue = null;
                    m_bAllowNull   = true;
                }

                m_StandardValues           = null;
                m_bStandardValuesExclusive = false;

                m_MaximumValue       = null;
                m_MinimumValue       = null;
                m_sNullString        = "";
                m_sNullDisplayString = "";
            }
            else
            {
                m_bAllowNull               = true;
                m_DefaultValue             = null;
                m_StandardValues           = null;
                m_bStandardValuesExclusive = false;
                m_MaximumValue             = null;
                m_MinimumValue             = null;
                m_sNullString              = "";
                m_sNullDisplayString       = "";
            }
        }