mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Merge remote-tracking branch 'origin/ConnectPro_v1.0' into dev
This commit is contained in:
@@ -317,30 +317,14 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
if (extends == null)
|
if (extends == null)
|
||||||
throw new ArgumentNullException("extends");
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
|
// Nullable
|
||||||
Type nullableType = Nullable.GetUnderlyingType(extends);
|
Type nullableType = Nullable.GetUnderlyingType(extends);
|
||||||
if (nullableType != null)
|
if (nullableType != null)
|
||||||
return nullableType.GetSyntaxName() + "?";
|
return nullableType.GetSyntaxName() + "?";
|
||||||
|
|
||||||
if (!(extends.IsGenericType && extends.Name.Contains('`')))
|
// Generic
|
||||||
|
if (extends.IsGenericType)
|
||||||
{
|
{
|
||||||
switch (extends.Name)
|
|
||||||
{
|
|
||||||
case "String":
|
|
||||||
return "string";
|
|
||||||
case "Int32":
|
|
||||||
return "int";
|
|
||||||
case "Decimal":
|
|
||||||
return "decimal";
|
|
||||||
case "Object":
|
|
||||||
return "object";
|
|
||||||
case "Void":
|
|
||||||
return "void";
|
|
||||||
|
|
||||||
default:
|
|
||||||
return string.IsNullOrEmpty(extends.FullName) ? extends.Name : extends.FullName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(extends.Name.Substring(0, extends.Name.IndexOf('`')));
|
StringBuilder sb = new StringBuilder(extends.Name.Substring(0, extends.Name.IndexOf('`')));
|
||||||
sb.Append('<');
|
sb.Append('<');
|
||||||
|
|
||||||
@@ -357,5 +341,24 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
switch (extends.Name)
|
||||||
|
{
|
||||||
|
case "String":
|
||||||
|
return "string";
|
||||||
|
case "Int32":
|
||||||
|
return "int";
|
||||||
|
case "Decimal":
|
||||||
|
return "decimal";
|
||||||
|
case "Object":
|
||||||
|
return "object";
|
||||||
|
case "Void":
|
||||||
|
return "void";
|
||||||
|
|
||||||
|
default:
|
||||||
|
return extends.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user