Class Notebook

Class Notebook

اسم الفضاء : Aspose.Note تجميع: Aspose.Note.dll (25.4.0)

تمثيل WL31_ الكمبيوتر المحمول.

public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable

Inheritance

object Notebook

Implements

INotebookChildNode , IEnumerable , IEnumerable

الأعضاء الموروثين

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

تعرف على كيفية حفظ الكمبيوتر المحمول

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

                                      var notebook = new Notebook();

                                      dataDir = dataDir + "test_out.onetoc2";

                                      // Save the Notebook
                                      notebook.Save(dataDir);

يظهر كيفية حفظ الكمبيوتر المحمول في تنسيق PDF.

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

                                                    // Load a OneNote Notebook
                                                    var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");

                                                    dataDir = dataDir + "ConvertToPDF_out.pdf";

                                                    // Save the Notebook
                                                    notebook.Save(dataDir);

يظهر كيفية حفظ الكمبيوتر المحمول كصورة.

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

                                               // Load a OneNote Notebook
                                               var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");

                                               dataDir = dataDir + "ConvertToImage_out.png";

                                               // Save the Notebook
                                               notebook.Save(dataDir);

يظهر كيفية الحصول على كل النص من الكمبيوتر المحمول.

string inputFile = "notebook.onetoc2";
                                                     string dataDir = RunExamples.GetDataDir_NoteBook();

                                                     Notebook rootNotebook = new Notebook(dataDir + inputFile);

                                                     IList<richtext> allRichTextNodes = rootNotebook.GetChildNodes<richtext>();
                                                     foreach (RichText richTextNode in allRichTextNodes)
                                                     {
                                                         Console.WriteLine(richTextNode.Text);
                                                     }</richtext></richtext>

يظهر كيفية حفظ الكمبيوتر المحمول في تنسيق PDF.

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

                                                              // Load a OneNote Notebook
                                                              var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");

                                                              // Save the Notebook
                                                              dataDir = dataDir + "ConvertToPDFAsFlattened_out.pdf";
                                                              notebook.Save(
                                                                  dataDir,
                                                                  new NotebookPdfSaveOptions
                                                                  {
                                                                      Flatten = true
                                                                  });

يظهر كيفية التحكم من خلال وثائق الكمبيوتر المحمول تحميلها بسهولة.

string inputFile = "Notizbuch öffnen.onetoc2";
                                                                                    string dataDir = RunExamples.GetDataDir_NoteBook();

                                                                                    // By default children loading is "lazy".
                                                                                    Notebook notebook = new Notebook(dataDir + inputFile);

                                                                                    foreach (var notebookChildNode in notebook.OfType<document>()) 
                                                                                    {
                                                                                        // Actual loading of the child document happens only here.
                                                                                        // Do something with child document
                                                                                    }</document>

يظهر كيفية إضافة قسم جديد إلى الكمبيوتر المحمول.

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

                                                      // Load a OneNote Notebook
                                                      var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");

                                                      // Append a new child to the Notebook
                                                      notebook.AppendChild(new Document(dataDir + "Neuer Abschnitt 1.one"));

                                                      dataDir = dataDir + "AddChildNode_out.onetoc2";

                                                      // Save the Notebook
                                                      notebook.Save(dataDir);

إظهار كيفية تحميل الكمبيوتر المحمول من تدفق.

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

                                                    FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);

                                                    var notebook = new Notebook(stream);

                                                    using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
                                                    {
                                                        notebook.LoadChildDocument(childStream);
                                                    }

                                                    notebook.LoadChildDocument(dataDir + "Sample1.one");

إظهار كيفية وضع الكمبيوتر المحمول المشفر.

// The path to the documents directory.
                                              string dataDir = RunExamples.GetDataDir_NoteBook();
                                              var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = true });

                                              notebook.LoadChildDocument(dataDir + "Aspose.one");  
                                              notebook.LoadChildDocument(dataDir + "Locked Pass1.one", new LoadOptions() { DocumentPassword = "pass" });
                                              notebook.LoadChildDocument(dataDir + "Locked Pass2.one", new LoadOptions() { DocumentPassword = "pass2" });

