Browse Source

Fixed SD2-1588 - Automatic SVN add of forms designer .resx file fails.

The stream which the resource file is saved to is now closed before the SVN add operation to unlock the file.
Also fixed the .resx file being added to the project prematurely and not being added to SVN when multiple designer views for the same form are opened before the .resx file has been saved to disk for the first time.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4884 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Christian Hornung 16 years ago
parent
commit
d413a6fb9d
  1. 19
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs

19
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs

@ -217,7 +217,24 @@ namespace ICSharpCode.FormsDesigner.Services
this.WriteResourcesToBuffer(); this.WriteResourcesToBuffer();
if (buffer == null || buffer.Length == 0) return; if (buffer == null || buffer.Length == 0) return;
stream.Write(buffer, 0, buffer.Length); stream.Write(buffer, 0, buffer.Length);
if (IsNewFile) { // SD2-1588:
// The possible call to AddFileToProject below
// can cause a Subversion add command for the file to be issued.
// For this command to succeed,
// Subversion seems to require delete access to the file.
// Since the OpenedFile implementation does not grant
// delete access (what is very reasonable imho),
// close the stream here to "unlock" it.
// Of course this only works as long as the OpenedFile
// implementation does not require the stream to be left open
// after the save operation.
stream.Close();
// Check for file existance before adding it to the project
// because this may as well be a save operation to a
// MemoryStream before the file has been written to disk
// for the first time.
if (IsNewFile && File.Exists(this.OpenedFile.FileName)) {
resourceStore.AddFileToProject(this); resourceStore.AddFileToProject(this);
IsNewFile = false; IsNewFile = false;
} }

Loading…
Cancel
Save