Class DxfCollection
Contents
[
Hide
]DxfCollection class
Represents the master differential formatting records.
public class DxfCollection : CollectionBase<Style>
Properties
Name | Description |
---|---|
Capacity { get; set; } | |
Count { get; } | |
Item { get; } | Gets the element at the specified index. |
Item { get; set; } |
Methods
Name | Description |
---|---|
BinarySearch(Style) | |
BinarySearch(Style, IComparer<Style>) | |
BinarySearch(int, int, Style, IComparer<Style>) | |
Clear() | |
Contains(Style) | |
CopyTo(Style[]) | |
CopyTo(Style[], int) | |
CopyTo(int, Style[], int, int) | |
Exists(Predicate<Style>) | |
Find(Predicate<Style>) | |
FindAll(Predicate<Style>) | |
FindIndex(Predicate<Style>) | |
FindIndex(int, Predicate<Style>) | |
FindIndex(int, int, Predicate<Style>) | |
FindLast(Predicate<Style>) | |
FindLastIndex(Predicate<Style>) | |
FindLastIndex(int, Predicate<Style>) | |
FindLastIndex(int, int, Predicate<Style>) | |
GetEnumerator() | |
IndexOf(Style) | |
IndexOf(Style, int) | |
IndexOf(Style, int, int) | |
LastIndexOf(Style) | |
LastIndexOf(Style, int) | |
LastIndexOf(Style, int, int) | |
RemoveAt(int) |
Examples
namespace AsposeCellsExamples
{
using Aspose.Cells;
using System;
public class CellsClassDxfCollectionDemo
{
public static void Run()
{
// Create a new workbook
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
// Access the DxfCollection from the workbook
DxfCollection dxfCollection = workbook.Worksheets.Dxfs;
// Create and add styles to the workbook (they will be available in DxfCollection)
Style headerStyle = workbook.CreateStyle();
headerStyle.Font.Name = "Calibri";
headerStyle.Font.Size = 14;
headerStyle.Font.IsBold = true;
headerStyle.ForegroundColor = System.Drawing.Color.LightGray;
headerStyle.Pattern = BackgroundType.Solid;
Style dataStyle = workbook.CreateStyle();
dataStyle.Font.Name = "Calibri";
dataStyle.Font.Size = 11;
dataStyle.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
dataStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
// Access styles through DxfCollection
Console.WriteLine("Number of styles in DxfCollection: " + dxfCollection.Count);
Console.WriteLine("First style font: " + dxfCollection[0].Font.Name);
// Apply styles to cells
worksheet.Cells["A1"].PutValue("Header");
worksheet.Cells["A1"].SetStyle(dxfCollection[0]);
worksheet.Cells["A2"].PutValue("Data");
worksheet.Cells["A2"].SetStyle(dxfCollection[1]);
// Modify a style through DxfCollection
dxfCollection[1].Font.Color = System.Drawing.Color.Blue;
worksheet.Cells["A3"].PutValue("Modified Data");
worksheet.Cells["A3"].SetStyle(dxfCollection[1]);
// Save the result
workbook.Save("CellsClassDxfCollectionDemo.xlsx");
}
}
}
See Also
- class CollectionBase<T>
- class Style
- namespace Aspose.Cells
- assembly Aspose.Cells