Skip to content

Commit c4b4672

Browse files
author
Fahad Adeel
committed
Initial Commit
0 parents  commit c4b4672

File tree

57 files changed

+2629
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2629
-0
lines changed

.DS_Store

10 KB
Binary file not shown.

.gitignore

Lines changed: 787 additions & 0 deletions
Large diffs are not rendered by default.

FileFormat.Cells.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 25.0.1705.6
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileFormat.Cells", "FileFormat.Cells\FileFormat.Cells.csproj", "{347E8540-1317-4E99-BF8A-A16A04E753BB}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileFormat.Cells_Tests", "FileFormat.Cells_Tests\FileFormat.Cells_Tests.csproj", "{A9BFD275-A6CD-4CD7-B039-8CB29CDE5C93}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{347E8540-1317-4E99-BF8A-A16A04E753BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{347E8540-1317-4E99-BF8A-A16A04E753BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{347E8540-1317-4E99-BF8A-A16A04E753BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{347E8540-1317-4E99-BF8A-A16A04E753BB}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{A9BFD275-A6CD-4CD7-B039-8CB29CDE5C93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{A9BFD275-A6CD-4CD7-B039-8CB29CDE5C93}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{A9BFD275-A6CD-4CD7-B039-8CB29CDE5C93}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{A9BFD275-A6CD-4CD7-B039-8CB29CDE5C93}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {F310ED74-49E9-4506-944B-CFAC0420672F}
30+
EndGlobalSection
31+
EndGlobal

FileFormat.Cells/Cell.cs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using DocumentFormat.OpenXml;
2+
3+
namespace FileFormat.Cells
4+
{
5+
/// <summary>
6+
/// Represents a cell in a row.
7+
/// </summary>
8+
public class Cell
9+
{
10+
/// <value>
11+
/// An object of the Parent Cell class.
12+
/// </value>
13+
protected internal DocumentFormat.OpenXml.Spreadsheet.Cell cell;
14+
private Styles styles;
15+
16+
/// <summary>
17+
/// Instantiate a new instance of the Cell class.
18+
/// </summary>
19+
public Cell()
20+
{
21+
this.cell = new DocumentFormat.OpenXml.Spreadsheet.Cell();
22+
//this.styles = new Styles();
23+
}
24+
25+
/// <summary>
26+
/// This method is used to set the Cell Reference in a worksheet.
27+
/// </summary>
28+
/// <param name="value">A string value.</param>
29+
public void setCellReference(string value)
30+
{
31+
this.cell.CellReference = value;
32+
}
33+
34+
/// <summary>
35+
/// This method is used to set the Cell data type to String.
36+
/// </summary>
37+
public void setStringDataType()
38+
{
39+
this.cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.String;
40+
}
41+
/// <summary>
42+
/// This method is used to set the Cell data type to Number.
43+
/// </summary>
44+
public void setNumberDataType()
45+
{
46+
this.cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.Number;
47+
}
48+
49+
/// <summary>
50+
/// This method is used to set the value of a Cell.
51+
/// </summary>
52+
/// /// <param name="value">A dynamic value.</param>
53+
public void CellValue(dynamic value)
54+
{
55+
this.cell.CellValue = new DocumentFormat.OpenXml.Spreadsheet.CellValue(value);
56+
}
57+
58+
/// <summary>
59+
/// Sets the style index of the cell to 1.
60+
/// </summary>
61+
///
62+
public void CellIndex()
63+
{
64+
this.cell.StyleIndex = 1;
65+
}
66+
67+
/// <summary>
68+
/// Sets the style index of the cell to the specified value.
69+
/// </summary>
70+
/// <param name="num">The style index to be set for the cell.</param>
71+
72+
public void CellIndex(UInt32Value num)
73+
{
74+
this.cell.StyleIndex = num;
75+
}
76+
77+
78+
// Other properties and methods...
79+
}
80+
81+
}
82+

FileFormat.Cells/CellStyle.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace FileFormat.Cells
2+
{
3+
/// <summary>
4+
/// Represents the style information for a cell within a spreadsheet.
5+
/// </summary>
6+
public class CellStyle
7+
{
8+
/// <summary>
9+
/// Gets or sets the font size for the cell's content.
10+
/// </summary>
11+
/// <value>The size of the font.</value>
12+
public int? FontSize { get; set; }
13+
14+
/// <summary>
15+
/// Gets or sets the font name for the cell's content.
16+
/// </summary>
17+
/// <value>The name of the font.</value>
18+
public string? FontName { get; set; }
19+
20+
/// <summary>
21+
/// Gets or sets the background color of the cell.
22+
/// </summary>
23+
/// <value>The color of the cell in a hex format (e.g., "#FF0000" for red).</value>
24+
public string? CellColor { get; set; }
25+
}
26+
}
27+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
12+
</ItemGroup>
13+
</Project>

0 commit comments

Comments
 (0)