當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlTextWriter.WriteCharEntity方法代碼示例

本文整理匯總了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 {
開發者ID:MatteoNardi,項目名稱:Tomboy,代碼行數:67,代碼來源:NoteBuffer.cs


注:本文中的System.Xml.XmlTextWriter.WriteCharEntity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。