/// <summary> /// Set ImplicitDefault to the default value of <paramref name="explicitDefault"/>'s type, /// and ExplicitDefault to <paramref name="explicitDefault"/>. /// </summary> /// <param name="explicitDefault"></param> /// <param name="storeInBase"></param> /// <param name="nativeToString"></param> internal ValueDescription(IComparable explicitDefault, bool storeInBase = true, ValueNativeToString nativeToString = null) { ImplicitDefault = GetImplicitDefault(explicitDefault.GetType()); ExplicitDefault = explicitDefault; DefaultsDiffer = (ImplicitDefault.CompareTo(ExplicitDefault) != 0); StoreInBase = storeInBase; NativeToString = nativeToString; }
/// <summary> /// Set both ImplicitDefault and ExplicitDefault to the <paramref name="t"/>'s default value. /// </summary> /// <param name="t"></param> /// <param name="storeInBase"></param> /// <param name="nativeToString"></param> internal ValueDescription(Type t, bool storeInBase = true, ValueNativeToString nativeToString = null) { ImplicitDefault = GetImplicitDefault(t); ExplicitDefault = ImplicitDefault; DefaultsDiffer = false; StoreInBase = storeInBase; NativeToString = nativeToString; }