private static string BeginControl(string type, string name, Dictionary<string, object> properties)
{
Debug.Assert(type != null);
if (String.IsNullOrEmpty(name))
throw new GxException(String.Format("Control must have a name ({0})", type));
StringBuilder attributes = new StringBuilder();
if (properties != null)
foreach (KeyValuePair<string, object> prop in properties)
attributes.Append(String.Format(" {0}=\"{1}\"", prop.Key, prop.Value.ToString()));
return String.Format("<gx{0} ControlName=\"{1}\"{2}>", type, name, attributes.ToString());
}