3239
社区成员
private void UpdateInWeb(bool bToggleSealed)
{
SPFieldCalculated calculated = this as SPFieldCalculated;
if (calculated != null)
{
List<Guid> fids = new List<Guid>();
List<string> fldTitles = new List<string>();
if (calculated.Formula != null)
{
ParseFormula(this.Fields.Web, calculated.Formula, fids, fldTitles);
}
this.UpdateSchemaXmlInWeb(this.Node.OuterXml, bToggleSealed, false, false, calculated.Formula, fldTitles, fids);
}
else
{
string namedStringItem = SPGlobal.GetNamedStringItem(this.Node, "RelationshipDeleteBehavior");
if (!string.IsNullOrEmpty(namedStringItem) && (string.Compare(namedStringItem, "None", true, CultureInfo.InvariantCulture) != 0))
{
throw new SPException(SPResource.GetString("LookupRelationshipsSiteColumnsCannotHaveRI", new object[0]));
}
string str2 = SPGlobal.GetNamedStringItem(this.Node, "EnforceUniqueValues");
if (!string.IsNullOrEmpty(str2) && (string.Compare(str2, "true", true, CultureInfo.InvariantCulture) == 0))
{
Guid fieldId = new Guid(SPGlobal.GetNamedStringItem(this.Node, "ID"));
if (SPUtility.IsBuiltInFieldDisallowingUniqueness(fieldId))
{
throw new SPException(SPResource.GetString("EnforceUniqueValuesDisallowedOnBuiltInFieldId", new object[0]));
}
}
this.UpdateSchemaXmlInWeb(this.Node.OuterXml, bToggleSealed, false, false, string.Empty, null, null);
}
}