mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 20:45:38 +02:00
catch exception when dump position history xml
This commit is contained in:
parent
7fd80af8bf
commit
1ef5e99d40
2 changed files with 14 additions and 12 deletions
|
@ -215,11 +215,8 @@ namespace PersistentWindows.Common
|
|||
File.WriteAllText(Path.Combine(appDataFolder, snapshotTimeFile), xml2, Encoding.Unicode);
|
||||
}
|
||||
|
||||
public void WriteDataDump()
|
||||
private void WriteDataDumpCore()
|
||||
{
|
||||
if (!dumpDataWhenExit)
|
||||
return;
|
||||
|
||||
DataContractSerializer dcs = new DataContractSerializer(typeof(Dictionary<string, Dictionary<IntPtr, List<ApplicationDisplayMetrics>>>));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
using (XmlWriter xw = XmlWriter.Create(sb))
|
||||
|
@ -231,6 +228,18 @@ namespace PersistentWindows.Common
|
|||
|
||||
DumpSnapshotTakenTime();
|
||||
}
|
||||
public void WriteDataDump()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dumpDataWhenExit)
|
||||
WriteDataDumpCore();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadDataDump()
|
||||
{
|
||||
|
|
|
@ -812,14 +812,7 @@ namespace PersistentWindows.SystrayShell
|
|||
|
||||
public static void WriteDataDump()
|
||||
{
|
||||
try
|
||||
{
|
||||
pwp.WriteDataDump();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e.ToString());
|
||||
}
|
||||
pwp.WriteDataDump();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue