private string GetFieldXml(bool required, string additionalProperties, string fieldContent) { var format = !string.IsNullOrEmpty(Format) ? " Format=\"" + Format + "\"" : string.Empty; var showField = !string.IsNullOrEmpty(ShowField) ? " ShowField=\"" + ShowField + "\"" : string.Empty; var openTermSet = OpenTermSet ? " CreateValuesInEditForm=\"TRUE\" Open=\"TRUE\"" : string.Empty; var fieldXml = new StringBuilder(); fieldXml.AppendFormat( "<Field ID=\"{0}\" Name=\"{1}\" DisplayName=\"{2}\" Type=\"{3}\" Hidden=\"{4}\" " + "Group=\"{5}\" Description=\"{6}\" Required=\"{7}\" " + "ShowInNewForm=\"{8}\" ShowInEditForm=\"{9}\" ShowInDisplayForm=\"{10}\"" + "{11}{12}{13} {14}>", ID.ToString("B"), InternalName.Trim(), DisplayName.Trim(), Type, Hidden, Group, Description, required.ToString().ToUpper(), ShowInNewForm.ToString().ToUpper(), ShowInEditForm.ToString().ToUpper(), ShowInDisplayForm.ToString().ToUpper(), format, showField, openTermSet, additionalProperties); if (!string.IsNullOrEmpty(Default)) { fieldXml.AppendFormat("<Default>{0}</Default>", Default); } if (!string.IsNullOrEmpty(fieldContent)) { fieldXml.Append(fieldContent); } fieldXml.Append("</Field>"); return(fieldXml.ToString()); }
public string MapNameWithDimensions() { return($"{InternalName.Trim()} ({MapWidth}x{MapHeight})"); }