Class NumberList
Nom dels espais: Aspose.Note Assemblea: Aspose.Note.dll (25.4.0)
Representa la llista numerada o bulletada.
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
Membres heretats
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Mostra com recuperar informació sobre el format de la llista.
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();
}
}
Mostra com introduir una nova llista amb el número xinès.
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);
Mostra com introduir una nova llista amb el número.
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
Llista de nombres (string, string, int)
Inicialitza una nova instància de la classe Aspose.Note.numberList.Aquesta instància representa una llista bulletada.
public NumberList(string bulletedSymbol, string font, int fontSize)
{
}
Parameters
bulletedSymbol
string
Un símbol que representa una bala.
font
string
Una font per a la bala.
fontSize
int
Una mida de font per a la bala.
Llista de nombres (string, NumberFormat, string, int)
Inicialitza una nova instància de la classe Aspose.Note.numberList.Aquesta instància representa una llista numerada.
public NumberList(
string format,
NumberFormat numberFormat,
string font,
int fontSize
)
{
}
Parameters
format
string
El format de l’header numerat.
numberFormat
NumberFormat
El format del número en el títol.
font
string
Una font per a l’header numerat.
fontSize
int
Una mida de font per a l’header numerat.
Properties
Font
Obtenir o posar el nom de la font.
public string Font
{
get
{
return this._font;
}
set
{
this._font = value;
}
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obté o posa el color de font.
public Color FontColor
{
get;
set;
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obtenir o establir la mida de font.
public int FontSize
{
get;
set;
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obté o s’estableix el format de l’encàrrec de la línia. Per a les llistes bullades representa un símbol de bullet.
public string Format
{
get;
set;
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obté o estableix un valor que indiqui si l’estil de text és valent.
public bool IsBold
{
get;
set;
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obté o fixa un valor que indiqui si l’estil de text és italià.
public bool IsItalic
{
get;
set;
}
Valor de la propietat
Examples
Mostra com recuperar informació sobre el format de la llista.
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
Obté o fixa l’últim temps modificat.
public DateTime LastModifiedTime
{
get;
set;
}
Valor de la propietat
NumberFormat
Obté o s’estableix el format número utilitzat per a un grup d’objectes numerats automàticament.
public NumberFormat? NumberFormat
{
get;
set;
}
Valor de la propietat
Restart
Obté o s’estableix el valor numèric que supera el nombre automàtic de l’element de llista.
public int Restart
{
get;
set;
}
Valor de la propietat
Methods
Els objectes (objectes)
Determina si l’objecte especificat és igual a l’objecte actual.
public override bool Equals(object obj)
{
}
Parameters
obj
object
El seu objecte.
Returns
El sistema.Boolean
Llista de nombres (Equals)
Determina si l’objecte especificat és igual a l’objecte actual.
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
El seu objecte.
Returns
El sistema.Boolean
Càlcul d’actuació ()
Serveix com una funció hash per al tipus.
public override int GetHashCode()
{
}
Returns
El sistema.Int32.
Trobada de l’enllaç (int)
Obtenir el número de llista encapçalador.
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
El número de seqüència en la llista numerada.
Returns
Representació d’una sèrie del número de seqüència especificat.