/// <summary> /// Unregisters an argument converter for specified type. /// </summary> /// <typeparam name="T">Type for which to unregister the converter.</typeparam> public void UnregisterConverter <T>() { var t = typeof(T); var ti = t.GetTypeInfo(); if (ArgumentConverters.ContainsKey(t)) { ArgumentConverters.Remove(t); } if (UserFriendlyTypeNames.ContainsKey(t)) { UserFriendlyTypeNames.Remove(t); } if (!ti.IsValueType) { return; } var nullableType = typeof(Nullable <>).MakeGenericType(t); if (!ArgumentConverters.ContainsKey(nullableType)) { return; } ArgumentConverters.Remove(nullableType); UserFriendlyTypeNames.Remove(nullableType); }
/// <summary> /// Unregisters an argument converter for specified type. /// </summary> /// <typeparam name="T">Type for which to unregister the converter.</typeparam> public static void UnregisterConverter <T>() { var t = typeof(T); if (ArgumentConverters.ContainsKey(t)) { ArgumentConverters.Remove(t); } }
/// <summary> /// Unregisters an argument converter for specified type. /// </summary> /// <typeparam name="T">Type for which to unregister the converter.</typeparam> public static void UnregisterConverter <T>() { var t = typeof(T); if (ArgumentConverters.ContainsKey(t)) { ArgumentConverters.Remove(t); } if (UserFriendlyTypeNames.ContainsKey(t)) { UserFriendlyTypeNames.Remove(t); } }