Class Notebook
名称: Aspose.Note 合計: Aspose.Note.dll (25.4.0)
WL31_ ノートブックを表示します。
public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable
Inheritance
Implements
INotebookChildNode
,
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.ノートブッククラスの新しいインスタンスを開始します。
public Notebook()
Notebook(ストレッチ)
Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ファイルから既存の OneNote ノートブックを開きます。
public Notebook(string filePath)
Parameters
filePath
string
ファイルパス
Notebook(タイトル:NotebookLoadOptions)
Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ファイルから既存の OneNote ノートブックを開きます. 子供のロード戦略(「ラジー」/インスタント)などの追加のオプションを指定することを可能にします。
public Notebook(string filePath, NotebookLoadOptions loadOptions)
Parameters
filePath
string
ファイルパス
loadOptions
NotebookLoadOptions
負荷の選択肢
Notebook(Stream)
Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。流れから既存の OneNote ノートブックを開きます。
public Notebook(Stream stream)
Parameters
stream
Stream
流れです。
Notebook(ストリーム、ノートブックLoadOptions)
Aspose.Note.ノートブッククラスの新しいインスタンスを開始します。ストリームから既存の OneNote ノートブックを開きます. 追加の充電オプションを指定できます。
public Notebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
流れです。
loadOptions
NotebookLoadOptions
負荷の選択肢
Properties
Color
色を入れるか、色を入れるか。
public Color Color { get; set; }
不動産価値
Count
Aspose.Note.ノートブックに含まれる要素の数を取得します。
public int Count { get; }
不動産価値
DisplayName
受信または表示名を設定します。
public string DisplayName { get; set; }
不動産価値
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; }
不動産価値
Guid
オブジェクトのグローバルでユニークなIDを取得します。
public Guid Guid { get; }
不動産価値
IsHistoryEnabled
歴史が有効であるかどうかを示す値を取得または設定します。
public bool IsHistoryEnabled { get; set; }
不動産価値
この[インタ]
子どものノートノードが指数によって得られる。
public INotebookChildNode this[int index] { get; }
不動産価値
Methods
AppendChild(タイトル:ChildNode)
ノードをリストの終わりに追加します。
public INotebookChildNode AppendChild(INotebookChildNode newChild)
Parameters
newChild
INotebookChildNode
ノードを追加します。
Returns
追加ノードです。
トップページ > T1>()
すべての子どものノードをノートタイプによって取得します。
public IList<t1> GetChildNodes<t1>() where T1 : Node
Returns
子どものノードのリスト
タイプパラメーター
T1
返品リストの要素の種類
GetEnumerator()
Aspose.Note.ノートブックの子どものノードを通してイテラするリストを返します。
public IEnumerator<inotebookchildnode> GetEnumerator()
Returns
IEnumerator < 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(ストリーム、ノートブックLoadOptions)
子どものノートノードを追加します。ストリームから既存の OneNote ノートブックを開きます. 追加のロードオプションを指定できます。
public void LoadChildNotebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
流れです。
loadOptions
NotebookLoadOptions
負荷の選択肢
RemoveChild(タイトル:ChildNode)
子どものノードを取り除く。
public INotebookChildNode RemoveChild(INotebookChildNode oldChild)
Parameters
oldChild
INotebookChildNode
ノードを取り除く。
Returns
削除されたノード。
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(ストリーム、ノートブックSaveOptions)
OneNote ドキュメントを指定された保存オプションを使用してストリームに保存します。
public void Save(Stream stream, NotebookSaveOptions options)
Parameters
stream
Stream
流れです。
options
NotebookSaveOptions
文書を保存する方法のオプションを指定します。
Exceptions
IncorrectDocumentStructureException
文書構造は規格に違反する。
UnsupportedSaveFormatException
リクエストされた保存形式はサポートされません。