|
using System.Text;
using System.Web.UI;
namespace Localization {
public sealed class LocalizedUtility {
private LocalizedUtility() {}
public static string ReplaceParameters(ControlCollection controls, string text) {
if(controls == null || controls.Count == 0){
return text;
}
StringBuilder sb = new StringBuilder(text);
for (int i = 0; i < controls.Count; i++){
Parameter parameter = controls[i] as Parameter;
if(parameter != null){
string key = parameter.Key;
string value = parameter.Value;
sb.Replace('{' + key.ToUpper() + '}', value);
}
}
return sb.ToString();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.