Skip to content

Commit 99bb7ab

Browse files
Merge branch 'dev'
2 parents 3d88769 + 9164bd1 commit 99bb7ab

File tree

644 files changed

+1033
-10851
lines changed

Some content is hidden

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

644 files changed

+1033
-10851
lines changed

Changelog.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## v2.6.0
4+
5+
---
6+
Release Date: **19.08.2018**
7+
8+
- Added asynchronous methods SaveAsync, SaveAsAsync and SaveAsStreamAsync
9+
- Added a new constructor in the Cell class with the address as string
10+
- Added a new example for the introduced async methods
11+
- Minor bug fixes and optimizations
12+
- Fixed typos
13+
14+
315
## v2.5.1
416

517
---
@@ -15,7 +27,7 @@ Release Date: **19.08.2018**
1527
Release Date: **02.07.2018**
1628

1729
- Added address types (no fixed rows and columns, fixed rows, fixed columns, fixed rows and columns; Useful in formulas)
18-
- Added new CellDirection Disabled, if the addresses of the cells are defined manually (AddNextCell will override the current cell in this case)
30+
- Added new option CellDirection Disabled, if the addresses of the cells are defined manually (AddNextCell will override the current cell in this case)
1931
- Altered Demo 3 to demonstrate disabling of automatic cell addressing
2032
- Extended Demo 1 to demonstrate the new address types
2133
- Minor, internal changes

Demo/Program.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System;
99
using System.Collections.Generic;
1010
using System.IO;
11+
using System.Threading.Tasks;
1112
using PicoXLSX;
1213

1314

@@ -25,6 +26,7 @@ static void Main(string[] args)
2526
BasicDemo();
2627
ShortenerDemo();
2728
StreamDemo();
29+
AsyncDemo(); // Normally, this method should be called with the await keyword (what is not possible here). Usually, async methods are called along the call stack with await until a terminal element (like a WPF button) is reached
2830
Demo1();
2931
Demo2();
3032
Demo3();
@@ -93,6 +95,17 @@ private static void StreamDemo()
9395
workbook.SaveAsStream(fs); // Save the workbook into the stream
9496
}
9597

98+
/// <summary>
99+
/// This method shows how to save a workbook asynchronous
100+
/// </summary>
101+
private static async Task AsyncDemo()
102+
{
103+
Workbook workbook = new Workbook("shhet1", "async.xlsx"); // Create new workbook with file name
104+
workbook.WS.Value("Some text"); // Add cell A1
105+
workbook.WS.Value(222); // Add cell B1
106+
workbook.WS.Formula("=A2"); // Add cell C1
107+
await workbook.SaveAsync(); // Save async
108+
}
96109

