public static string CreateSelectorString(string name, string parameter, string @class, string id)
{
var result = new StringBuilder();
if (!string.IsNullOrEmpty(name) && !name.Equals("*")) {
result.Append(name);
}
if (!string.IsNullOrEmpty(parameter)) {
result.Append("[");
result.Append(parameter);
result.Append("]");
}
if (!string.IsNullOrEmpty(@class)) {
result.Append(".");
result.Append(@class);
}
if (!string.IsNullOrEmpty(id)) {
result.Append("#");
result.Append(id);
}
return result.ToString();
}