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

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

Creates the X link.
public CreateXLink ( IDocument document, XmlNode node ) : XLink
document IDocument The document.
node System.Xml.XmlNode The node.
Результат AODL.Document.Content.Text.XLink
		public XLink CreateXLink(IDocument document, XmlNode node)
		{
			try
			{
				XLink xlink				= new XLink(document);
				xlink.Node				= node.CloneNode(true);
				ITextCollection iTxtCol	= new ITextCollection();

				foreach(XmlNode nodeText in xlink.Node.ChildNodes)
				{
					IText iText			= this.CreateTextObject(xlink.Document, nodeText);
					if (iText != null)
						iTxtCol.Add(iText);
				}

				xlink.Node.InnerXml		= "";

				foreach(IText iText in iTxtCol)
					xlink.TextContent.Add(iText);

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

Usage Example

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

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

			return xLinkClone;
		}