97110
/// <summary>
98111
/// This method shows the usage of AddNextCell with several data types and formulas. Furthermore, the several types of Addresses are demonstrated
@@ -297,8 +310,8 @@ private static void Demo6()
297310
private static void Demo7()
298311
{
299312
Workbook workbook = new Workbook(false); // Create new workbook without worksheet
300-
String invalidSheetName = "Sheet?1"; // ? is not allowed in the names of worksheets
301-
String sanitizedSheetName = Worksheet.SanitizeWorksheetName(invalidSheetName, workbook); // Method to sanitize a worksheet name (replaces ? with _)
313+
string invalidSheetName = "Sheet?1"; // ? is not allowed in the names of worksheets
314+
string sanitizedSheetName = Worksheet.SanitizeWorksheetName(invalidSheetName, workbook); // Method to sanitize a worksheet name (replaces ? with _)
302315
workbook.AddWorksheet(sanitizedSheetName); // Add new worksheet
303316
Worksheet ws = workbook.CurrentWorksheet; // Create reference (shortening)
304317
List<object> values = new List<object>() { "Cell A1", "Cell B1", "Cell C1", "Cell D1" }; // Create a List of values

Demo/Testing/Performance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Testing
1919
public class Performance
2020
{
2121
/// <summary>
22-
/// Method to perform a stress test on PixoXLSX with a high amount of random data
22+
/// Method to perform a stress test on PicoXLSX with a high amount of random data
2323
/// </summary>
2424
/// <param name="filename">filename of the output</param>
2525
/// <param name="sheetname">name of the worksheet</param>

Documentation/CodeDocumentation.shfbproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,20 @@ PicoXLSX was created with .NET version 4.5. Newer versions like 4.6.1 are workin
6262
If you want to compile the documentation project %28folder: Documentation%3b project file: shfbproj%29, you need also the &amp;lt%3bstrong&amp;gt%3b&amp;lt%3ba href=&amp;quot%3bhttps://github.com/EWSoftware/SHFB&amp;quot%3b&amp;gt%3bSandcastle Help File Builder %28SHFB%29&amp;lt%3b/a&amp;gt%3b&amp;lt%3b/strong&amp;gt%3b. It is also freely available. But you don’t need the documentation project to build the PicoXLSX library.
6363
&amp;lt%3bbr/&amp;gt%3b
6464
&amp;lt%3bh2&amp;gt%3bInstallation&amp;lt%3b/h2&amp;gt%3b
65+
66+
&amp;lt%3bh3&amp;gt%3bUsing NuGet&amp;lt%3b/h3&amp;gt%3b
67+
68+
By Package Manager:&amp;lt%3bbr&amp;gt%3b
69+
&amp;lt%3bpre&amp;gt%3b&amp;lt%3bcode&amp;gt%3bInstall-Package PicoXLSX&amp;lt%3b/code&amp;gt%3b&amp;lt%3b/pre&amp;gt%3b
70+
&amp;lt%3bbr&amp;gt%3b
71+
&amp;lt%3bbr&amp;gt%3b
72+
By .NET CLI:&amp;lt%3bbr&amp;gt%3b
73+
&amp;lt%3bpre&amp;gt%3b&amp;lt%3bcode&amp;gt%3bdotnet add package PicoXLSX&amp;lt%3b/code&amp;gt%3b&amp;lt%3b/pre&amp;gt%3b
6574

6675
&amp;lt%3bh3&amp;gt%3bAs DLL&amp;lt%3b/h3&amp;gt%3b
6776

6877
Simply place the PicoXLSX DLL into your .NET project and add a reference to it. Please keep in mind that the .NET version of your solution must match with the runtime version of the PicoXLSX DLL %28currently compiled with 4.5%29.
78+
6979
&amp;lt%3bh3&amp;gt%3bAs source files&amp;lt%3b/h3&amp;gt%3b
7080

7181
Place all .CS files from the PicoXLSX source folder into your project. You can place them into a sub-folder if you wish. The files contains definitions for workbooks, worksheets, cells, styles, meta-data, low level methods and exceptions.

Executable/Debug/PicoXLSX.XML

Lines changed: 65 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Executable/Debug/PicoXLSX.dll

3.5 KB
Binary file not shown.

Executable/Documentation.chm

8.28 KB
Binary file not shown.

Executable/Release/PicoXLSX.dll

3.5 KB
Binary file not shown.

PicoXLSX/Cell.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,24 @@ public Cell(object value, CellType type)
161161
}
162162
}
163163

164+
/// <summary>
165+
/// Constructor with value, cell type and address. The worksheet reference is set to null and must be assigned later
166+
/// </summary>
167+
/// <param name="value">Value of the cell</param>
168+
/// <param name="type">Type of the cell</param>
169+
/// <param name="address">Address of the cell</param>
170+
public Cell(Object value, CellType type, string address)
171+
{
172+
this.DataType = type;
173+
this.Value = value;
174+
this.CellAddress = address;
175+
this.WorksheetReference = null;
176+
if (type == CellType.DEFAULT)
177+
{
178+
ResolveCellType();
179+
}
180+
}
181+
164182
/// <summary>
165183
/// Constructor with value, cell type, row number, column number and the link to a worksheet
166184
/// </summary>

0 commit comments

Comments
 (0)