|
|
|
@ -55,13 +55,23 @@ namespace DownKyi.Core.Settings
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private AppSettings GetSettings()
|
|
|
|
|
{
|
|
|
|
|
if (appSettings != null) { return appSettings; }
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
FileStream fileStream = new FileStream(settingsName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
|
|
|
|
StreamReader streamReader = new StreamReader(fileStream, System.Text.Encoding.UTF8);
|
|
|
|
|
string jsonWordTemplate = streamReader.ReadToEnd();
|
|
|
|
|
streamReader.Close();
|
|
|
|
|
fileStream.Close();
|
|
|
|
|
//FileStream fileStream = new FileStream(settingsName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
|
|
|
|
//StreamReader streamReader = new StreamReader(fileStream, System.Text.Encoding.UTF8);
|
|
|
|
|
//string jsonWordTemplate = streamReader.ReadToEnd();
|
|
|
|
|
//streamReader.Close();
|
|
|
|
|
//fileStream.Close();
|
|
|
|
|
string jsonWordTemplate = string.Empty;
|
|
|
|
|
using (var stream = new FileStream(settingsName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete))
|
|
|
|
|
{
|
|
|
|
|
using (var reader = new StreamReader(stream, System.Text.Encoding.UTF8))
|
|
|
|
|
{
|
|
|
|
|
jsonWordTemplate = reader.ReadToEnd();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
#else
|
|
|
|
|