Skip to content

Commit

Permalink
Fixing some issues with the IPC communication implementation
Browse files Browse the repository at this point in the history
There's still more to do to ensure seamless IPC communication. Basically, we need to get rid of the requirement of marking stuff as Serializable, and for omitting stuff that we don't really need by marking them as NonSerialized

Uhm.. JSON?
  • Loading branch information
synhershko committed Jun 29, 2012
1 parent 6782a16 commit 6e3e643
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/NAppUpdate.Framework/Common/UpdateProgressInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
namespace NAppUpdate.Framework.Common
using System;

namespace NAppUpdate.Framework.Common
{
[Serializable]
public delegate void ReportProgressDelegate(UpdateProgressInfo currentStatus);

[Serializable]
public class UpdateProgressInfo
{
public int TaskId { get; set; }
Expand All @@ -12,6 +16,7 @@ public class UpdateProgressInfo
public bool StillWorking { get; set; }
}

[Serializable]
public class DownloadProgressInfo : UpdateProgressInfo
{
public long FileSizeInBytes { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions src/NAppUpdate.Framework/Sources/IUpdateSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

namespace NAppUpdate.Framework.Sources
{


public interface IUpdateSource
{
string GetUpdatesFeed();
Expand Down
1 change: 1 addition & 0 deletions src/NAppUpdate.Framework/Tasks/FileUpdateTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public BooleanCondition UpdateConditions
set { _updateConditions = value; }
}

[field:NonSerialized]
public event ReportProgressDelegate OnProgress;

public bool Prepare(Sources.IUpdateSource source)
Expand Down
4 changes: 3 additions & 1 deletion src/NAppUpdate.Framework/Tasks/IUpdateTask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using NAppUpdate.Framework.Common;
using System;
using NAppUpdate.Framework.Common;
using NAppUpdate.Framework.Conditions;

namespace NAppUpdate.Framework.Tasks
{
[Serializable]
public enum TaskExecutionStatus
{
Pending,
Expand Down
1 change: 1 addition & 0 deletions src/NAppUpdate.Framework/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static UpdateManager Instance
/// <summary>
/// State of the update process
/// </summary>
[Serializable]
public enum UpdateProcessState
{
NotChecked,
Expand Down
1 change: 1 addition & 0 deletions src/NAppUpdate.Framework/Utils/NauIpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static Process LaunchProcessAndSendDto(NauDto dto, ProcessStartInfo proce
using (var fStream = new FileStream(clientPipeHandle, FileAccess.Write, (int)BUFFER_SIZE, true))
{
new BinaryFormatter().Serialize(fStream, dto);
fStream.Flush();
fStream.Close();
}
}
Expand Down

0 comments on commit 6e3e643

Please sign in to comment.