Class Notebook

Class Notebook

名称: Aspose.Note 合計: Aspose.Note.dll (25.4.0)

Aspose.Note ノートブックを表示します。

public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable
{
    public void Add(inotebookchildnode childNode)
    {
        _children.Add(childNode);
    }
    public void Remove(inotebookchildnode childNode)
    {
        _children.Remove(childNode);
    }
    public bool Contains(inotebookchildnode childNode)
    {
        return _children.Contains(childNode);
    }
    IEnumerator IEnumerable.GetEnumerator()
    {
        foreach (var child in _children)
            yield return child;
    }
    IEnumerator<inotebookchildnode> IEnumerable<inotebookchildnode>.GetEnumerator()
    {
        foreach (var child in _children)
            yield return child;
    }
    private List<inotebookchildnode> _children = new List<inotebookchildnode>();
}

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

ノートブックを保存する方法を教えてください。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook();
   dataDir += "test_out.onetoc2";
   notebook.Save(dataDir);

ノートブックをPDF形式で保存する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
   dataDir += "ConvertToPDF_out.pdf";
   notebook.Save(dataDir);

ノートブックを画像として保存する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
   dataDir += "ConvertToImage_out.png";
   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);
   }

フラットされたノートブックをPDF形式で保存する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
   dataDir += "ConvertToPDFAsFlattened_out.pdf";
   notebook.Save(
       dataDir,
       new NotebookPdfSaveOptions
       {
           Flatten = true
       });

ノートブックの文書を通じてイテラする方法を示し、それらを軽く充電します。

string inputFile = "Notizbuch öffnen.onetoc2";
   string dataDir = RunExamples.GetDataDir_NoteBook();
   Notebook notebook = new Notebook(dataDir + inputFile);
   foreach (var notebookChildNode in notebook.OfType<Document>())
   {
   }

新しいセクションをノートブックに追加する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
   notebook.AppendChild(new Document(dataDir + "Neuer Abschnitt 1.one"));
   dataDir += @"\AddChildNode_out.onetoc2";
   notebook.Save(dataDir);

ストリームからノートブックを充電する方法を示します。

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");

暗号化されたノートブックを作る方法を示す。

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" });

指定されたオプションでノートブックを画像として保存する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
   var notebookSaveOptions = new NotebookImageSaveOptions { SaveFormat = SaveFormat.Png };
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.Resolution = 400;
   dataDir += "ConvertToImageWithOptions_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

画像としてフラットされたノートブックを保存する方法を示します。

string dataDir = RunExamples.GetDataDir_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 += "ConvertToImageAsFlattenedNotebook_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

ノートブックからセクションを削除する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "test.onetoc2");
   foreach (var child in new List<inotebookchildnode>(notebook))
   {
       if (child.DisplayName == "Remove Me")
       {
           notebook.RemoveChild(child);
       }
   }
   dataDir = dataDir + "RemoveChildNode_out.onetoc2";
   notebook.Save(dataDir);

ノートブックのプレロードドキュメントを通じてイーターする方法を示します。

NotebookLoadOptions loadOptions = new NotebookLoadOptions { InstantLoading = true };
   string inputFile = "Notizbuch öffnen.onetoc2";
   string dataDir = RunExamples.GetDataDir_NoteBook();
   Notebook notebook = new Notebook(dataDir + inputFile, loadOptions);
   foreach (INotebookChildNode notebookChildNode in notebook.OfType<Document>())
   {
   }

ノートブックのコンテンツを通過する方法を示します。

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)
           {
           }
           else if (notebookChildNode is Notebook)
           {
           }
       }
   }
   catch (Exception ex)
   {
       Console.WriteLine(ex.Message);
   }

Constructors

ノートブック( )

Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。

public Notebook()
   {
   }

ノートブック(ストリング)

Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ファイルから既存の OneNote ノートブックを開きます。

public Notebook(string filePath)
   {
   }

Parameters

filePath string

ファイルパス

