Class ConvertTypeShortcutFullName
- Namespace
- SunamoConverters.Converts
- Assembly
- SunamoConverters.dll
Converts between C# type shortcuts (e.g., "string", "int") and their full System type names (e.g., "System.String", "System.Int32").
public static class ConvertTypeShortcutFullName
- Inheritance
-
ConvertTypeShortcutFullName
- Inherited Members
Methods
FromShortcut(string)
Converts a C# type shortcut (e.g., "string", "int") to its full name (e.g., "System.String", "System.Int32").
public static string FromShortcut(string shortcut)
Parameters
shortcutstringThe type shortcut.
Returns
- string
The full type name.
Exceptions
- Exception
Thrown when the shortcut is not a supported keyword.
ToShortcut(object)
Converts an object instance to its type shortcut.
public static string ToShortcut(object instance)
Parameters
instanceobjectThe object instance.
Returns
- string
The type shortcut.
ToShortcut(string)
Converts a full type name to its C# shortcut.
public static string ToShortcut(string fullName)
Parameters
fullNamestringThe full type name (e.g., "System.String").
Returns
- string
The type shortcut (e.g., "string").
ToShortcut(string, bool)
Converts a full type name to its C# shortcut.
public static string ToShortcut(string fullName, bool isThrowingExceptionWhenNotBasicType)
Parameters
fullNamestringThe full type name (e.g., "System.String" or "String").
isThrowingExceptionWhenNotBasicTypeboolIf true, throws an exception for non-basic types; otherwise returns the full name.
Returns
- string
The type shortcut or the original full name.
Exceptions
- Exception
Thrown when the type is not a basic type and isThrowingExceptionWhenNotBasicType is true.