Skip to content

Commit f6c366c

Browse files
committed
update example
1 parent 475aa3d commit f6c366c

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

CS/SpreadsheetExamples/SpreadsheetActions/CellActions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void SetValueFromText(IWorkbook workbook) {
8181
worksheet.Cells["B8"].SetValueFromText("27-Jul-16 5:43PM", true);
8282
worksheet.Cells["B9"].SetValueFromText("=SQRT(25)");
8383

84-
// Apply the time display format to the "C11:F11" cell range.
84+
// Apply the date and time display format to the "C11:F11" cell range.
8585
worksheet.Range["C11:F11"].NumberFormat = "m/d/yy h:mm";
8686
// Fill all cells in the "C11:F11" range with the "B1" cell value.
8787
worksheet.Range["C11:F11"].SetValueFromText("=B1", true);
@@ -105,7 +105,7 @@ static void CreateNamedRange(Workbook workbook) {
105105

106106
// Create a new defined name with the specifed range name and absolute reference.
107107
DefinedName definedName = worksheet.DefinedNames.Add("rangeB17D20", "Sheet1!$B$17:$D$20");
108-
// Create a range and use the specified defined name.
108+
// Use the specified defined name to obtain the cell range.
109109
CellRange B17D20 = worksheet.Range[definedName.Name];
110110
#endregion #NamedRange
111111
}

CS/SpreadsheetExamples/SpreadsheetActions/FormattingActions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void ApplyStyle(Workbook workbook) {
2929
// Apply the "Good" style to a cell range.
3030
worksheet.Range["A1:C4"].Style = styleGood;
3131

32-
// Access a previously created custom style by its name.
32+
// Access the previously created custom style by its name.
3333
Style customStyle = workbook.Styles["Custom Style"];
3434

3535
// Apply the custom style to the cell.
@@ -45,7 +45,7 @@ static void ApplyStyle(Workbook workbook) {
4545

4646
static void CreateModifyStyle(Workbook workbook) {
4747
#region #CreateNewStyle
48-
// Add a new style under the "My Style" name to the workbook's Styles collection.
48+
// Add a new style under the "My Style" name to the workbook's style collection.
4949
Style myStyle = workbook.Styles.Add("My Style");
5050

5151
// Specify formatting characteristics for the style.
@@ -71,7 +71,7 @@ static void CreateModifyStyle(Workbook workbook) {
7171
#endregion #CreateNewStyle
7272

7373
#region #DuplicateExistingStyle
74-
// Add a new style under the "My Good Style" name to the Styles collection.
74+
// Add a new style under the "My Good Style" name to the workbook's style collection.
7575
Style myGoodStyle = workbook.Styles.Add("My Good Style");
7676

7777
// Copy all format settings from the built-in Good style.

CS/SpreadsheetExamples/SpreadsheetActions/ImportActions.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ static void ImportArrays(Workbook workbook) {
2222
workbook.Worksheets[0].Cells["A1"].ColumnWidthInCharacters = 35;
2323
workbook.Worksheets[0].Cells["A1"].Value = "Import an array horizontally:";
2424
workbook.Worksheets[0].Cells["A3"].Value = "Import a two-dimensional array:";
25-
//workbook.Worksheets[0].Cells["A6"].Value = "Import data from ArrayList vertically:";
26-
//workbook.Worksheets[0].Cells["A11"].Value = "Import data from a DataTable:";
2725

2826
#region #ImportArray
2927
Worksheet worksheet = workbook.Worksheets[0];
3028
// Create an array of strings.
3129
string[] array = new string[] { "AAA", "BBB", "CCC", "DDD" };
32-
33-
// Import the array into the worksheet and insert it horizontally, starting with the "B1" cell.
30+
// Insert array values into the worksheet horizontally.
31+
// Data import starts with the "B1" cell.
3432
worksheet.Import(array, 0, 1, false);
3533
#endregion #ImportArray
3634

@@ -40,8 +38,8 @@ static void ImportArrays(Workbook workbook) {
4038
{"Ann", "Edward", "Angela", "Alex"},
4139
{"Rachel", "Bruce", "Barbara", "George"}
4240
};
43-
44-
// Import the two-dimensional array into the worksheet and insert it, starting with the "B3" cell.
41+
// Insert array values into the worksheet.
42+
// Data import starts with the "B3" cell.
4543
worksheet.Import(names, 2, 1);
4644
#endregion #ImportTwoDimensionalArray
4745
}
@@ -55,8 +53,8 @@ static void ImportList(Workbook workbook) {
5553
cities.Add("Rome");
5654
cities.Add("Beijing");
5755
cities.Add("Delhi");
58-
59-
// Import the list into the worksheet and insert it vertically, starting with the "B6" cell.
56+
// Insert list values into the worksheet vertically.
57+
// Data import starts with the "A1" cell.
6058
worksheet.Import(cities, 0, 0, true);
6159
#endregion #ImportList
6260
}
@@ -65,7 +63,7 @@ static void ImportDataTable(Workbook workbook)
6563
{
6664
#region #ImportDataTable
6765
Worksheet worksheet = workbook.Worksheets[0];
68-
// Create a "Employees" DataTable object with four columns.
66+
// Create an "Employees" DataTable object with four columns.
6967
DataTable table = new DataTable("Employees");
7068
table.Columns.Add("FirstN", typeof(string));
7169
table.Columns.Add("LastN", typeof(string));
@@ -75,7 +73,8 @@ static void ImportDataTable(Workbook workbook)
7573
table.Rows.Add("Nancy", "Davolio", "recruiter", 32);
7674
table.Rows.Add("Andrew", "Fuller", "engineer", 28);
7775

78-
// Import data from the data table into the worksheet and insert it, starting with the "B11" cell.
76+
// Insert data table values into the worksheet.
77+
// Data import starts with the "A1" cell.
7978
worksheet.Import(table, true, 0, 0);
8079

8180
// Color the table header.

CS/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void ShowHideWorksheet(Workbook workbook) {
113113
workbook.Worksheets["Sheet2"].VisibilityType = WorksheetVisibilityType.VeryHidden;
114114

115115
// Hide the "Sheet3" worksheet.
116-
// Use the user interface to unhide this worksheet.
116+
// You can unhide this worksheet from the user interface.
117117
workbook.Worksheets["Sheet3"].Visible = false;
118118
#endregion #ShowHideWorksheet
119119
}

0 commit comments

Comments
 (0)