Winify
/trunk/Winify/Utilities/LogMemorySink.cs |
@@ -18,10 +18,7 @@ |
|
public void Emit(LogEvent logEvent) |
{ |
if (logEvent == null) |
{ |
throw new ArgumentNullException(nameof(logEvent)); |
} |
if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); |
|
using (var stringWriter = new StringWriter()) |
{ |
/trunk/Winify/Utilities/Serialization/Serialization.cs |
@@ -61,10 +61,8 @@ |
using (var stringWriter = new StringWriter(stringBuilder)) |
{ |
while (await xmlReader.ReadAsync()) |
{ |
await stringWriter.WriteAsync(await xmlReader.ReadOuterXmlAsync()); |
} |
} |
|
using (var stringReader = new StringReader(stringBuilder.ToString())) |
{ |
/trunk/Winify/Utilities/WindowState.cs |
@@ -0,0 +1,20 @@ |
using System.Windows.Forms; |
using Jot; |
|
namespace Winify.Utilities |
{ |
public static class WindowState |
{ |
// expose the tracker instance |
public static Tracker FormTracker = new Tracker(); |
|
static WindowState() |
{ |
// tell Jot how to track Window objects |
FormTracker.Configure<Form>() |
.Id(w => w.Name) |
.Properties(w => new { w.Height, w.Width, w.Left, w.Top, w.WindowState }) |
.PersistOn(nameof(Form.FormClosed)); |
} |
} |
} |