public ReplaceSelf ( XmlReader newNode ) : void | ||
newNode | XmlReader | |
return | void |
public virtual void ReplaceSelf(XmlReader newNode)
{
if (newNode == null)
{
throw new ArgumentNullException(nameof(newNode));
}
XPathNodeType type = NodeType;
if (type == XPathNodeType.Root
|| type == XPathNodeType.Attribute
|| type == XPathNodeType.Namespace)
{
throw new InvalidOperationException(SR.Xpn_BadPosition);
}
XmlWriter writer = ReplaceRange(this);
BuildSubtree(newNode, writer);
writer.Close();
}
XPathNavigator::ReplaceSelf ( |
|
XPathNavigator::ReplaceSelf ( string newNode ) : void |
private static bool ProcessItemGroupNode(XPathNavigator nav) { try { if (nav.MoveToChild("StyleCopTreatErrorsAsWarnings", "http://schemas.microsoft.com/developer/msbuild/2003")) { if (nav.Value == "false") { nav.ReplaceSelf("<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>"); } else { nav.ReplaceSelf("<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>"); } } else { nav.AppendChild("<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>"); } return true; } catch { return false; } }