يظهر كيفية حفظ الكمبيوتر المحمول كصورة مع الخيارات المحددة.

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

                                                                      // Load a OneNote Notebook
                                                                      var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");

                                                                      var notebookSaveOptions = new NotebookImageSaveOptions(SaveFormat.Png);

                                                                      var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;

                                                                      documentSaveOptions.Resolution = 400;

                                                                      dataDir = dataDir + "ConvertToImageWithOptions_out.png";

                                                                      // Save the Notebook
                                                                      notebook.Save(dataDir, notebookSaveOptions);

يظهر كيفية حفظ الكمبيوتر المحمول المسطح كصورة.

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

                                                         // Load a OneNote Notebook
                                                         var notebook = new Notebook(dataDir + "Notizbuch öffnen.onetoc2");

                                                         var notebookSaveOptions = new NotebookImageSaveOptions(SaveFormat.Png);

                                                         var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;

                                                         documentSaveOptions.Resolution = 400;
                                                         notebookSaveOptions.Flatten = true;

                                                         dataDir = dataDir + "ConvertToImageAsFlattenedNotebook_out.png";

                                                         // Save the Notebook
                                                         notebook.Save(dataDir, notebookSaveOptions);

إظهار كيفية إزالة جزء من الكمبيوتر المحمول.

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

                                                         // Load a OneNote Notebook
                                                         var notebook = new Notebook(dataDir + "test.onetoc2");

                                                         // Traverse through its child nodes for searching the desired child item
                                                         foreach (var child in new List<inotebookchildnode>(notebook))
                                                         {
                                                             if (child.DisplayName == "Remove Me")
                                                             {
                                                                 // Remove the Child Item from the Notebook
                                                                 notebook.RemoveChild(child);
                                                             }
                                                         }

                                                         dataDir = dataDir + "RemoveChildNode_out.onetoc2";

                                                         // Save the Notebook
                                                         notebook.Save(dataDir);</inotebookchildnode>

يظهر كيفية إيتير من خلال المستندات المسبقة من الكمبيوتر المحمول.

// By default children loading is "lazy".
                                                                          // Therefore for instant loading has took place,
                                                                          // it is necessary to set the NotebookLoadOptions.InstantLoading flag.
                                                                          NotebookLoadOptions loadOptions = new NotebookLoadOptions { InstantLoading = true };

                                                                          String inputFile = "Notizbuch öffnen.onetoc2";
                                                                          String dataDir = RunExamples.GetDataDir_NoteBook();
                                                                          Notebook notebook = new Notebook(dataDir + inputFile, loadOptions);

                                                                          // All child documents are already loaded.
                                                                          foreach (INotebookChildNode notebookChildNode in notebook.OfType<document>()) 
                                                                          {
                                                                             // Do something with child document
                                                                          }</document>

يظهر كيفية الانتقال من خلال محتوى الكمبيوتر المحمول.

// The path to the documents directory.
                                                           string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
                                                           string fileName = "Open Notebook.onetoc2";
                                                           try
                                                           {
                                                               var notebook = new Notebook(dataDir + fileName);
                                                               foreach (var notebookChildNode in notebook)
                                                               {
                                                                   Console.WriteLine(notebookChildNode.DisplayName);
                                                                   if (notebookChildNode is Document)
                                                                   {
                                                                       // Do something with child document
                                                                   }
                                                                   else if (notebookChildNode is Notebook)
                                                                   {
                                                                       // Do something with child notebook
                                                                   }
                                                               }
                                                           }
                                                           catch (Exception ex)
                                                           {
                                                               Console.WriteLine(ex.Message);
                                                           }

Constructors

Notebook()

يبدأ مثال جديد من فئة Aspose.Note.Notebook.

public Notebook()

Notebook(الستار)

يبدأ مثال جديد من فئة Aspose.Note.Notebook.يفتح دفتر ملاحظات OneNote الحالي من ملف.

public Notebook(string filePath)

Parameters

