Class Notebook
İsim alanı : Aspose.Note Toplama: Aspose.Note.dll (25.4.0)
Bir Aspose.Note dizüstü bilgisayarı temsil eder.
public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable
Inheritance
Implements
INotebookChildNode
,
IEnumerable
mirasçı üyeleri
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Not defterini nasıl kurtaracağınızı gösterin.
// 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);
Not defterini PDF formatında nasıl kaydeteceğinizi gösterin.
// 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);
Not defterini resim olarak nasıl kaydedeceğinizi gösterin.
// 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);
Tüm metinleri bir dizüstü bilgisayardan nasıl elde edeceğinizi gösterin.
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 formatında kaydedilen not defterini nasıl kaydeteceğinizi gösterir.
// 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
});
Bir dizüstü bilgisayarın belgeleriyle iterasyon yapmanın yollarını gösterir ve bunları yumuşak bir şekilde yüklenir.
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>
Bir dizüstü bilgisayara yeni bir bölüm nasıl eklendiğini gösterir.
// 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);
Not defterini bir akımdan nasıl yüklediğini gösterir.
// 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");
Şifreli bir dizüstü bilgisayara nasıl girilir.
// 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" });
Belirlenen seçeneklerle dizüstü bilgisayarı resim olarak nasıl kaydedeceğinizi gösterir.
// 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);
Görüntü olarak bir dizüstü bilgisayarı nasıl kaydeteceğini gösterir.
// 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);
Bir dizüstü bilgisayardan bir bölüm nasıl kaldırılacağını gösterir.
// 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>
Bir dizüstü bilgisayardan önceden yüklü belgeler aracılığıyla iterasyon yapmanın yollarını gösterir.
// 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>
Bir dizüstü bilgisayardan nasıl geçeceğinizi gösterir.
// 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 sınıfının yeni bir örneğini başlatır.
public Notebook()
Notebook(Sırt)
Aspose.Note.Notebook sınıfının yeni bir örneğini başlatır.Bir dosyadan mevcut OneNote dizüstü bilgisayarı açılır.
public Notebook(string filePath)
Parameters
filePath
string
Dosya Yolu.
Notebook(Çerçeve, NotebookLoadOptions)
Aspose.Note.Notebook sınıfının yeni bir örneğini başlatır.Bir dosyadan mevcut bir OneNote dizüstü bilgisayarı açılır. bir çocuk yükleme stratejisi gibi ek seçenekleri belirtmek için izin verir (“lazy” / anında).
public Notebook(string filePath, NotebookLoadOptions loadOptions)
Parameters
filePath
string
Dosya Yolu.
loadOptions
NotebookLoadOptions
Yükleme seçenekleri için.
Notebook(Stream)
Aspose.Note.Notebook sınıfının yeni bir örneğini başlatır.Bir akımdan mevcut bir OneNote dizüstü bilgisayarı açılır.
public Notebook(Stream stream)
Parameters
stream
Stream
akış için.
Notebook(Akış, NotebookLoadOptions)
Aspose.Note.Notebook sınıfının yeni bir örneğini başlatır.Bir akımdan mevcut bir OneNote dizüstü bilgisayarı açılır. ek yükleme seçeneklerini belirtmek için izin verir.
public Notebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
akış için.
loadOptions
NotebookLoadOptions
Yükleme seçenekleri için.
Properties
Color
Renk alır ya da koyar.
public Color Color { get; set; }
Mülkiyet Değer
Count
Aspose.Note.Notebook’da yer alan öğelerin sayısını alır.
public int Count { get; }
Mülkiyet Değer
DisplayName
Görüntüleme adı alın veya ayarlayın.
public string DisplayName { get; set; }
Mülkiyet Değer
Examples
Bir dizüstü bilgisayardan bir bölüm nasıl kaldırılacağını gösterir.
// 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
Dosya biçimi (OneNote 2010, OneNota Online)
public FileFormat FileFormat { get; }
Mülkiyet Değer
Guid
Bir nesnenin küresel olarak benzersiz kimliğini alır.
public Guid Guid { get; }
Mülkiyet Değer
IsHistoryEnabled
Tarih etkin olup olmadığını gösteren bir değer alır veya ayarlar.
public bool IsHistoryEnabled { get; set; }
Mülkiyet Değer
bu[int ile]
Not defteri çocuk düğmesi verilen endeks tarafından alınır.
public INotebookChildNode this[int index] { get; }
Mülkiyet Değer
Methods
AppendChild(Kitap YazılarıChildNode)
Listenin sonuna kadar düğmeyi ekleyin.
public INotebookChildNode AppendChild(INotebookChildNode newChild)
Parameters
newChild
INotebookChildNode
eklemek için düğme.
Returns
eklenen düğüm.
GetChildNodes<t1 için>()
Çocuğun tüm düğüm türüne göre alın.
public IList<t1> GetChildNodes<t1>() where T1 : Node
Returns
Çocuk düğümlerinin bir listesi.
Parametreler türü
T1
Geri gönderilen listedeki öğelerin türü.
GetEnumerator()
Aspose.Note.Notebook’un çocuk düğümleri aracılığıyla iterasyon yapan bir listelemeyi geri getirir.
public IEnumerator<inotebookchildnode> GetEnumerator()
Returns
IEnumerator < için; INotebookChildNode >
Bir Sistem.Koleksiyonlar.IEnumerator
LoadChildDocument(Sırt)
Bir çocuk belge düğmesi ekleyin.Bir dosyadan mevcut bir OneNote belgesini açın.
public void LoadChildDocument(string filePath)
Parameters
filePath
string
Dosya Yolu.
Examples
Not defterini bir akımdan nasıl yüklediğini gösterir.
// 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(Çerçeve, LoadOptions)
Bir çocuk belge düğmesi ekleyin.Bir dosyadan mevcut bir OneNote belgesini açılır. ek yükleme seçeneklerini belirtmek için izin verir.
public void LoadChildDocument(string filePath, LoadOptions loadOptions)
Parameters
filePath
string
Dosya Yolu.
loadOptions
LoadOptions
Yükleme seçenekleri için.
LoadChildDocument(Stream)
Bir çocuk belge düğmesi ekleyin.Bir akımdan mevcut bir OneNote belgesini açın.
public void LoadChildDocument(Stream stream)
Parameters
stream
Stream
akış için.
Examples
Not defterini bir akımdan nasıl yüklediğini gösterir.
// 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(Çıkış, LoadOptions)
Bir çocuk belge düğmesi ekleyin.Bir akımdan mevcut bir OneNote belgesini açır. ek yükleme seçeneklerini belirtmek için izin verir.
public void LoadChildDocument(Stream stream, LoadOptions loadOptions)
Parameters
stream
Stream
akış için.
loadOptions
LoadOptions
Yükleme seçenekleri için.
LoadChildNotebook(Sırt)
Bir çocuk dizüstü bilgisayarı bağlayın.Bir dosyadan mevcut OneNote dizüstü bilgisayarı açılır.
public void LoadChildNotebook(string filePath)
Parameters
filePath
string
Dosya Yolu.
LoadChildNotebook(Çerçeve, NotebookLoadOptions)
Bir çocuk dizüstü bilgisayarı bağlayın.Bir dosyadan mevcut bir OneNote dizüstü bilgisayarı açılır. ek yükleme seçeneklerini belirtmek için izin verir.
public void LoadChildNotebook(string filePath, NotebookLoadOptions loadOptions)
Parameters
filePath
string
Dosya Yolu.
loadOptions
NotebookLoadOptions
Yükleme seçenekleri için.
LoadChildNotebook(Stream)
Bir çocuk dizüstü bilgisayarı bağlayın.Bir akımdan mevcut bir OneNote dizüstü bilgisayarı açılır.
public void LoadChildNotebook(Stream stream)
Parameters
stream
Stream
akış için.
LoadChildNotebook(Akış, NotebookLoadOptions)
Bir çocuk dizüstü bilgisayarı bağlayın.Bir akımdan mevcut bir OneNote dizüstü bilgisayarı açılır. ek yükleme seçeneklerini belirtmek için izin verir.
public void LoadChildNotebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
akış için.
loadOptions
NotebookLoadOptions
Yükleme seçenekleri için.
RemoveChild(Kitap YazılarıChildNode)
Çocuğun düğmesini çıkarın.
public INotebookChildNode RemoveChild(INotebookChildNode oldChild)
Parameters
oldChild
INotebookChildNode
kaldırmak için düğme.
Returns
Kaldırılan düğüm.
Examples
Bir dizüstü bilgisayardan tüm bölümlere nasıl erişeceğinizi gösterir.
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>
Bir dizüstü bilgisayardan bir bölüm nasıl kaldırılacağını gösterir.
// 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>
Bir not defterini nasıl kurtaracağınızı gösterin.
// 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(Sırt)
OneNote belgesini bir dosyaya kaydeder.
public void Save(string fileName)
Parameters
fileName
string
Dosya için tam adı. belirtilen tam isimli bir dosya zaten varsa, mevcut dosyayı yeniden yazılır.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.
Save(Stream)
OneNote belgesini bir akışa kaydeder.
public void Save(Stream stream)
Parameters
stream
Stream
akış için.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.
Save(Çerçeve, SaveFormat)
OneNote belgesini belirlenen biçimde bir dosyaya kaydeder.
public void Save(string fileName, SaveFormat format)
Parameters
fileName
string
Dosya için tam adı. belirtilen tam isimli bir dosya zaten varsa, mevcut dosyayı yeniden yazılır.
format
SaveFormat
Belgeyi kaydetmek için hangi biçimde kullanılır.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.
Save(Çıkış, SaveFormat)
OneNote belgesini belirlenen biçimde bir akışa kaydeder.
public void Save(Stream stream, SaveFormat format)
Parameters
stream
Stream
akış için.
format
SaveFormat
Belgeyi kaydetmek için hangi biçimde kullanılır.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.
Save(Çerçeve, NotebookSaveOptions)
OneNote belgesini belirlenen kaydetme seçeneklerini kullanarak bir dosyaya kaydeder.
public void Save(string fileName, NotebookSaveOptions options)
Parameters
fileName
string
Dosya için tam adı. belirtilen tam isimli bir dosya zaten varsa, mevcut dosyayı yeniden yazılır.
options
NotebookSaveOptions
Belgenin dosyaya nasıl kaydedildiği seçenekleri belirler.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.
Save(Akış, NotebookSaveOptions)
OneNote belgesini belirlenen kaydetme seçeneklerini kullanarak bir akışa kaydeder.
public void Save(Stream stream, NotebookSaveOptions options)
Parameters
stream
Stream
akış için.
options
NotebookSaveOptions
Belgenin nasıl kaydedildiği seçenekleri belirleyin.
Exceptions
IncorrectDocumentStructureException
Belge yapısı spesifikasyonu ihlal eder.
UnsupportedSaveFormatException
Talep edilen kaydetme biçimi desteklenmiyor.