OutlineElement.NumberList
OutlineElement.NumberList property
Mendapat atau mengatur gaya untuk header daftar bernomor.
public NumberList NumberList { get; set; }
Contoh
Memperlihatkan cara mengambil informasi tentang pemformatan daftar.
string dataDir = RunExamples.GetDataDir_Text();
// Muat dokumen ke Aspose.Note.
Document oneFile = new Document(dataDir + "ApplyNumberingOnText.one");
// Ambil kumpulan simpul dari elemen kerangka
IList<OutlineElement> nodes = oneFile.GetChildNodes<OutlineElement>();
// Iterasi melalui setiap node
foreach (OutlineElement node in nodes)
{
if (node.NumberList != null)
{
NumberList list = node.NumberList;
// Ambil nama font
Console.WriteLine("Font Name: " + list.Font);
// Ambil panjang font
Console.WriteLine("Font Length: " + list.Font.Length);
// Ambil ukuran font
Console.WriteLine("Font Size: " + list.FontSize);
// Ambil warna font
Console.WriteLine("Font Color: " + list.FontColor);
// Ambil format
Console.WriteLine("Font format: " + list.Format);
// Centang tebal
Console.WriteLine("Is bold: " + list.IsBold);
// Centang miring
Console.WriteLine("Is italic: " + list.IsItalic);
Console.WriteLine();
}
}
Menunjukkan cara menyisipkan daftar baru dengan penomoran Cina.
string dataDir = RunExamples.GetDataDir_Text();
// Inisialisasi dokumen OneNote
Aspose.Note.Document doc = new Aspose.Note.Document();
// Inisialisasi halaman OneNote
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
// Terapkan pengaturan gaya teks
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// Angka dalam kerangka yang sama secara otomatis bertambah.
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
//------------------------
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
//------------------------
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
//------------------------
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
// Simpan dokumen OneNote
dataDir = dataDir + "InsertChineseNumberList_out.one";
doc.Save(dataDir);
Menunjukkan cara menyisipkan lis berpoin baru.
string dataDir = RunExamples.GetDataDir_Text();
// Buat objek dari kelas Dokumen
Aspose.Note.Document doc = new Aspose.Note.Document();
// Inisialisasi objek kelas Halaman
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Inisialisasi objek kelas Outline
Outline outline = new Outline(doc);
// Inisialisasi objek kelas TextStyle dan atur properti pemformatan
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// Menginisialisasi objek kelas OutlineElement dan menerapkan peluru
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
// Inisialisasi objek kelas RichText dan terapkan gaya teks
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
// Tambahkan elemen kerangka
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// Tambahkan simpul Outline
page.AppendChildLast(outline);
// Tambahkan simpul Halaman
doc.AppendChildLast(page);
// Simpan dokumen OneNote
dataDir = dataDir + "ApplyBulletsOnText_out.one";
doc.Save(dataDir);
Menunjukkan cara menyisipkan daftar baru dengan penomoran.
string dataDir = RunExamples.GetDataDir_Text();
// Buat objek dari kelas Dokumen
Document doc = new Document();
// Inisialisasi objek kelas Halaman
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Inisialisasi objek kelas Outline
Outline outline = new Outline(doc);
// Inisialisasi objek kelas TextStyle dan atur properti pemformatan
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// Menginisialisasi objek kelas OutlineElement dan menerapkan penomoran
// Angka dalam kerangka yang sama secara otomatis bertambah.
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
// Tambahkan elemen kerangka
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// Tambahkan simpul Outline
page.AppendChildLast(outline);
// Tambahkan simpul Halaman
doc.AppendChildLast(page);
// Simpan dokumen OneNote
dataDir = dataDir + "ApplyNumberingOnText_out.one";
doc.Save(dataDir);
Lihat juga
- class NumberList
- class OutlineElement
- ruang nama Aspose.Note
- perakitan Aspose.Note