filePath string

مسار الملفات

Notebook(الكلمات الدلالية, NotebookLoadOptions)

يبدأ مثال جديد من فئة Aspose.Note.Notebook.يفتح الكمبيوتر المحمول OneNote الحالي من ملف يسمح بتحديد خيارات إضافية مثل استراتيجية شحن الأطفال (“مضحك” / فوري).

public Notebook(string filePath, NotebookLoadOptions loadOptions)

Parameters

filePath string

مسار الملفات

loadOptions NotebookLoadOptions

خيارات الحمل .

Notebook(Stream)

يبدأ مثال جديد من فئة Aspose.Note.Notebook.يفتح الكمبيوتر المحمول OneNote الحالي من تدفق.

public Notebook(Stream stream)

Parameters

stream Stream

من التدفق .

Notebook(تداول الخيارات , NotebookLoadOptions)

يبدأ مثال جديد من فئة Aspose.Note.Notebook.يفتح الكمبيوتر المحمول OneNote الحالي من تدفق يسمح بتحديد خيارات الشحن الإضافية.

public Notebook(Stream stream, NotebookLoadOptions loadOptions)

Parameters

stream Stream

من التدفق .

loadOptions NotebookLoadOptions

خيارات الحمل .

Properties

Color

احصل على أو وضع اللون.

public Color Color { get; set; }

قيمة الممتلكات

Color

Count

يحصل على عدد العناصر الموجودة في WL31_.Notebook.

public int Count { get; }

قيمة الممتلكات

int

DisplayName

يحصل أو يضع اسم العرض.

public string DisplayName { get; set; }

قيمة الممتلكات

string

Examples

إظهار كيفية إزالة جزء من الكمبيوتر المحمول.

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

                                                         // Load a OneNote Notebook
                                                         var notebook = new Notebook(dataDir + "test.onetoc2");

                                                         // Traverse through its child nodes for searching the desired child item
                                                         foreach (var child in new List<inotebookchildnode>(notebook))
                                                         {
                                                             if (child.DisplayName == "Remove Me")
                                                             {
                                                                 // Remove the Child Item from the Notebook
                                                                 notebook.RemoveChild(child);
                                                             }
                                                         }

                                                         dataDir = dataDir + "RemoveChildNode_out.onetoc2";

                                                         // Save the Notebook
                                                         notebook.Save(dataDir);</inotebookchildnode>

FileFormat

تحصل على تنسيق الملفات (OneNote 2010، OneNota Online).

public FileFormat FileFormat { get; }

قيمة الممتلكات

FileFormat

Guid

يحصل على الهوية الفريدة عالميا للموضوع.

public Guid Guid { get; }

قيمة الممتلكات

Guid

IsHistoryEnabled

يحصل أو يحدد قيمة تشير إلى ما إذا كانت التاريخ مسموح بها.

public bool IsHistoryEnabled { get; set; }

قيمة الممتلكات

bool

هذا[إنت]

يحصل على عقدة الطفل الكمبيوتر المحمول من خلال المؤشر المحدد.

public INotebookChildNode this[int index] { get; }

قيمة الممتلكات

INotebookChildNode

Methods

AppendChild(فيديوهات متعلقة ChildNode)

إضافة العقد إلى نهاية القائمة.

public INotebookChildNode AppendChild(INotebookChildNode newChild)

Parameters

newChild INotebookChildNode

النقطة التي أضيفها.

Returns

INotebookChildNode

النود المضافة .

GetChildNodes()

احصل على جميع عقدة الطفل حسب نوع العقدة.

public IList<t1> GetChildNodes<t1>() where T1 : Node

Returns

IList

قائمة بأقواس الأطفال.

نوع المعلمات

T1

نوع العناصر في القائمة التي تم إرجاعها.

GetEnumerator()

يعود إلى القائمة التي تتدفق من خلال عقدة الأطفال من Aspose.Note.Notebook.

public IEnumerator<inotebookchildnode> GetEnumerator()

Returns

IEnumerator &lt؛ INotebookChildNode >

