本文整理汇总了C#中TreeNode.GetStringValue方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.GetStringValue方法的具体用法?C# TreeNode.GetStringValue怎么用?C# TreeNode.GetStringValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeNode
的用法示例。
在下文中一共展示了TreeNode.GetStringValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearEditorWidgetsContent
/// <summary>
/// Removes document content for all editor widgets in a given document.
/// </summary>
/// <param name="treeNode">Document to update</param>
/// <param name="pti">Page template instance</param>
/// <param name="omitUpdate">Indicates whether update on a given document should be omitted</param>
private void ClearEditorWidgetsContent(TreeNode treeNode, PageTemplateInstance pti, bool omitUpdate)
{
var documentWebPartsXml = treeNode.GetStringValue("DocumentWebParts", String.Empty);
if (String.IsNullOrEmpty(documentWebPartsXml))
{
return;
}
var webPartIds = new List<string>();
// Get web part IDs from DocumentWebParts column
webPartIds.AddRange(GetWebPartIDs(documentWebPartsXml));
// Get web part IDs from page template (widget zones only) and combine them with existing list.
webPartIds.AddRange(GetWebPartIDs(pti.GetZonesXML(WidgetZoneTypeEnum.Editor)));
// Remove web part IDs from DocumentContent
foreach (var wpId in webPartIds.Distinct())
{
treeNode.DocumentContent.EditableWebParts.Remove(wpId);
}
treeNode.SetValue("DocumentContent", treeNode.DocumentContent.GetContentXml());
if (!omitUpdate)
{
DocumentHelper.UpdateDocument(treeNode, TreeProvider);
}
}