diff --git a/src/Helpers/GeneralHelper.cs b/src/Helpers/GeneralHelper.cs
index b8962c1..5fe8932 100644
--- a/src/Helpers/GeneralHelper.cs
+++ b/src/Helpers/GeneralHelper.cs
@@ -121,27 +121,39 @@ public static string SetTextEnabledClass(bool enabled)
public static bool IsNotNull([NotNullWhen(true)] object? obj) => obj != null;
- public static string FormatResoureType(string type)
+ public static string[] FormatResoureType(string type)
{
+ String[] returntype = new String[3];
+ // Make sure it is a full resource type name
+ if (type.Contains("("))
+ {
+ returntype[0] = type.Substring(0, type.IndexOf("(")).Trim();
+ }
try
{
- // trim any details out of the value
- if (type.Contains("-"))
+ if ((GeneralHelper.IsNotNull(type)) && (GeneralHelper.IsNotNull(returntype[0])))
{
- type = type.Substring(0, type.IndexOf("-")).Trim();
- }
+ // trim any details out of the value
+ if (returntype[0].Contains(" -"))
+ {
+ returntype[1] = returntype[0].Substring(0, returntype[0].IndexOf(" -")).Trim();
+ }
- // trim any details out of the value
- if (type.Contains("("))
- {
- type = type.Substring(0, type.IndexOf("(")).Trim();
+ // trim any details out of the value
+ if ((type.Contains("(")) && (type.Contains(")")))
+ {
+ {
+ int intstart = type.IndexOf("(") + 1;
+ returntype[2] = String.Concat(type.Substring(intstart).TakeWhile(x => x != ')'));
+ }
+ }
}
}
catch (Exception ex)
{
AdminLogService.PostItem(new AdminLogMessage() { Title = "ERROR", Message = ex.Message });
}
- return type;
+ return returntype;
}
}
}
diff --git a/src/Pages/Generate.razor b/src/Pages/Generate.razor
index a68376f..5f84095 100644
--- a/src/Pages/Generate.razor
+++ b/src/Pages/Generate.razor
@@ -107,7 +107,7 @@
- { OnTypeChanged(EventArgs.Value!.ToString()!);}" class="@GetControlStyle()" list="typeslist" id="generatetypes" placeholder="Type to search resource types..." autocomplete="off">
+ { OnTypeChanged(EventArgs.Value!.ToString()!);}" class="@GetControlStyle()" list="typeslist" id="generatetypes" placeholder="Type to search resource types..." autocomplete="off">