فيديوهات متعلقة بـ “ IENUMERATOR ”

LoadChildDocument(الستار)

إضافة عقدة وثيقة طفل.يفتح مستند OneNote الحالي من ملف.

public void LoadChildDocument(string filePath)

Parameters

filePath string

مسار الملفات

Examples

إظهار كيفية تحميل الكمبيوتر المحمول من تدفق.

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

                                                    FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);

                                                    var notebook = new Notebook(stream);

                                                    using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
                                                    {
                                                        notebook.LoadChildDocument(childStream);
                                                    }

                                                    notebook.LoadChildDocument(dataDir + "Sample1.one");

LoadChildDocument(الخصائص، LoadOptions)

إضافة عقدة وثيقة طفل.يفتح مستند OneNote الحالي من ملف يسمح بتحديد خيارات تحميل إضافية.

public void LoadChildDocument(string filePath, LoadOptions loadOptions)

Parameters

filePath string

مسار الملفات

loadOptions LoadOptions

خيارات الحمل .

LoadChildDocument(Stream)

إضافة عقدة وثيقة طفل.يفتح مستند OneNote الحالي من تدفق.

public void LoadChildDocument(Stream stream)

Parameters

stream Stream

من التدفق .

Examples

إظهار كيفية تحميل الكمبيوتر المحمول من تدفق.

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

                                                    FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);

                                                    var notebook = new Notebook(stream);

                                                    using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
                                                    {
                                                        notebook.LoadChildDocument(childStream);
                                                    }

                                                    notebook.LoadChildDocument(dataDir + "Sample1.one");

LoadChildDocument(تداول الخيارات , LoadOptions)

إضافة عقدة وثيقة طفل.يفتح مستند OneNote الحالي من تدفق يسمح بتحديد خيارات تحميل إضافية.

public void LoadChildDocument(Stream stream, LoadOptions loadOptions)

Parameters

stream Stream

من التدفق .

loadOptions LoadOptions

خيارات الحمل .

LoadChildNotebook(الستار)

أضف جهاز كمبيوتر محمول للأطفال.يفتح دفتر ملاحظات OneNote الحالي من ملف.

public void LoadChildNotebook(string filePath)

Parameters

filePath string

مسار الملفات

LoadChildNotebook(الكلمات الدلالية, NotebookLoadOptions)

أضف جهاز كمبيوتر محمول للأطفال.يفتح الكمبيوتر المحمول OneNote الحالي من ملف يسمح بتحديد خيارات تحميل إضافية.

public void LoadChildNotebook(string filePath, NotebookLoadOptions loadOptions)

Parameters

filePath string

مسار الملفات

loadOptions NotebookLoadOptions

خيارات الحمل .

LoadChildNotebook(Stream)

أضف جهاز كمبيوتر محمول للأطفال.يفتح الكمبيوتر المحمول OneNote الحالي من تدفق.

public void LoadChildNotebook(Stream stream)

Parameters

stream Stream

من التدفق .

LoadChildNotebook(تداول الخيارات , NotebookLoadOptions)

أضف جهاز كمبيوتر محمول للأطفال.يفتح الكمبيوتر المحمول OneNote الحالي من تدفق يسمح بتحديد خيارات تحميل إضافية.

public void LoadChildNotebook(Stream stream, NotebookLoadOptions loadOptions)

Parameters

stream Stream

من التدفق .

loadOptions NotebookLoadOptions

خيارات الحمل .

RemoveChild(فيديوهات متعلقة ChildNode)

إزالة عقدة الطفل.

public INotebookChildNode RemoveChild(INotebookChildNode oldChild)

Parameters

oldChild INotebookChildNode

النقطة التي يجب إزالتها

Returns

INotebookChildNode

النواة المحذوفة .

Examples

إظهار كيفية الوصول إلى جميع الأقسام من الكمبيوتر المحمول.

