mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +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);
|
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>>>));
|
DataContractSerializer dcs = new DataContractSerializer(typeof(Dictionary<string, Dictionary<IntPtr, List<ApplicationDisplayMetrics>>>));
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
using (XmlWriter xw = XmlWriter.Create(sb))
|
using (XmlWriter xw = XmlWriter.Create(sb))
|
||||||
|
@ -231,6 +228,18 @@ namespace PersistentWindows.Common
|
||||||
|
|
||||||
DumpSnapshotTakenTime();
|
DumpSnapshotTakenTime();
|
||||||
}
|
}
|
||||||
|
public void WriteDataDump()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dumpDataWhenExit)
|
||||||
|
WriteDataDumpCore();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error(e.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ReadDataDump()
|
private void ReadDataDump()
|
||||||
{
|
{
|
||||||
|
|
|
@ -811,15 +811,8 @@ namespace PersistentWindows.SystrayShell
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void WriteDataDump()
|
public static void WriteDataDump()
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
pwp.WriteDataDump();
|
pwp.WriteDataDump();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error(e.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue