Last active
December 11, 2015 10:18
-
-
Save starteleport/4585278 to your computer and use it in GitHub Desktop.
Part of Convert<T, P> class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static P SameType (P p) { return p; } | |
private static T Assignable(P p) { return (T)(object)p; } | |
private static T Default(P p) { return (p as IConvertible) == null ? (T)(object)p : (T)System.Convert.ChangeType(p, typeof(T), Thread.CurrentThread.CurrentCulture); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment