diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-09 20:44:48 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-09 20:48:02 +0100 |
| commit | 673466d57ed603eb5c336ab9c09c7d8a74ec3b02 (patch) | |
| tree | b774fc1bc15c3606ab42fbe948850eb7cbf315e6 /src/ExtensionsMethods.cs | |
| parent | d783669223da5bfe8caa1b95c0ff6e1c5046e09e (diff) | |
made SeletedItem of templatedGroup writable0.6.0
Diffstat (limited to 'src/ExtensionsMethods.cs')
| -rw-r--r-- | src/ExtensionsMethods.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs index 6198dee6..6697be62 100644 --- a/src/ExtensionsMethods.cs +++ b/src/ExtensionsMethods.cs @@ -125,6 +125,14 @@ namespace Crow { return c == '\t' || c == '\r' || c == '\n' || char.IsWhiteSpace (c); } + public static object GetDefaultValue(this object obj) + { + Type t = obj.GetType (); + if (t.IsValueType) + return Activator.CreateInstance (t); + + return null; + } } } |