Class NumberList
Contenido
[
Ocultar
]NumberList class
Representa la lista numerada o con viñetas.
public class NumberList
Constructores
Nombre | Descripción |
---|---|
NumberList(string, string, int) | Inicializa una nueva instancia delNumberList class. Esta instancia representa una lista con viñetas. |
NumberList(string, NumberFormat, string, int) | Inicializa una nueva instancia delNumberList class. Esta instancia representa una lista numerada. |
Propiedades
Nombre | Descripción |
---|---|
Font { get; set; } | Obtiene o establece el nombre de la fuente. |
FontColor { get; set; } | Obtiene o establece el color de la fuente. |
FontSize { get; set; } | Obtiene o establece el tamaño de fuente. |
Format { get; set; } | Obtiene o establece el formato del encabezado de línea. Para listas con viñetas representa un símbolo de viñeta. |
IsBold { get; set; } | Obtiene o establece un valor que indica si el estilo de texto está en negrita. |
IsItalic { get; set; } | Obtiene o establece un valor que indica si el estilo del texto es cursiva. |
LastModifiedTime { get; set; } | Obtiene o establece la hora de última modificación. |
NumberFormat { get; set; } | Obtiene o establece el formato de número utilizado para un grupo de objetos numerados automáticamente. Debería ser nulo para listas con viñetas. |
Restart { get; set; } | Obtiene o establece el valor numérico que anula el valor numérico automático del elemento de la lista. |
Métodos
Nombre | Descripción |
---|---|
Equals(NumberList) | Determina si el objeto especificado es igual al objeto actual. |
override Equals(object) | Determina si el objeto especificado es igual al objeto actual. |
override GetHashCode() | Sirve como función hash para el tipo. |
GetNumberedListHeader(int) | Obtiene el encabezado de la lista numerada. |
Ejemplos
Muestra cómo recuperar información sobre el formato de la lista.
string dataDir = RunExamples.GetDataDir_Text();
// Cargue el documento en Aspose.Note.
Document oneFile = new Document(dataDir + "ApplyNumberingOnText.one");
// Recuperar una colección de nodos del elemento de contorno
IList<OutlineElement> nodes = oneFile.GetChildNodes<OutlineElement>();
// Iterar a través de cada nodo
foreach (OutlineElement node in nodes)
{
if (node.NumberList != null)
{
NumberList list = node.NumberList;
// Recuperar el nombre de la fuente
Console.WriteLine("Font Name: " + list.Font);
// Recuperar la longitud de la fuente
Console.WriteLine("Font Length: " + list.Font.Length);
// Recuperar tamaño de letra
Console.WriteLine("Font Size: " + list.FontSize);
// Recuperar el color de la fuente
Console.WriteLine("Font Color: " + list.FontColor);
// Recuperar formato
Console.WriteLine("Font format: " + list.Format);
// Marque en negrita
Console.WriteLine("Is bold: " + list.IsBold);
// Comprobar cursiva
Console.WriteLine("Is italic: " + list.IsItalic);
Console.WriteLine();
}
}
Muestra cómo insertar una nueva lista con numeración china.
string dataDir = RunExamples.GetDataDir_Text();
// Inicializa el documento de OneNote
Aspose.Note.Document doc = new Aspose.Note.Document();
// Inicializar la página de OneNote
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
// Aplicar la configuración de estilo de texto
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// Los números en el mismo esquema se incrementan automáticamente.
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);
// Guardar documento de OneNote
dataDir = dataDir + "InsertChineseNumberList_out.one";
doc.Save(dataDir);
Muestra cómo insertar una nueva lista con numeración.
string dataDir = RunExamples.GetDataDir_Text();
// Crear un objeto de la clase Documento
Document doc = new Document();
// Inicializar objeto de clase de página
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Inicializa el objeto de la clase Esquema
Outline outline = new Outline(doc);
// Inicializa el objeto de la clase TextStyle y establece las propiedades de formato
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
// Inicializar los objetos de la clase OutlineElement y aplicar la numeración
// Los números en el mismo esquema se incrementan automáticamente.
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);
// Agregar elementos de contorno
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// Añadir nodo Esquema
page.AppendChildLast(outline);
// Agregar nodo de página
doc.AppendChildLast(page);
// Guardar documento de OneNote
dataDir = dataDir + "ApplyNumberingOnText_out.one";
doc.Save(dataDir);
Ver también
- espacio de nombres Aspose.Note
- asamblea Aspose.Note