internal static string CreateMessage(string res, params string[] args)
{
string message = null;
try
{
if (args == null)
{
message = res;
}
else
{
message = string.Format(res, args);
}
}
catch (MissingManifestResourceException)
{
}
if (message != null)
{
return message;
}
StringBuilder sb = new StringBuilder(res);
if (args != null && args.Length > 0)
{
Debug.Fail("Resource string '" + res + "' was not found");
sb.Append('(');
sb.Append(args[0]);
for (int idx = 1; idx < args.Length; idx++)
{
sb.Append(", ");
sb.Append(args[idx]);
}
sb.Append(')');
}
return sb.ToString();
}