Class NumberList
De naam: Aspose.Note Verzameling: Aspose.Note.dll (25.4.0)
Het vertegenwoordigt de getal of bullet lijst.
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
Geëerbiede leden
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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();
}
}
Toon hoe u een nieuwe lijst met Chinese getallen invoert.
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);
Toon hoe u een nieuwe lijst met getallen invoert.
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
NumberList (string, string en int)
Initialiseert een nieuwe instantie van de Aspose.Note.NumberList-klasse.Deze instantie vertegenwoordigt een geplaatste lijst.
public NumberList(string bulletedSymbol, string font, int fontSize)
{
}
Parameters
bulletedSymbol
string
Een symbool dat een bal vertegenwoordigt.
font
string
Een letter voor de bal.
fontSize
int
Een lettergrootte voor de bal.
NumberList(string, NumberFormat, string, int)
Initialiseert een nieuwe instantie van de Aspose.Note.NumberList-klasse.Deze instantie is een getallijst.
public NumberList(
string format,
NumberFormat numberFormat,
string font,
int fontSize
)
{
}
Parameters
format
string
Het format van de getallen header.
numberFormat
NumberFormat
De vorm van het getal in de header.
font
string
Een letter voor de getallen header.
fontSize
int
Een lettergrootte voor de getallen header.
Properties
Font
Geeft of zet de naam van de lettertype.
public string Font
{
get
{
return this._font;
}
set
{
this._font = value;
}
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of zet de letterkleur.
public Color FontColor
{
get;
set;
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of bepaalt de lettergrootte.
public int FontSize
{
get;
set;
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of stelt het formaat van de lijnhoofd. Voor geplooide lijsten vertegenwoordigt een bullet symbool.
public string Format
{
get;
set;
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of stelt een waarde aan om aan te tonen of de tekst stijl moedig is.
public bool IsBold
{
get;
set;
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of stelt een waarde aan om aan te tonen of de tekststijl Italiaans is.
public bool IsItalic
{
get;
set;
}
Eigendomswaarde
Examples
Toon hoe u informatie over de formatting van de lijst kunt ontvangen.
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
Geeft of stelt de laatste gewijzigde tijd.
public DateTime LastModifiedTime
{
get;
set;
}
Eigendomswaarde
NumberFormat
Geeft of stelt het nummerformaat dat wordt gebruikt voor een groep automatisch getaliseerde objecten.
public NumberFormat? NumberFormat
{
get;
set;
}
Eigendomswaarde
Restart
Geeft of stelt de numerieke waarde die de automatische nummerwaarde van het item in de lijst overschrijdt.
public int Restart
{
get;
set;
}
Eigendomswaarde
Methods
Hetzelfde object (object)
Het bepaalt of het aangegeven object gelijk is aan het huidige object.
public override bool Equals(object obj)
{
}
Parameters
obj
object
Het object .
Returns
Het systeem. boolean
Equals (Nummerlijst)
Het bepaalt of het aangegeven object gelijk is aan het huidige object.
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
Het object .
Returns
Het systeem. boolean
GetHashCode()
Het dient als een hashfunctie voor het type.
public override int GetHashCode()
{
}
Returns
Het systeem.Int32.
GetNumberedListHeader(int)
Geeft de getallen lijst header.
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
Het sequentienummer in de getallijst.
Returns
Een stringvertegenwoordiging van het aangegeven sequentienummer.