Skip to content

Commit 780b941

Browse files
authored
Merge pull request #241 from SyncfusionExamples/988874-ModifyStreams
988874-Modify file streams of C# [Cross-platform] in XlsIO UG
2 parents ba55708 + 8a27829 commit 780b941

File tree

14 files changed

+15
-71
lines changed
  • Editing Excel cell-styles
    • Alignment/.NET/Alignment/Alignment
    • AutoFit Rows and Columns/.NET/AutoFit Rows and Columns/AutoFit Rows and Columns
    • Border Settings/.NET/Border Settings/Border Settings
    • Color Settings/.NET/Color Settings/Color Settings
    • Create Style/.NET/Create Style/Create Style
    • Font Settings/.NET/Font Settings/Font Settings
    • Global Style/.NET/Global Style/Global Style
    • HTML String Formatting/.NET/HTML String Formatting/HTML String Formatting
    • Hide Cell Content/.NET/Hide Cell Content/Hide Cell Content
    • Merge and UnMerge/.NET/Merge and UnMerge/Merge and UnMerge
    • Number Format/.NET/Number Format/Number Format
    • Rich Text/.NET/Rich Text/Rich Text
    • Row and Column Style/.NET/Row and Column Style/Row and Column Style
    • Wrap Text/.NET/Wrap Text/Wrap Text

14 files changed

+15
-71
lines changed

Editing Excel cell-styles/Alignment/.NET/Alignment/Alignment/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,8 @@ static void Main(string[] args)
6060

6161
#region Save
6262
//Saving the workbook
63-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Alignment.xlsx"), FileMode.Create, FileAccess.Write);
64-
workbook.SaveAs(outputStream);
63+
workbook.SaveAs(Path.GetFullPath("Output/Alignment.xlsx"));
6564
#endregion
66-
67-
//Dispose streams
68-
outputStream.Dispose();
6965
}
7066
}
7167
}

Editing Excel cell-styles/AutoFit Rows and Columns/.NET/AutoFit Rows and Columns/AutoFit Rows and Columns/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ static void Main(string[] args)
2929

3030
#region Save
3131
//Saving the workbook
32-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/AutoFit.xlsx"), FileMode.Create, FileAccess.Write);
33-
workbook.SaveAs(outputStream);
32+
workbook.SaveAs(Path.GetFullPath("Output/AutoFit.xlsx"));
3433
#endregion
35-
36-
//Dispose streams
37-
outputStream.Dispose();
3834
}
3935
}
4036
}

Editing Excel cell-styles/Border Settings/.NET/Border Settings/Border Settings/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ static void Main(string[] args)
4949

5050
#region Save
5151
//Saving the workbook
52-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/BorderSettings.xlsx"), FileMode.Create, FileAccess.Write);
53-
workbook.SaveAs(outputStream);
52+
workbook.SaveAs(Path.GetFullPath("Output/BorderSettings.xlsx"));
5453
#endregion
55-
56-
//Dispose streams
57-
outputStream.Dispose();
5854
}
5955
}
6056
}

Editing Excel cell-styles/Color Settings/.NET/Color Settings/Color Settings/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ static void Main(string[] args)
2727

2828
#region Save
2929
//Saving the workbook
30-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/ColorSettings.xlsx"), FileMode.Create, FileAccess.Write);
31-
workbook.SaveAs(outputStream);
30+
workbook.SaveAs(Path.GetFullPath("Output/ColorSettings.xlsx"));
3231
#endregion
33-
34-
//Dispose streams
35-
outputStream.Dispose();
3632
}
3733
}
3834
}

Editing Excel cell-styles/Create Style/.NET/Create Style/Create Style/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ static void Main(string[] args)
2525

2626
#region Save
2727
//Saving the workbook
28-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/CreateStyle.xlsx"), FileMode.Create, FileAccess.Write);
29-
workbook.SaveAs(outputStream);
28+
workbook.SaveAs(Path.GetFullPath("Output/CreateStyle.xlsx"));
3029
#endregion
31-
32-
//Dispose streams
33-
outputStream.Dispose();
3430
}
3531
}
3632
}

Editing Excel cell-styles/Font Settings/.NET/Font Settings/Font Settings/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ static void Main(string[] args)
4949

5050
#region Save
5151
//Saving the workbook
52-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/FontSettings.xlsx"), FileMode.Create, FileAccess.Write);
53-
workbook.SaveAs(outputStream);
52+
workbook.SaveAs(Path.GetFullPath("Output/FontSettings.xlsx"));
5453
#endregion
55-
56-
//Dispose streams
57-
outputStream.Dispose();
5854
}
5955
}
6056
}

Editing Excel cell-styles/Global Style/.NET/Global Style/Global Style/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,8 @@ static void Main(string[] args)
8484

8585
#region Save
8686
//Saving the workbook
87-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/GlobalStyle.xlsx"), FileMode.Create, FileAccess.Write);
88-
workbook.SaveAs(outputStream);
87+
workbook.SaveAs(Path.GetFullPath("Output/GlobalStyle.xlsx"));
8988
#endregion
90-
91-
//Dispose streams
92-
outputStream.Dispose();
9389
}
9490
}
9591
}

Editing Excel cell-styles/HTML String Formatting/.NET/HTML String Formatting/HTML String Formatting/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717

1818
#region Save
1919
//Saving the workbook
20-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/HTMLString.xlsx"), FileMode.Create, FileAccess.Write);
21-
workbook.SaveAs(outputStream);
20+
workbook.SaveAs(Path.GetFullPath("Output/HTMLString.xlsx"));
2221
#endregion
23-
24-
//Dispose streams
25-
outputStream.Dispose();
2622
}
2723

2824

Editing Excel cell-styles/Hide Cell Content/.NET/Hide Cell Content/Hide Cell Content/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ static void Main(string[] args)
2424

2525
#region Save
2626
//Saving the workbook
27-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/HideCellContent.xlsx"), FileMode.Create, FileAccess.Write);
28-
workbook.SaveAs(outputStream);
27+
workbook.SaveAs(Path.GetFullPath("Output/HideCellContent.xlsx"));
2928
#endregion
30-
31-
//Dispose streams
32-
outputStream.Dispose();
3329
}
3430
}
3531
}

Editing Excel cell-styles/Merge and UnMerge/.NET/Merge and UnMerge/Merge and UnMerge/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ static void Main(string[] args)
2727

2828
#region Save
2929
//Saving the workbook
30-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/MergeandUnMerge.xlsx"), FileMode.Create, FileAccess.Write);
31-
workbook.SaveAs(outputStream);
30+
workbook.SaveAs(Path.GetFullPath("Output/MergeandUnMerge.xlsx"));
3231
#endregion
33-
34-
//Dispose streams
35-
outputStream.Dispose();
3632
}
3733
}
3834
}

0 commit comments

Comments
 (0)