ノートブック(ストリング、NotebookLoadOptions)

Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ファイルから既存の OneNote ノートブックを開きます. 子供のロード戦略(「ラジー」/インスタント)などの追加のオプションを指定することを可能にします。

public Notebook(string filePath, NotebookLoadOptions loadOptions)
   {
   }

Parameters

filePath string

ファイルパス

loadOptions NotebookLoadOptions

負荷の選択肢

ノートブック(ストリーム)

Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。流れから既存の OneNote ノートブックを開きます。

public class Notebook
   {
      public Notebook(Stream stream)
      {
      }
   }

Parameters

stream Stream

流れです。

Notebook(ストリーム、ノートブックロードオプション)

Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ストリームから既存の OneNote ノートブックを開きます. 追加の充電オプションを指定できます。

public Notebook(Stream stream, NotebookLoadOptions loadOptions)
   {
   }

Parameters

stream Stream

流れです。

loadOptions NotebookLoadOptions

負荷の選択肢

Properties

Color

色を入れるか、色を入れるか。

public Color Color
   {
      get
      {
         return this.Color;
      }
      set
      {
         this.Color = value;
      }
   }

不動産価値

Color

Count

Aspose.Note.ノートブックに含まれる要素の数を取得します。

public int Count
   {
      get;
   }

不動産価値

int

DisplayName

受信または表示名を設定します。

public string DisplayName
   {
      get;
      set;
   }

不動産価値

string

Examples

ノートブックからセクションを削除する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "test.onetoc2");
   foreach (var child in new List<InotebookChildNode>(notebook))
   {
      if (child.DisplayName == "Remove Me")
      {
         notebook.RemoveChild(child);
      }
   }
   dataDir = dataDir + "RemoveChildNode_out.onetoc2";
   notebook.Save(dataDir);
Notes:

FileFormat

ファイル形式を取得する(OneNote 2010, OneNota Online)

public FileFormat FileFormat
   {
      get;
   }

不動産価値

FileFormat

Guid

オブジェクトのグローバルでユニークなIDを取得します。

public Guid Guid
   {
      get;
   }

不動産価値

Guid

IsHistoryEnabled

歴史が有効であるかどうかを示す値を取得または設定します。

public bool IsHistoryEnabled
   {
      get;
      set;
   }

不動産価値

bool

この[入り)

子どものノートノードが指数によって得られる。

public INotebookChildNode this[int index]
   {
      get;
   }

不動産価値

INotebookChildNode

Methods

アフィリエイト(INotebookChildNode)

ノードをリストの終わりに追加します。

public INotebookChildNode AppendChild(INotebookChildNode newChild)
   {
      return _notebook.AppendChild(newChild);
   }

Parameters

newChild INotebookChildNode

ノードを追加します。

Returns

INotebookChildNode

追加ノードです。

GetChildNodes()

すべての子どものノードをノートタイプによって取得します。

public IList<T1> GetChildNodes<T1>() where T1 : Node
    {
    }

Returns

IList

子どものノードのリスト

タイプパラメーター

T1

返品リストの要素の種類

編集者( )

Aspose.Note.ノートブックの子どものノードを通してイテラするリストを返します。

public IEnumerator<notebookchildnode> GetEnumerator()
   {
   }

Returns

IEnumerator < INotebookChildNode >

システム・コレクション・IEnumerator

LoadChildDocument(ストリング)

子どものドキュメントノードを追加します。ファイルから既存の OneNote ドキュメントを開きます。

public void LoadChildDocument(string filePath)
   {
   }

Parameters

filePath string

ファイルパス

Examples

ストリームからノートブックを充電する方法を示します。

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, Aspose.Words.LoadOptions loadOptions)
   {
   }

Parameters

filePath string

ファイルパス

loadOptions LoadOptions

負荷の選択肢

LoadChildDocument(ストリーム)

子どものドキュメントノードを追加します。ストリームから既存の OneNote ドキュメントを開きます。

public void LoadChildDocument(Stream stream)
   {
   }

Parameters

stream Stream

流れです。

Examples

