public static string GetCommonMessage(CommonMessageKeys messageKey, params object[] parameters) { CreateIfNotExists(); string returnMessage = ""; if (commonMessages.ContainsKey(messageKey)) { if (parameters.Length != commonMessageParts[messageKey]) { Array.Resize(ref parameters, commonMessageParts[messageKey]); } returnMessage = string.Format(commonMessages[messageKey], parameters); } return(returnMessage); }
public static string GetCommonMessage(CommonMessageKeys messageKey, params object[] parameters) { CreateIfNotExists(); string returnMessage = ""; string outputMessage = VRTK_SharedMethods.GetDictionaryValue(commonMessages, messageKey); if (outputMessage != null) { int outputMessageParts = VRTK_SharedMethods.GetDictionaryValue(commonMessageParts, messageKey); if (parameters.Length != outputMessageParts) { Array.Resize(ref parameters, outputMessageParts); } returnMessage = string.Format(outputMessage, parameters); } return(returnMessage); }