Node — Aspose.Note FOSS for Python API Reference
מחלקה: Node
ImageRenderOptions: aspose.note ImageRenderOptions: from aspose.note import Node
Node הוא המחלקה הבסיסית המופשטת לכל אלמנט במודל האובייקטים של מסמך OneNote. כל סוגי הצמתים הקונקרטיים (Document, Page, Outline, OutlineElement, RichText, Image, AttachedFile, וכו’) ירש מ Node. אתה אף פעם לא יוצר מופע Node בישירות.
ImageRenderOptions
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|---|
ParentNode | `Node | None` | ImageRenderOptions |
Document | `Document | None` | ImageRenderOptions |
ImageRenderOptions
Accept(visitor)
node.Accept(visitor: DocumentVisitor) -> Noneמשגר את המתאים VisitXxxStart / VisitXxxEnd מתודות על המבקר עבור סוג הצומת הזה. השתמש ב‑override במחלקות המשנה כדי ליישם double-dispatch.
דוגמת שימוש
בדוק את מיקום כל צומת בעץ
from aspose.note import Document, RichText
doc = Document("MyNotes.one")
for rt in doc.GetChildNodes(RichText):
# Every RichText is a Node — access parent and document via Node properties
print(f"Document : {rt.Document is doc}")
if rt.ParentNode is not None:
print(f"Parent : {type(rt.ParentNode).__name__}")
print()בטיחות מפני None
ParentNode הוא None רק לשורש Document. Document הוא None רק כאשר צומת נוצר אך עדיין לא מחובר לעץ המסמך.
ראה גם
- CompositeNode: extends
Nodeעם ניהול ילדים - DocumentVisitor: מעבר של Visitor pattern
- ImageRenderOptions: מחלקת מסמך שורש
- מדריך למפתחים