Class NumberList
Pôvodný názov: Aspose.Note Zhromaždenie: Aspose.Note.dll (25.4.0)
Predstavuje číslovaný alebo bulletovaný zoznam.
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
Z dedičných členov
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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();
}
}
Ukážte, ako vložiť nový zoznam s čínskym číslovaním.
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);
Ukáže, ako vložiť nový zoznam s číslovaním.
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
Číslo (string, string, int)
Iniciuje novú inštanciu triedy Aspose.Note.NumberList.Tento príklad predstavuje strelný zoznam.
public NumberList(string bulletedSymbol, string font, int fontSize)
{
}
Parameters
bulletedSymbol
string
Symbol, ktorý predstavuje guľu.
font
string
Písmená pre guľu.
fontSize
int
Veľkosť písma pre guľu.
Počítač (string, NumberFormat, string, int)
Iniciuje novú inštanciu triedy Aspose.Note.NumberList.Tento príklad predstavuje číslovaný zoznam.
public NumberList(
string format,
NumberFormat numberFormat,
string font,
int fontSize
)
{
}
Parameters
format
string
Formát číslovaného názvu.
numberFormat
NumberFormat
Formát čísla v hlave.
font
string
písmo pre číslovaný titulok.
fontSize
int
Veľkosť písma pre číslovanú hlavu.
Properties
Font
Získajte alebo zadajte názov písma.
public string Font
{
get
{
return this._font;
}
set
{
this._font = value;
}
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Dostane alebo nastaví farbu písma.
public Color FontColor
{
get;
set;
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Získať alebo nastaviť veľkosť písma.
public int FontSize
{
get;
set;
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Získať alebo nastaviť formát riadkovej hlavičky. pre nahrávané zoznamy predstavuje symbol nahrávky.
public string Format
{
get;
set;
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Získa alebo nastaví hodnotu, ktorá ukazuje, či je textový štýl odvážny.
public bool IsBold
{
get;
set;
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Získa alebo nastaví hodnotu, ktorá naznačuje, či je textový štýl italsky.
public bool IsItalic
{
get;
set;
}
Hodnota nehnuteľnosti
Examples
Ukáže, ako získať informácie o formátovaní zoznamu.
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
Dostane alebo nastaví poslednú modifikovanú dobu.
public DateTime LastModifiedTime
{
get;
set;
}
Hodnota nehnuteľnosti
NumberFormat
Dostane alebo nastaví formát čísla používaný pre skupinu automaticky číslovaných objektov.
public NumberFormat? NumberFormat
{
get;
set;
}
Hodnota nehnuteľnosti
Restart
Získava alebo nastaví číselnú hodnotu, ktorá prekračuje automatickú čísla hodnoty položky zoznamu.
public int Restart
{
get;
set;
}
Hodnota nehnuteľnosti
Methods
Rovnako ako objekt (objekt)
Určuje, či je špecifikovaný objekt rovný aktuálnemu objektu.
public override bool Equals(object obj)
{
}
Parameters
obj
object
a predmetom .
Returns
Systém je boolean.
Pôvodný názov (Numberlist)
Určuje, či je špecifikovaný objekt rovný aktuálnemu objektu.
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
a predmetom .
Returns
Systém je boolean.
ZískaťHashCode()
Slúži ako funkcia hash pre typ.
public override int GetHashCode()
{
}
Returns
Spoločnosť Int32.
GetNumberedListHeader(int) →
Získajte číslovaný zoznam hlavy.
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
Číslo sekvencie v číselnom zozname.
Returns
Striekacia reprezentácia určeného sekvenčného čísla.