Class CompositeNode

Class CompositeNode

Названий на: Aspose.Note Асамблея: Aspose.Note.dll (25.4.0)

Базовий генеричний клас для вузлів, які можуть містити інші.

public abstract class CompositeNode<t> : CompositeNodeBase, INode, ICompositeNode<t>, ICompositeNode, IEnumerable<t>, IEnumerable where T : INode

Тип параметрів

T

Тип елементів в композитному вузлі.

Inheritance

object Node CompositeNodeBase CompositeNode

Implements

INode , ICompositeNode , ICompositeNode , IEnumerable , IEnumerable

Нападні члени

CompositeNodeBase.GetChildNodes(NodeType) , CompositeNodeBase.GetChildNodes() , CompositeNodeBase.CheckDocument(Node) , Node.Accept(DocumentVisitor) , Node.Document , Node.IsComposite , Node.NodeType , Node.ParentNode , Node.PreviousSibling , Node.NextSibling , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

CompositeNode(NodeType)

Ініціалізація нової інстанції класу Aspose.Note.CompositeNode`1.

protected CompositeNode(NodeType nodeType)

Parameters

nodeType NodeType

Тип вузла.

Properties

FirstChild

Відзначається перший дитячий нід цього ніду.

public T FirstChild { get; }

вартість нерухомості

T

Examples

Показує, як перевірити, чи є сторінка конфліктною сторінкою (тобто вона має зміни, які OneNote не змогла автоматично поєднувати).

string dataDir = RunExamples.GetDataDir_Pages();

                                                                                                                          // Load OneNote document
                                                                                                                          Document doc = new Document(dataDir + "Aspose.one", new LoadOptions { LoadHistory = true });

                                                                                                                          var history = doc.GetPageHistory(doc.FirstChild);
                                                                                                                          for (int i = 0; i &lt; history.Count; i++)
                                                                                                                          {
                                                                                                                              var historyPage = history[i];
                                                                                                                              Console.Write("    {0}. Author: {1}, {2:dd.MM.yyyy hh.mm.ss}",
                                                                                                                                              i,
                                                                                                                                              historyPage.PageContentRevisionSummary.AuthorMostRecent,
                                                                                                                                              historyPage.PageContentRevisionSummary.LastModifiedTime);
                                                                                                                              Console.WriteLine(historyPage.IsConflictPage ? ", IsConflict: true" : string.Empty);

                                                                                                                              // By default conflict pages are just skipped on saving.
                                                                                                                              // If mark it as non-conflict then it will be saved as usual one in the history.
                                                                                                                              if (historyPage.IsConflictPage)
                                                                                                                                  historyPage.IsConflictPage = false;
                                                                                                                          }

                                                                                                                          doc.Save(dataDir + "ConflictPageManipulation_out.one", SaveFormat.One);

IsComposite

Перевірте, чи складається вузол. якщо він правдивий, то у нього можуть бути дитячі вузли.

public override sealed bool IsComposite { get; }

вартість нерухомості

bool

LastChild

Отримайте останній дитячий нід цього ніду.

public T LastChild { get; }

вартість нерухомості

T

Methods

Accept(DocumentVisitor)

Приймає відвідувача ноду.

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

Об’єкт класу, що походить від Aspose.Note.DocumentVisitor.

1 ст. 1 КЗпП>(T1)

Додайте вузол в передній частині списку дитячих вузлів для цього вуза.

public virtual T1 AppendChildFirst<t1>(T1 newChild) where T1 : T

Parameters

newChild T1

Ноутбук для додавання.

Returns

T1

Доданий нод

Тип параметрів

T1

Точний тип прикріпленого ніду.

Наступна статтяУкрзалізниця1>(T1)

Додайте вузол до кінця списку дитячих вузлів для цього вуза.

public virtual T1 AppendChildLast<t1>(T1 newChild) where T1 : T

Parameters

newChild T1

Ноутбук для додавання.

Returns

T1

Доданий нод

Тип параметрів

T1

Точний тип прикріпленого ніду.

GetChildNodes(NodeType)

Знайдіть всі дитячі вузли за типом нігтів.

[Obsolete("Use GetChildNodes<t>() method instead.")]
public override List<inode> GetChildNodes(NodeType type)

Parameters

type NodeType

Тип вузлів .

Returns

List • < INode >

Список дитячих вузлів.

Створення GetChildNodes()

Знайдіть всі дитячі вузли за типом нігтів.

public override List<t1> GetChildNodes<t1>() where T1 : class, INode

Returns

List

Список дитячих вузлів.

Тип параметрів

T1

Тип елементів в поверненому списку.

Examples

Покажіть, як отримати зображення з документа.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     IList<aspose.note.image> nodes = oneFile.GetChildNodes<aspose.note.image>();

                                                     foreach (Aspose.Note.Image image in nodes)
                                                     {
                                                         using (MemoryStream stream = new MemoryStream(image.Bytes))
                                                         {
                                                             using (Bitmap bitMap = new Bitmap(stream))
                                                             {
                                                                 // Save image bytes to a file
                                                                 bitMap.Save(String.Format(dataDir + "{0}", Path.GetFileName(image.FileName)));
                                                             }
                                                         }
                                                     }</aspose.note.image></aspose.note.image>

Показати, як отримати мета-інформацію зображення.

// The path to the documents directory.
                                                     string dataDir = RunExamples.GetDataDir_Images();

                                                     // Load the document into Aspose.Note.
                                                     Document oneFile = new Document(dataDir + "Aspose.one");

                                                     // Get all Image nodes
                                                     IList<aspose.note.image> images = oneFile.GetChildNodes<aspose.note.image>();

                                                     foreach (Aspose.Note.Image image in images)
                                                     {
                                                         Console.WriteLine("Width: {0}", image.Width);
                                                         Console.WriteLine("Height: {0}", image.Height);
                                                         Console.WriteLine("OriginalWidth: {0}", image.OriginalWidth);
                                                         Console.WriteLine("OriginalHeight: {0}", image.OriginalHeight);
                                                         Console.WriteLine("FileName: {0}", image.FileName);
                                                         Console.WriteLine("LastModifiedTime: {0}", image.LastModifiedTime);
                                                         Console.WriteLine();
                                                     }</aspose.note.image></aspose.note.image>

GetEnumerator()

Повертає перелік, який ітеризує через дитячі вузли Aspose.Note.CompositeNode`1.

