-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove OpenXmlPackage.Close and references #1372
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments about refactoring things so we never call dispose directly
SpreadsheetDocument? sd = ExampleUtilities.CreateSpreadsheetWorkbook(filePath, sheetName); | ||
|
||
if (sd != null) | ||
using (SpreadsheetDocument? sd = ExampleUtilities.CreateSpreadsheetWorkbook(filePath, sheetName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use using SpreadsheetDocument? sd = ....;
instead without indenting the files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@@ -20,7 +20,7 @@ public void CanCreatePresentationFromTemplate() | |||
var part = packageDocument.PresentationPart; | |||
var root = part.Presentation; | |||
|
|||
packageDocument.SaveAs(Path.GetTempFileName()).Close(); | |||
packageDocument.SaveAs(Path.GetTempFileName()).Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you refactor these usages to be within a using block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, of course
@@ -33,7 +33,7 @@ public void CanCloneDocument() | |||
{ | |||
var body = clone.MainDocumentPart.Document.Body; | |||
body.InsertBefore(new Paragraph(new Run(new Text("Hello World"))), body.FirstChild); | |||
clone.SaveAs(file.Path).Close(); | |||
clone.SaveAs(file.Path).Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor things such that we never call dispose directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
replaced this PR with #1373 |
No description provided.