OutlineElement.NumberList
محتويات
[
يخفي
]OutlineElement.NumberList property
الحصول على أو تعيين النمط لرأس القائمة المرقمة.
public NumberList NumberList { get; set; }
أمثلة
يوضح كيفية استرجاع معلومات حول تنسيق القائمة.
string dataDir = RunExamples.GetDataDir_Text();
// حمّل المستند إلى Aspose.Note.
Document oneFile = new Document(dataDir + "ApplyNumberingOnText.one");
// استرجاع مجموعة العقد لعنصر المخطط.
IList<OutlineElement> nodes = oneFile.GetChildNodes<OutlineElement>();
// تكرار عبر كل عقدة
foreach (OutlineElement node in nodes)
{
if (node.NumberList != null)
{
NumberList list = node.NumberList;
// استرجاع اسم الخط
Console.WriteLine("Font Name: " + list.Font);
// استرجاع طول الخط
Console.WriteLine("Font Length: " + list.Font.Length);
// استرجاع حجم الخط
Console.WriteLine("Font Size: " + list.FontSize);
// استرجاع لون الخط
Console.WriteLine("Font Color: " + list.FontColor);
// استرجاع التنسيق
Console.WriteLine("Font format: " + list.Format);
// التحقق من الغامق
Console.WriteLine("Is bold: " + list.IsBold);
// التحقق من المائل
Console.WriteLine("Is italic: " + list.IsItalic);
Console.WriteLine();
}
}
يعرض كيفية إدراج قائمة جديدة بترقيم صيني.
string dataDir = RunExamples.GetDataDir_Text();
// تهيئة مستند OneNote.
Document doc = new Document();
// تهيئة صفحة OneNote.
Page page = new Page();
Outline outline = new Outline();
// تطبيق إعدادات نمط النص.
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// الأرقام في نفس المخطط تُزاد تلقائيًا.
OutlineElement outlineElem1 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text1 = new RichText() { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
//------------------------
OutlineElement outlineElem2 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text2 = new RichText() { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
//------------------------
OutlineElement outlineElem3 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text3 = new RichText() { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
//------------------------
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
// حفظ مستند OneNote.
dataDir = dataDir + "InsertChineseNumberList_out.one";
doc.Save(dataDir);
يعرض كيفية إدراج قائمة نقطية جديدة.
string dataDir = RunExamples.GetDataDir_Text();
// إنشاء كائن من فئة Document
Document doc = new Document();
// تهيئة كائن فئة Page
Page page = new Page();
// تهيئة كائن فئة Outline
Outline outline = new Outline();
// تهيئة كائن الفئة TextStyle وتعيين خصائص التنسيق
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// تهيئة كائنات الفئة OutlineElement وتطبيق النقاط
OutlineElement outlineElem1 = new OutlineElement() { NumberList = new NumberList("*", "Arial", 10) };
// تهيئة كائن الفئة RichText وتطبيق نمط النص
RichText text1 = new RichText() { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement() { NumberList = new NumberList("*", "Arial", 10) };
RichText text2 = new RichText( ) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement() { NumberList = new NumberList("*", "Arial", 10) };
RichText text3 = new RichText() { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
// إضافة عناصر المخطط
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// إضافة عقدة المخطط
page.AppendChildLast(outline);
// إضافة عقدة الصفحة
doc.AppendChildLast(page);
// حفظ مستند OneNote.
dataDir = dataDir + "ApplyBulletsOnText_out.one";
doc.Save(dataDir);
يعرض كيفية إدراج قائمة جديدة مع الترقيم.
string dataDir = RunExamples.GetDataDir_Text();
// إنشاء كائن من فئة Document
Document doc = new Document();
// تهيئة كائن فئة Page
Page page = new Page();
// تهيئة كائن فئة Outline
Outline outline = new Outline();
// تهيئة كائن الفئة TextStyle وتعيين خصائص التنسيق
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// تهيئة كائنات الفئة OutlineElement وتطبيق الترقيم.
// الأرقام في نفس المخطط تُزاد تلقائيًا.
OutlineElement outlineElem1 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text1 = new RichText() { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text2 = new RichText() { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement() { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text3 = new RichText() { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
// إضافة عناصر المخطط
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// إضافة عقدة المخطط
page.AppendChildLast(outline);
// إضافة عقدة الصفحة
doc.AppendChildLast(page);
// حفظ مستند OneNote.
dataDir = dataDir + "ApplyNumberingOnText_out.one";
doc.Save(dataDir);
انظر أيضًا
- class NumberList
- class OutlineElement
- namespace Aspose.Note
- assembly Aspose.Note