Skip to content

Commit 875a58c

Browse files
enricosadalatkin
authored andcommitted
Fix 483 - project item save filename null
The filename parameter of both Envdte.Project.Save and Envdte.ProjectItem.Save is optional ( null value or string.empty ) Implement same behaviour of c# projects fixes dotnet/fsharp#483 closes dotnet/fsharp#493 commit 115edbe9ccf028208df627d8cdc03a9c4876cc85 Author: enricosada <[email protected]> Date: Tue Jun 9 11:18:01 2015 +0200 fix dte Project.Save, filename parameter is optional the filename argument behaviour is the same for null value and string.Empty commit b66a0f45d342b1b10e1f4867c89f964b8dcfc7e1 Author: enricosada <[email protected]> Date: Mon Jun 8 18:01:18 2015 +0200 fix dte ProjectItem.Save, filename parameter is optional the filename argument behaviour is the same for null value and string.Empty
1 parent a233c0a commit 875a58c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAFileItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ public override EnvDTE.Window Open(string viewKind)
218218
/// </summary>
219219
/// <param name="fileName">The name with which to save the project or project item.</param>
220220
/// <exception cref="InvalidOperationException">Is thrown if the save operation failes.</exception>
221-
/// <exception cref="ArgumentNullException">Is thrown if fileName is null.</exception>
222221
public override void Save(string fileName)
223222
{
224-
this.DoSave(false, fileName);
223+
this.DoSave(false, fileName ?? string.Empty);
225224
}
226225

227226
/// <summary>
228227
/// Saves the project item.
229228
/// </summary>
230229
/// <param name="fileName">The file name with which to save the solution, project, or project item. If the file exists, it is overwritten</param>
231230
/// <returns>true if the rename was successful. False if Save as failes</returns>
231+
/// <exception cref="ArgumentNullException">Is thrown if fileName is null.</exception>
232232
public override bool SaveAs(string fileName)
233233
{
234234
try

vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAProject.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,9 @@ public virtual void SaveAs(string fileName)
394394
/// </summary>
395395
/// <param name="fileName">The file name of the project</param>
396396
/// <exception cref="InvalidOperationException">Is thrown if the save operation failes.</exception>
397-
/// <exception cref="ArgumentNullException">Is thrown if fileName is null.</exception>
398397
public virtual void Save(string fileName)
399398
{
400-
this.DoSave(false, fileName);
399+
this.DoSave(false, fileName ?? string.Empty);
401400
}
402401

403402
/// <summary>

0 commit comments

Comments
 (0)