本文整理匯總了C#中System.Xml.XmlDocument.GetInsertEventArgsForLoad方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlDocument.GetInsertEventArgsForLoad方法的具體用法?C# XmlDocument.GetInsertEventArgsForLoad怎麽用?C# XmlDocument.GetInsertEventArgsForLoad使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlDocument
的用法示例。
在下文中一共展示了XmlDocument.GetInsertEventArgsForLoad方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AppendChildForLoad
internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc)
{
XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(newChild, this);
if (insertEventArgsForLoad != null)
{
doc.BeforeEvent(insertEventArgsForLoad);
}
XmlLinkedNode nextNode = (XmlLinkedNode) newChild;
if ((this.lastChild == null) || (this.lastChild == this))
{
nextNode.next = nextNode;
this.lastChild = nextNode;
nextNode.SetParentForLoad(this);
}
else
{
XmlLinkedNode lastChild = this.lastChild;
nextNode.next = lastChild.next;
lastChild.next = nextNode;
this.lastChild = nextNode;
if (lastChild.IsText && nextNode.IsText)
{
XmlNode.NestTextNodes(lastChild, nextNode);
}
else
{
nextNode.SetParentForLoad(this);
}
}
if (insertEventArgsForLoad != null)
{
doc.AfterEvent(insertEventArgsForLoad);
}
return nextNode;
}
示例2: AddNodeForLoad
internal virtual XmlNode AddNodeForLoad(XmlNode node, XmlDocument doc)
{
XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(node, this.parent);
if (insertEventArgsForLoad != null)
{
doc.BeforeEvent(insertEventArgsForLoad);
}
this.Nodes.Add(node);
node.SetParent(this.parent);
if (insertEventArgsForLoad != null)
{
doc.AfterEvent(insertEventArgsForLoad);
}
return node;
}
示例3: AppendChildForLoad
//the function is provided only at Load time to speed up Load process
internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) {
XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );
if (args != null)
doc.BeforeEvent( args );
XmlLinkedNode newNode = (XmlLinkedNode)newChild;
if (lastChild == null) { // if LastNode == null
newNode.next = newNode;
lastChild = newNode;
newNode.SetParentForLoad(this);
}
else {
XmlLinkedNode refNode = lastChild; // refNode = LastNode;
newNode.next = refNode.next;
refNode.next = newNode;
lastChild = newNode; // LastNode = newNode;
if (refNode.IsText
&& newNode.IsText) {
NestTextNodes(refNode, newNode);
}
else {
newNode.SetParentForLoad(this);
}
}
if (args != null)
doc.AfterEvent( args );
return newNode;
}
示例4: AddNodeForLoad
internal virtual XmlNode AddNodeForLoad(XmlNode node, XmlDocument doc) {
XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad(node, parent);
if (args != null) {
doc.BeforeEvent(args);
}
nodes.Add(node);
node.SetParent(parent);
if (args != null) {
doc.AfterEvent(args);
}
return node;
}
示例5: AppendChildForLoad
//the function is provided only at Load time to speed up Load process
internal virtual XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) {
XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );
if (args != null)
doc.BeforeEvent( args );
XmlLinkedNode newNode = (XmlLinkedNode) newChild;
if (LastNode == null) {
newNode.next = newNode;
}
else {
newNode.next = LastNode.next;
LastNode.next = newNode;
}
LastNode = newNode;
newNode.SetParentForLoad( this );
if (args != null)
doc.AfterEvent( args );
return newNode;
}
示例6: AppendChildForLoad
internal override XmlNode AppendChildForLoad( XmlNode newChild, XmlDocument doc ) {
XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );
if (args != null)
doc.BeforeEvent( args );
XmlLinkedNode newNode = (XmlLinkedNode) newChild;
if (lastChild == null || lastChild == emptyElem) {
newNode.next = newNode;
}
else {
newNode.next = lastChild.next;
lastChild.next = newNode;
}
lastChild = newNode;
newNode.SetParentForLoad( this );
if (args != null)
doc.AfterEvent( args );
return newNode;
}