ストリームからノートブックを充電する方法を示します。

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(ストリング、ノートブックLoadOptions)

子どものノートノードを追加します。ファイルから既存の OneNote ノートブックを開きます. 追加のロードオプションを指定できます。

public void LoadChildNotebook(string filePath, NotebookLoadOptions loadOptions)
   {
   }

Parameters

filePath string

ファイルパス

loadOptions NotebookLoadOptions

負荷の選択肢

LoadChildNotebook(ストリーム)

子どものノートノードを追加します。流れから既存の OneNote ノートブックを開きます。

public void LoadChildNotebook(Stream stream)
   {
   }

Parameters

stream Stream

流れです。

LoadChildNotebook(ストリーム、ノートブックLoadOptions)

子どものノートノードを追加します。ストリームから既存の OneNote ノートブックを開きます. 追加のロードオプションを指定できます。

public void LoadChildNotebook(Stream stream, NotebookLoadOptions loadOptions)
   {
   }

Parameters

stream Stream

流れです。

loadOptions NotebookLoadOptions

負荷の選択肢

RemoveChild(インテブックチルドノード)

子どものノードを取り除く。

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);
   }

ノートブックからセクションを削除する方法を示します。

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "test.onetoc2");
   foreach (var child in new List<inotebookchildnode>(notebook))
   {
      if (child.DisplayName == "Remove Me")
      {
         notebook.RemoveChild(child);
      }
   }
   dataDir = dataDir + "RemoveChildNode_out.onetoc2";
   notebook.Save(dataDir);

ノートブックを保存する方法を教えてください。

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 + "NotLocked_out.one");
      var childDocument1 = notebook[1] as Document;
      childDocument1.Save(dataDir + "LockedPass1_out.one", new OneSaveOptions() { DocumentPassword = "pass" });
      var childDocument2 = notebook[2] as Document;
      childDocument2.Save(dataDir + "LockedPass2_out.one", new OneSaveOptions() { DocumentPassword = "pass2" });
   }

リリース(ストリング)

OneNote ドキュメントをファイルに保存します。

public void Save(string fileName)
   {
   }

Parameters

fileName string

ファイルの完全名:指定された完全名前を含むファイルがすでに存在する場合、既存のファイルは書き換えられます。

Exceptions

IncorrectDocumentStructureException

文書構造は規格に違反する。

UnsupportedSaveFormatException

リクエストされた保存形式はサポートされません。

ストリーム(Save)

OneNote ドキュメントをストリームに保存します。

public void Save(Stream stream)
   {
   }

Parameters

stream Stream

流れです。

Exceptions

IncorrectDocumentStructureException

文書構造は規格に違反する。

UnsupportedSaveFormatException

リクエストされた保存形式はサポートされません。

Save(ストリング、SaveFormat)

OneNote ドキュメントを指定された形式のファイルに保存します。

public void Save(string fileName, Aspose.Words.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

リクエストされた保存形式はサポートされません。

保存(ストリング、ノートブック保存オプション)

OneNote ドキュメントを指定された保存オプションを使用してファイルに保存します。

public void Save(string fileName, NotebookSaveOptions options)
   {
   }

Parameters

fileName string

ファイルの完全名:指定された完全名前を含むファイルがすでに存在する場合、既存のファイルは書き換えられます。

options NotebookSaveOptions

ドキュメントがファイルに保存されている方法のオプションを指定します。

Exceptions

IncorrectDocumentStructureException

文書構造は規格に違反する。

UnsupportedSaveFormatException

リクエストされた保存形式はサポートされません。

Save(ストリーム、ノートブックSaveOptions)

OneNote ドキュメントを指定された保存オプションを使用してストリームに保存します。

public void Save(Stream stream, NotebookSaveOptions options)
   {
   }

Parameters

stream Stream

流れです。

options NotebookSaveOptions

文書を保存する方法のオプションを指定します。

Exceptions

IncorrectDocumentStructureException

文書構造は規格に違反する。

UnsupportedSaveFormatException

リクエストされた保存形式はサポートされません。

 日本語