public IEnumerator<t> GetEnumerator()

Returns

IEnumerator

ІНМУНМЕРАТОР1 for the Aspose.Note.CompositeNode1.

Історія «T1»>(ІНТ, Т1)

Введіть вузол в визначену позицію в список дитячих вузлів для цього вуза.

public virtual T1 InsertChild<t1>(int i, T1 newChild) where T1 : T

Parameters

i int

Позиція для введення

newChild T1

Нод для введення.

Returns

T1

Доданий нод

Тип параметрів

T1

Точний тип вставного ніду.

InsertChildrenRange(ІТ, ІННМЕРАЛЬНИЙ <Т>)

Введіть послідовність вузлів, починаючи з зазначеної позиції, в список дитячих угруповань для цього вуза.

public void InsertChildrenRange(int i, IEnumerable<t> newChildren)

Parameters

i int

Позиція для введення

newChildren IEnumerable

Серія вузлів повинна бути введена.

InsertChildrenRange(ІНТ, Парамс Т[])

Введіть послідовність вузлів, починаючи з зазначеної позиції, в список дитячих угруповань для цього вуза.

public void InsertChildrenRange(int i, params T[] newChildren)

Parameters

i int

Позиція для введення

newChildren Т [ ]

Серія вузлів повинна бути введена.

ЗавантажитиT1>(T1)

Зніміть дитячий вузол.

public T1 RemoveChild<t1>(T1 oldChild) where T1 : T

Parameters

oldChild T1

Нод для зняття.

Returns

T1

Витягнутий вузол

Тип параметрів

T1

Точний тип видаленого вузла.

 Українська