Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions EditProj/EditProjPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ private static string GetNewTempFilePath()

private static void CreateTempFileWithContentsOf(string sourcePath, string destPath)
{
string projectData = File.ReadAllText(sourcePath);
File.WriteAllText(destPath, projectData);
byte[] projectData = File.ReadAllBytes(sourcePath);
File.WriteAllBytes(destPath, projectData);
}

private bool TempFileExists(string projFilePath, out string tempProjFile)
Expand Down Expand Up @@ -199,7 +199,7 @@ private void exitCommand_BeforeExecute(string Guid, int ID, object CustomIn, obj

private void UpdateProjFile(string tempFilePath)
{
string contents = ReadFile(tempFilePath);
byte[] contents = ReadFile(tempFilePath);
string projFile = this.tempToProjFiles[tempFilePath];
if (CanEditFile(this.tempToProjFiles[tempFilePath]))
{
Expand All @@ -217,14 +217,14 @@ private void NotifyForSave(string filePath)
hr = queryEditQuerySave.QuerySaveFile(filePath, 0, null, out result);
}

private static void SetFileContents(string filePath, string content)
private static void SetFileContents(string filePath, byte[] content)
{
File.WriteAllText(filePath, content);
File.WriteAllBytes(filePath, content);
}

private static string ReadFile(string filePath)
private static byte[] ReadFile(string filePath)
{
return File.ReadAllText(filePath);
return File.ReadAllBytes(filePath);
}

private bool CanEditFile(string filePath)
Expand Down