string inputFile = "notebook.onetoc2";
                                                            string dataDir = RunExamples.GetDataDir_NoteBook();

                                                            Notebook rootNotebook = new Notebook(dataDir + inputFile);

                                                            IList<document> allDocuments = rootNotebook.GetChildNodes<document>();
                                                            foreach (Document document in allDocuments) 
                                                            {
                                                                Console.WriteLine(document.DisplayName);
                                                            }</document></document>

إظهار كيفية إزالة جزء من الكمبيوتر المحمول.

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

                                                         // Load a OneNote Notebook
                                                         var notebook = new Notebook(dataDir + "test.onetoc2");

                                                         // Traverse through its child nodes for searching the desired child item
                                                         foreach (var child in new List<inotebookchildnode>(notebook))
                                                         {
                                                             if (child.DisplayName == "Remove Me")
                                                             {
                                                                 // Remove the Child Item from the Notebook
                                                                 notebook.RemoveChild(child);
                                                             }
                                                         }

                                                         dataDir = dataDir + "RemoveChildNode_out.onetoc2";

                                                         // Save the Notebook
                                                         notebook.Save(dataDir);</inotebookchildnode>

يظهر كيفية حفظ الكمبيوتر المحمول

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

                                        var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = false });

                                        notebook.Save(dataDir + "notebook_out.onetoc2", new NotebookOneSaveOptions() { DeferredSaving = true});

                                        if (notebook.Any())
                                        {
                                            var childDocument0 = notebook[0] as Document;

                                            childDocument0.Save(dataDir + "Not Locked_out.one");

                                            var childDocument1 = notebook[1] as Document;

                                            childDocument1.Save(dataDir + "Locked Pass1_out.one", new OneSaveOptions() { DocumentPassword = "pass" });

                                            var childDocument2 = notebook[2] as Document;

                                            childDocument2.Save(dataDir + "Locked Pass2_out.one", new OneSaveOptions() { DocumentPassword = "pass2" });
                                        }

Save(الستار)

حفظ مستند OneNote إلى ملف.

public void Save(string fileName)

Parameters

fileName string

الاسم الكامل للملف.إذا كان هناك بالفعل ملف يحتوي على اسم كامل محدد، يتم إعادة كتابة الملف الحالي.

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

Save(Stream)

تخزين وثيقة OneNote إلى تدفق.

public void Save(Stream stream)

Parameters

stream Stream

من التدفق .

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

Save(أرشيف الوسم : SaveFormat)

تخزين مستند OneNote إلى ملف في التنسيق المحدد.

public void Save(string fileName, SaveFormat format)

Parameters

fileName string

الاسم الكامل للملف.إذا كان هناك بالفعل ملف يحتوي على اسم كامل محدد، يتم إعادة كتابة الملف الحالي.

format SaveFormat

النموذج الذي يمكن حفظ الوثيقة.

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

Save(التداول، SaveFormat)

تخزين وثيقة OneNote إلى تدفق في التنسيق المحدد.

public void Save(Stream stream, SaveFormat format)

Parameters

stream Stream

من التدفق .

format SaveFormat

النموذج الذي يمكن حفظ الوثيقة.

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

Save(الكلمات الدلالية, NotebookSaveOptions)

حفظ مستند OneNote إلى ملف باستخدام خيارات حفظ المحددة.

public void Save(string fileName, NotebookSaveOptions options)

Parameters

fileName string

الاسم الكامل للملف.إذا كان هناك بالفعل ملف يحتوي على اسم كامل محدد، يتم إعادة كتابة الملف الحالي.

options NotebookSaveOptions

يحدد الخيارات كيف يتم حفظ المستند في الملف.

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

Save(تداول العملات الأجنبية, NotebookSaveOptions)

حفظ مستند OneNote إلى تدفق باستخدام خيارات حفظ المحددة.

public void Save(Stream stream, NotebookSaveOptions options)

Parameters

stream Stream

من التدفق .

options NotebookSaveOptions

يحدد الخيارات كيف يتم حفظ الوثيقة.

Exceptions

IncorrectDocumentStructureException

وتخالف هيكل الوثيقة المواصفات.

UnsupportedSaveFormatException

لا يتم دعم النموذج المطلوب.

 عربي