mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Move some user settings to its own dll (cmd,folder plugin and etc)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using Wox.Infrastructure.Logger;
|
||||
@@ -27,7 +28,10 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
using (FileStream fileStream = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter
|
||||
{
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple
|
||||
};
|
||||
serializedObject = binaryFormatter.Deserialize(fileStream) as T;
|
||||
if (serializedObject == null)
|
||||
{
|
||||
@@ -51,7 +55,10 @@ namespace Wox.Infrastructure.Storage
|
||||
try
|
||||
{
|
||||
FileStream fileStream = new FileStream(ConfigPath, FileMode.Create);
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter
|
||||
{
|
||||
AssemblyFormat = FormatterAssemblyStyle.Simple
|
||||
};
|
||||
binaryFormatter.Serialize(fileStream, serializedObject);
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user