本文整理汇总了C#中iTextSharp.xmp.impl.XmpNode.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# XmpNode.Clear方法的具体用法?C# XmpNode.Clear怎么用?C# XmpNode.Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.xmp.impl.XmpNode
的用法示例。
在下文中一共展示了XmpNode.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetNode
/// <summary>
/// The internals for SetProperty() and related calls, used after the node is
/// found or created.
/// </summary>
/// <param name="node">
/// the newly created node </param>
/// <param name="value">
/// the node value, can be <code>null</code> </param>
/// <param name="newOptions">
/// options for the new node, must not be <code>null</code>. </param>
/// <param name="deleteExisting"> flag if the existing value is to be overwritten </param>
/// <exception cref="XmpException"> thrown if options and value do not correspond </exception>
internal virtual void SetNode(XmpNode node, object value, PropertyOptions newOptions, bool deleteExisting) {
if (deleteExisting) {
node.Clear();
}
// its checked by setOptions(), if the merged result is a valid options set
node.Options.MergeWith(newOptions);
if (!node.Options.CompositeProperty) {
// This is setting the value of a leaf node.
XmpNodeUtils.SetNodeValue(node, value);
}
else {
if (value != null && value.ToString().Length > 0) {
throw new XmpException("Composite nodes can't have values", XmpError.BADXPATH);
}
node.RemoveChildren();
}
}