AODL.Document.Import.OpenDocument.NodeProcessors.TextContentProcessor.CreateBookmark C# (CSharp) Метод

CreateBookmark() публичный Метод

Creates the bookmark.
public CreateBookmark ( IDocument document, XmlNode node, BookmarkType type ) : Bookmark
document IDocument The document.
node System.Xml.XmlNode The node.
type BookmarkType The type.
Результат AODL.Document.Content.Text.Indexes.Bookmark
		public Bookmark CreateBookmark(IDocument document,XmlNode node, BookmarkType type)
		{
			try
			{
				Bookmark bookmark		= null;
				if (type == BookmarkType.Standard)
					bookmark			= new Bookmark(document, BookmarkType.Standard, "noname");
				else if (type == BookmarkType.Start)
					bookmark			= new Bookmark(document, BookmarkType.Start, "noname");
				else
					bookmark			= new Bookmark(document, BookmarkType.End, "noname");

				bookmark.Node			= node.CloneNode(true);

				return bookmark;
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to create a Bookmark.", ex);
			}
		}

Usage Example

Пример #1
0
		/// <summary>
		/// Create a deep clone of this Bookmark object.
		/// </summary>
		/// <remarks>A possible Attached Style wouldn't be cloned!</remarks>
		/// <returns>
		/// A clone of this object.
		/// </returns>
		public object Clone()
		{
			Bookmark bookmarkClone			= null;

			if (this.Document != null && this.Node != null)
			{
				TextContentProcessor tcp	= new TextContentProcessor();
				bookmarkClone				= tcp.CreateBookmark(
					this.Document, this.Node.CloneNode(true), this.BookmarkType);
			}

			return bookmarkClone;
		}