本文整理汇总了C#中System.Xml.XmlTextWriter.WriteCharEntity方法的典型用法代码示例。如果您正苦于以下问题:C# XmlTextWriter.WriteCharEntity方法的具体用法?C# XmlTextWriter.WriteCharEntity怎么用?C# XmlTextWriter.WriteCharEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlTextWriter
的用法示例。
在下文中一共展示了XmlTextWriter.WriteCharEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
//.........这里部分代码省略.........
if (!(tag is DepthNoteTag) && NoteTagTable.TagIsSerializable(tag)) {
WriteTag (tag, xml, true);
tag_stack.Push (tag);
}
}
}
// Reopen tags that continued across indented lines
// or into or out of lines with a depth
while (continue_stack.Count > 0 &&
((depth_tag == null && iter.StartsLine ()) || iter.LineOffset == 1))
{
Gtk.TextTag continue_tag = continue_stack.Pop();
if (!TagEndsHere (continue_tag, iter, next_iter)
&& iter.HasTag (continue_tag))
{
WriteTag (continue_tag, xml, true);
tag_stack.Push (continue_tag);
}
}
// Hidden character representing an anchor
if (iter.Char[0] == (char) 0xFFFC) {
Logger.Info ("Got child anchor!");
if (iter.ChildAnchor != null) {
string serialize =
(string) iter.ChildAnchor.Data ["serialize"];
if (serialize != null)
xml.WriteRaw (serialize);
}
// Line Separator character
} else if (iter.Char == "\u2028") {
xml.WriteCharEntity ('\u2028');
} else if (depth_tag == null) {
xml.WriteString (iter.Char);
}
bool end_of_depth_line = line_has_depth && next_iter.EndsLine ();
bool next_line_has_depth = false;
if (iter.Line < buffer.LineCount - 1) {
Gtk.TextIter next_line = buffer.GetIterAtLine(iter.Line+1);
next_line_has_depth =
((NoteBuffer)buffer).FindDepthTag (next_line) != null;
}
bool at_empty_line = iter.EndsLine () && iter.StartsLine ();
if (end_of_depth_line ||
(next_line_has_depth && (next_iter.EndsLine () || at_empty_line)))
{
// Close all tags in the tag_stack
while (tag_stack.Count > 0) {
Gtk.TextTag existing_tag = tag_stack.Pop ();
// Any tags which continue across the indented
// line are added to the continue_stack to be
// reopened at the start of the next <list-item>
if (!TagEndsHere (existing_tag, iter, next_iter)) {
continue_stack.Push (existing_tag);
}
WriteTag (existing_tag, xml, false);
}
} else {