From e5f09f18bd6fc8ef506f98cb278e20ed56d7e18a Mon Sep 17 00:00:00 2001 From: Chii Ayano Date: Sun, 28 Jun 2020 22:17:21 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=82=B1=E3=83=BC=E3=82=B8=E4=BD=9C=E3=82=8B=E3=81=AB?= =?UTF-8?q?=E9=9A=9B=E3=81=97=E3=81=A6=E5=BF=85=E8=A6=81=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E5=87=A6=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublishProfiles/FolderProfile.pubxml | 12 ++++++++++++ ObsController.Core/SettingLoader.cs | 5 +++++ .../PublishProfiles/FolderProfile.pubxml | 14 ++++++++++++++ ObsWeather/Program.cs | 1 + .../PublishProfiles/FolderProfile.pubxml | 14 ++++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 ObsClock/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 ObsUserLock/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 ObsWeather/Properties/PublishProfiles/FolderProfile.pubxml diff --git a/ObsClock/Properties/PublishProfiles/FolderProfile.pubxml b/ObsClock/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..ed3755a --- /dev/null +++ b/ObsClock/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,12 @@ + + + + + Release + Any CPU + bin\Release\netcoreapp3.1\publish\ + FileSystem + + \ No newline at end of file diff --git a/ObsController.Core/SettingLoader.cs b/ObsController.Core/SettingLoader.cs index 3344422..dcf8ed0 100644 --- a/ObsController.Core/SettingLoader.cs +++ b/ObsController.Core/SettingLoader.cs @@ -16,8 +16,11 @@ public static T Load() where T : new() { var json = string.Empty; + Log.WriteLogLine($"{General.SettingPath} から設定をロードしています"); + if (!File.Exists(General.SettingPath)) { + Log.WriteLogLine("設定ファイルが見つかりませんでした。デフォルトをロードします"); var def = new T(); Save(def); return def; @@ -38,6 +41,8 @@ public static T Load() where T : new() /// public static void Save(T data) where T : new() { + Log.WriteLogLine($"{General.SettingPath} に設定ファイルをセーブします"); + var json = JsonConvert.SerializeObject(data); using var wr = new StreamWriter(General.SettingPath, false); diff --git a/ObsUserLock/Properties/PublishProfiles/FolderProfile.pubxml b/ObsUserLock/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..b2b4194 --- /dev/null +++ b/ObsUserLock/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,14 @@ + + + + + Release + Any CPU + bin\Release\netcoreapp3.1\publish\ + FileSystem + netcoreapp3.1 + false + + \ No newline at end of file diff --git a/ObsWeather/Program.cs b/ObsWeather/Program.cs index a76466c..4f3c749 100644 --- a/ObsWeather/Program.cs +++ b/ObsWeather/Program.cs @@ -37,6 +37,7 @@ private static async Task Main(string[] args) if (string.IsNullOrWhiteSpace(Settings?.OpenWeatherMap.ApiKey)) { Log.WriteLogLine("OpenWeatherMap へ接続するための API Key が見つかりません", Log.LogType.Error); + await ConsoleHost.WaitAsync(); return; } diff --git a/ObsWeather/Properties/PublishProfiles/FolderProfile.pubxml b/ObsWeather/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..b2b4194 --- /dev/null +++ b/ObsWeather/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,14 @@ + + + + + Release + Any CPU + bin\Release\netcoreapp3.1\publish\ + FileSystem + netcoreapp3.1 + false + + \ No newline at end of file