本文整理汇总了C#中Element.RemoveChild方法的典型用法代码示例。如果您正苦于以下问题:C# Element.RemoveChild方法的具体用法?C# Element.RemoveChild怎么用?C# Element.RemoveChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.RemoveChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XDataForm
/// <summary>
/// Create an x:data form from the given iq stanza.
/// </summary>
/// <param name="parent">Original stanza</param>
public XDataForm(Kixeye.Jabber.Protocol.Client.IQ parent) : this(FindData(parent))
{
m_stanza = (Packet) parent.CloneNode(true);
Data d = FindData(m_stanza);
m_parent = (Element)d.ParentNode;
m_parent.RemoveChild(d);
}
示例2: XDataForm
/// <summary>
/// Create an x:data form from the given message stanza.
/// </summary>
/// <param name="parent">Original stanza</param>
public XDataForm(jabber.protocol.client.Message parent) : this(FindData(parent) as jabber.protocol.x.Data)
{
m_stanza = (Packet) parent.CloneNode(true);
Data d = FindData(m_stanza);
Debug.Assert(d != null);
m_parent = (Element)d.ParentNode;
m_parent.RemoveChild(d);
}
示例3: NormaliseTextNodes
// does not recurse.
private void NormaliseTextNodes(Element element)
{
List<Node> toMove = new List<Node>();
foreach (Node node in element.ChildNodes)
{
if (node is TextNode)
{
TextNode tn = (TextNode)node;
if (!tn.IsBlank)
{
toMove.Add(tn);
}
}
}
for (int i = toMove.Count - 1; i >= 0; i--)
{
Node node = toMove[i];
element.RemoveChild(node);
Body.PrependChild(new TextNode(" ", string.Empty));
Body.PrependChild(node);
}
}
示例4: XDataForm
/// <summary>
/// Create an x:data form from the given iq stanza.
/// </summary>
/// <param name="parent">Original stanza</param>
public XDataForm(IQ parent)
: this(FindData(parent))
{
m_stanza = (Packet) parent.CloneNode(true);
Data d = FindData(m_stanza);
m_parent = (Element)d.ParentNode;
m_parent.RemoveChild(d);
}