本文整理匯總了C#中System.Xml.XPath.XPathResult.RemoveChildren方法的典型用法代碼示例。如果您正苦於以下問題:C# XPathResult.RemoveChildren方法的具體用法?C# XPathResult.RemoveChildren怎麽用?C# XPathResult.RemoveChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XPath.XPathResult
的用法示例。
在下文中一共展示了XPathResult.RemoveChildren方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WriteComponent
private void WriteComponent(XPathResult result, object value, IDictionaryAdapter dictionaryAdapter)
{
if (result.Property != null)
{
dictionaryAdapter.This.ExtendedProperties.Remove(result.Property.PropertyName);
}
if (value == null)
{
result.Remove();
return;
}
var source = value as IDictionaryAdapter;
if (source != null)
{
var node = result.RemoveChildren();
if (result.Type != source.Meta.Type && result.OmitPolymorphism == false)
{
var xmlType = source.GetXmlMeta().XmlType;
Context.SetXmlType(xmlType.TypeName, xmlType.Namespace, node);
}
var element = (IDictionaryAdapter)ReadComponent(result, false, dictionaryAdapter);
source.CopyTo(element);
}
}
示例2: WriteComponent
private void WriteComponent(XPathResult result, ref object value, IDictionaryAdapter dictionaryAdapter)
{
var source = value as IDictionaryAdapter;
if (source != null)
{
var sourceAdapter = For(source);
if (sourceAdapter != null)
{
var sourceRoot = sourceAdapter.Root;
var resultNode = result.GetNavigator(false);
if (sourceRoot != null && resultNode != null && sourceRoot.IsSamePosition(resultNode))
return;
}
var node = result.RemoveChildren();
if (result.Type != source.Meta.Type && result.OmitPolymorphism == false)
{
var xmlType = source.GetXmlMeta().XmlType;
var context = GetEffectiveContext(dictionaryAdapter);
context.SetXmlType(xmlType.TypeName, xmlType.Namespace, node);
}
var element = (IDictionaryAdapter)ReadComponent(result, false, dictionaryAdapter);
source.CopyTo(element);
value = element;
}
}
示例3: WriteComponent
private void WriteComponent(XPathResult result, ref object value, IDictionaryAdapter dictionaryAdapter)
{
var source = value as IDictionaryAdapter;
if (source != null)
{
var node = result.RemoveChildren();
if (result.Type != source.Meta.Type && result.OmitPolymorphism == false)
{
var xmlType = source.GetXmlMeta().XmlType;
Context.SetXmlType(xmlType.TypeName, xmlType.Namespace, node);
}
var element = (IDictionaryAdapter)ReadComponent(result, false, dictionaryAdapter);
source.CopyTo(element);
value = element;
}
}