Class NumberList

Class NumberList

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

代表编号或投票列表。

public class NumberList
   {
       private List<int> _numbers;
       public NumberList()
       {
           _numbers = new List<int>();
       }
       public void Add(int number)
       {
           _numbers.Add(number);
       }
       public int GetSum()
       {
           return _numbers.Sum();
       }
   }

Inheritance

object NumberList

继承人

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
   Aspose.Note.Document doc = new Aspose.Note.Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
   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);
   dataDir = dataDir + "InsertChineseNumberList_out.one";
   doc.Save(dataDir);

显示如何通过编号输入新的列表。

string dataDir = RunExamples.GetDataDir_Text();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
   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);
   outline.AppendChildLast(outlineElem1);
   outline.AppendChildLast(outlineElem2);
   outline.AppendChildLast(outlineElem3);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "ApplyNumberingOnText_out.one";
   doc.Save(dataDir);

Constructors

数字列(string, string, int)

启动 Aspose.Note.NumberList 类的新例子。这个例子代表了一张被打的名单。

public NumberList(string bulletedSymbol, string font, int fontSize)
   {
   }

Parameters

bulletedSymbol string

象征代表一枚子弹。

font string

一个字体为子弹。

fontSize int

一个字体尺寸的子弹。

数字列(string, NumberFormat, string, int)

启动 Aspose.Note.NumberList 类的新例子。这个例子代表一个编号列表。

public NumberList(
       string format,
       NumberFormat numberFormat,
       string font,
       int fontSize
   )
   {
   }

Parameters

format string

编号标题的格式。

numberFormat NumberFormat

标题中的数字格式。

font string

一个字体为编号的标题。

fontSize int

一个字体大小为编号的标题。

Properties

Font

收到或设置字体的名称。

public string Font
   {
      get
      {
         return this._font;
      }
      set
      {
         this._font = value;
      }
   }

财产价值

string

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
       }
   }

FontColor

接收或设置字体颜色。

public Color FontColor
   {
      get;
      set;
   }

财产价值

Color

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
       }
   }

FontSize

接收或设置字体大小。

public int FontSize
   {
      get;
      set;
   }

财产价值

int

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
      }
   }

Format

接收或设置线标题的格式. 对于弹列表,代表弹符号。

public string Format
   {
      get;
      set;
   }

财产价值

string

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
       }
   }

IsBold

收到或设置一个值,表明文本风格是否有勇气。

public bool IsBold
   {
      get;
      set;
   }

财产价值

bool

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
       }
   }

IsItalic

收到或设置一个值,表明文本风格是否是意大利语。

public bool IsItalic
   {
      get;
      set;
   }

财产价值

bool

Examples

显示如何获取有关列表格式的信息。

string dataDir = RunExamples.GetDataDir_Text();
   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();
       }
   }

LastModifiedTime

接收或设置最后修改时间。

public DateTime LastModifiedTime
   {
      get;
      set;
   }

财产价值

DateTime

NumberFormat

接收或设置用于一组自动编号的对象的数字格式。

public NumberFormat? NumberFormat
   {
      get;
      set;
   }

财产价值

NumberFormat ?

Restart

接收或设置超过列表项目的自动数字值的数值。

public int Restart
   {
      get;
      set;
   }

财产价值

int

Methods

平等(对象)

确定所指定的对象是否与当前对象相同。

public override bool Equals(object obj)
   {
   }

Parameters

obj object

对象。

Returns

bool

这个系统,Boolean。

平等(数字列表)

确定所指定的对象是否与当前对象相同。

public bool Equals(NumberList other)
   {
      if (other == null)
         return false;
      var thisLength = this._list.Count;
      var otherLength = other._list.Count;
      if (thisLength != otherLength)
         return false;
      for (int i = 0; i < thisLength; i++)
      {
         if (!this._list[i].Equals(other._list[i]))
            return false;
      }
      return true;
   }

Parameters

other NumberList

对象。

Returns

bool

这个系统,Boolean。

GetHashCode( )

作为该类型的Hash函数。

public override int GetHashCode()
   {
   }

Returns

int

此分類上一篇: Int32

GetNumberedListHeader(int)

获取编号列表标题。

public string GetNumberedListHeader(int sequenceNumber)
{
}
In this case, since the input code is already formatted according to standard C# conventions, no changes are needed. However, if there were any indentation issues or missing spacing in the code, I would format it accordingly, while strictly adhering to the guidelines mentioned above.

Parameters

sequenceNumber int

在编号列表中的序列号。

Returns

string

序列代表指定的序号。

 中文