Class NumberList

Class NumberList

Nazwa przestrzeń: Aspose.Note Zgromadzenie: Aspose.Note.dll (25.4.0)

Przedstawia listę numerowaną lub strzeloną.

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

Dziedziczeni członkowie

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

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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();
      }
   }

Pokaż, jak wprowadzić nową listę z chińskim numerowaniem.

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);

Pokaż, jak wprowadzić nową listę z numerowaniem.

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

Listy numerowe (string, string, int)

Inicjalizuje nową instancję klasy Aspose.Note.NumberList.Ten przypadek reprezentuje strzeloną listę.

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

Parameters

bulletedSymbol string

Symbol reprezentujący kulę.

font string

Książka dla kulki.

fontSize int

Wielkość czcionki dla kulki.

NumerList (string, numerFormat, stringa, int)

Inicjalizuje nową instancję klasy Aspose.Note.NumberList.Jest to lista numerowana.

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

Parameters

format string

Format numerowanego nagłówka.

numberFormat NumberFormat

Format liczby w nagłówku.

font string

Słowo dla numerowanego nagłówka.

fontSize int

Rozmiar czcionki dla numerowanego nagłówka.

Properties

Font

Otrzymuje lub ustawia nazwę czcionki.

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

Wartość nieruchomości

string

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Dostęp lub ustaw kolor czcionki.

public Color FontColor
   {
      get;
      set;
   }

Wartość nieruchomości

Color

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Zostaw lub ustaw rozmiar czcionki.

public int FontSize
   {
      get;
      set;
   }

Wartość nieruchomości

int

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Otrzymuje lub ustawia format nagłówka linii. Dla wystrzelonych list reprezentuje symbol strzałki.

public string Format
   {
      get;
      set;
   }

Wartość nieruchomości

string

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Otrzymuje lub ustawia wartość wskazującą, czy styl tekstu jest odważny.

public bool IsBold
   {
      get;
      set;
   }

Wartość nieruchomości

bool

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Otrzymuje lub ustawia wartość wskazującą, czy styl tekstu jest włoski.

public bool IsItalic
   {
      get;
      set;
   }

Wartość nieruchomości

bool

Examples

Pokaż, jak uzyskać informacje na temat formatowania listy.

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

Otrzymuje lub ustawia ostatnią zmienioną godzinę.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

Wartość nieruchomości

DateTime

NumberFormat

Otrzymuje lub ustawia format liczby używany do grupy automatycznie numerowanych obiektów.

public NumberFormat? NumberFormat
   {
      get;
      set;
   }

Wartość nieruchomości

NumberFormat ?

Restart

Otrzymuje lub ustawia wartość numeryczną, która przekracza wartości numerów automatycznych elementu listy.

public int Restart
   {
      get;
      set;
   }

Wartość nieruchomości

int

Methods

Równości (obiekty )

Określa, czy określony obiekt jest równy bieżącemu przedmiotowi.

public override bool Equals(object obj)
   {
   }

Parameters

obj object

z obiektem .

Returns

bool

To jest system. boolean.

Równa liczba (number list)

Określa, czy określony obiekt jest równy bieżącemu przedmiotowi.

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

z obiektem .

Returns

bool

To jest system. boolean.

Podręcznik ()

Służy jako funkcja hash dla tego typu.

public override int GetHashCode()
   {
   }

Returns

int

Występuje w systemie Int32.

Przygotowuje się do listy (int)

Otrzymuje numerowany tytuł listy.

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

Liczba sekwencji na numerowanej liście.

Returns

string

Rękawiczka reprezentująca określone liczby sekwencji.

 Polski