From 5865ac4d61143860098d30e7103f58a23f615c4f Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 29 Nov 2015 06:18:02 +0900 Subject: [PATCH 01/67] =?UTF-8?q?MetroRadiance=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/MetroRadiance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/MetroRadiance b/source/MetroRadiance index abaf6a64f..3f5bfd3f7 160000 --- a/source/MetroRadiance +++ b/source/MetroRadiance @@ -1 +1 @@ -Subproject commit abaf6a64fdfd640e76372289ffdb0074e692b0d0 +Subproject commit 3f5bfd3f796570046aba8a1455bfb91b682a770f From b7d1d24b8a3d87e2501a3b2067990e7de2ae12c5 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 29 Nov 2015 06:19:37 +0900 Subject: [PATCH 02/67] =?UTF-8?q?.NET=20Framework=204.6=20=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=BF=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Grabacr07.KanColleViewer/App.config | 22 +++++++++---------- .../KanColleViewer.csproj | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/App.config b/source/Grabacr07.KanColleViewer/App.config index 9f789c40b..d977a5755 100644 --- a/source/Grabacr07.KanColleViewer/App.config +++ b/source/Grabacr07.KanColleViewer/App.config @@ -1,12 +1,12 @@ - + -
+
- + @@ -47,20 +47,20 @@ - - + + - - + + - - + + - - + + diff --git a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj index 50c27a721..c4b6e1a39 100644 --- a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj +++ b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj @@ -9,7 +9,7 @@ Properties Grabacr07.KanColleViewer KanColleViewer - v4.5 + v4.6 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 From 61b626555293d17de08388125396e65d6dca147b Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 29 Nov 2015 06:23:47 +0900 Subject: [PATCH 03/67] =?UTF-8?q?MetroRadiance=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/MetroRadiance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/MetroRadiance b/source/MetroRadiance index 3f5bfd3f7..397235e19 160000 --- a/source/MetroRadiance +++ b/source/MetroRadiance @@ -1 +1 @@ -Subproject commit 3f5bfd3f796570046aba8a1455bfb91b682a770f +Subproject commit 397235e19b1daf066d348118909bbcd7cea1dd00 From 42bebe204b1ae2755d5049d9308242d5f8c6f8cf Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Tue, 1 Dec 2015 04:37:47 +0900 Subject: [PATCH 04/67] =?UTF-8?q?MetroRadiance=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/MetroRadiance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/MetroRadiance b/source/MetroRadiance index 397235e19..8aebe400e 160000 --- a/source/MetroRadiance +++ b/source/MetroRadiance @@ -1 +1 @@ -Subproject commit 397235e19b1daf066d348118909bbcd7cea1dd00 +Subproject commit 8aebe400e7e3c29df66ed4b5339dd74fd74515dd From 85d4a41363dc4b8f1ee55359567c8dfc7c9f4ede Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Tue, 1 Dec 2015 04:38:11 +0900 Subject: [PATCH 05/67] .net 4.6 --- .../WindowsNotifier/WindowsNotifier.csproj | 2 +- source/Plugins/WindowsNotifier/app.config | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/Plugins/WindowsNotifier/WindowsNotifier.csproj b/source/Plugins/WindowsNotifier/WindowsNotifier.csproj index 7c6e5be15..76682f570 100644 --- a/source/Plugins/WindowsNotifier/WindowsNotifier.csproj +++ b/source/Plugins/WindowsNotifier/WindowsNotifier.csproj @@ -9,7 +9,7 @@ Properties Grabacr07.KanColleViewer.Plugins WindowsNotifier - v4.5 + v4.6 8.1 512 diff --git a/source/Plugins/WindowsNotifier/app.config b/source/Plugins/WindowsNotifier/app.config index 34661da7c..ff3d681f5 100644 --- a/source/Plugins/WindowsNotifier/app.config +++ b/source/Plugins/WindowsNotifier/app.config @@ -1,23 +1,23 @@ - + - - + + - - + + - - + + - - + + - \ No newline at end of file + From 126d99b1def526f32557e6179c3645e6508fdb4a Mon Sep 17 00:00:00 2001 From: veigr Date: Tue, 1 Dec 2015 07:27:46 +0900 Subject: [PATCH 06/67] =?UTF-8?q?=E6=8B=A1=E5=A4=A7=E7=8E=87=E3=81=AEBindi?= =?UTF-8?q?ng=E3=83=9F=E3=82=B9=E3=81=AE=E3=81=9B=E3=81=84=E3=81=A7?= =?UTF-8?q?=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AB=E3=82=AF=E3=83=A9=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit なぜ今まで問題なかったのか。 --- .../Views/Controls/ZoomFactorSelector.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml index 9359ed70a..13aa5ef73 100644 --- a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml @@ -33,7 +33,7 @@ Foreground="{DynamicResource ActiveForegroundBrushKey}" VerticalAlignment="Top" Margin="-2,0,0,0"> - @@ -141,4 +141,4 @@ - \ No newline at end of file + From f090ba1ec31333ef18be614c0958752d12d3ff3a Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Tue, 1 Dec 2015 19:01:21 +0900 Subject: [PATCH 07/67] =?UTF-8?q?=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=20=E3=82=B3=E3=83=B3=E3=83=88=E3=83=A9=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=AB=20ILocalization=20=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Composition/ILocalizable.cs | 13 +++++++++++++ .../KanColleViewer.Composition.csproj | 1 + .../Properties/AssemblyInfo.cs | 2 +- .../Composition/PluginHost.cs | 4 ++++ .../Models/ResourceService.cs | 4 +++- 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 source/Grabacr07.KanColleViewer.Composition/Composition/ILocalizable.cs diff --git a/source/Grabacr07.KanColleViewer.Composition/Composition/ILocalizable.cs b/source/Grabacr07.KanColleViewer.Composition/Composition/ILocalizable.cs new file mode 100644 index 000000000..21e2c11fb --- /dev/null +++ b/source/Grabacr07.KanColleViewer.Composition/Composition/ILocalizable.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Grabacr07.KanColleViewer.Composition +{ + public interface ILocalizable + { + void ChangeCulture(string cultureName); + } +} diff --git a/source/Grabacr07.KanColleViewer.Composition/KanColleViewer.Composition.csproj b/source/Grabacr07.KanColleViewer.Composition/KanColleViewer.Composition.csproj index 7e7a9fea0..f5da14cf3 100644 --- a/source/Grabacr07.KanColleViewer.Composition/KanColleViewer.Composition.csproj +++ b/source/Grabacr07.KanColleViewer.Composition/KanColleViewer.Composition.csproj @@ -41,6 +41,7 @@ + diff --git a/source/Grabacr07.KanColleViewer.Composition/Properties/AssemblyInfo.cs b/source/Grabacr07.KanColleViewer.Composition/Properties/AssemblyInfo.cs index 4d4fefd1b..67cc007a7 100644 --- a/source/Grabacr07.KanColleViewer.Composition/Properties/AssemblyInfo.cs +++ b/source/Grabacr07.KanColleViewer.Composition/Properties/AssemblyInfo.cs @@ -25,4 +25,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.3.0.0")] diff --git a/source/Grabacr07.KanColleViewer/Composition/PluginHost.cs b/source/Grabacr07.KanColleViewer/Composition/PluginHost.cs index dbe9f45b5..3ff0f9490 100644 --- a/source/Grabacr07.KanColleViewer/Composition/PluginHost.cs +++ b/source/Grabacr07.KanColleViewer/Composition/PluginHost.cs @@ -54,6 +54,9 @@ internal class PluginService : IDisposable [ImportMany(RequiredCreationPolicy = CreationPolicy.Shared)] private IEnumerable> importedTools; + [ImportMany(RequiredCreationPolicy = CreationPolicy.Shared)] + private IEnumerable> importedLocalizables; + #pragma warning restore 649 private static class Cache @@ -145,6 +148,7 @@ public void Initialize() this.Load(this.importedNotifiers); this.Load(this.importedNotifyRequesters); this.Load(this.importedTools); + this.Load(this.importedLocalizables); } /// diff --git a/source/Grabacr07.KanColleViewer/Models/ResourceService.cs b/source/Grabacr07.KanColleViewer/Models/ResourceService.cs index 356f18e7d..144560bcb 100644 --- a/source/Grabacr07.KanColleViewer/Models/ResourceService.cs +++ b/source/Grabacr07.KanColleViewer/Models/ResourceService.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.Linq; using System.Threading.Tasks; +using Grabacr07.KanColleViewer.Composition; using Grabacr07.KanColleViewer.Models.Settings; using Grabacr07.KanColleViewer.Properties; using Livet; @@ -69,9 +70,10 @@ public void ChangeCulture(string name) Resources.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name); GeneralSettings.Culture.Value = Resources.Culture?.Name; - this.RaisePropertyChanged(nameof(this.Resources)); + Controls.Globalization.ResourceService.Current.ChangeCulture(name); + foreach (var plugin in PluginService.Current.Get()) plugin.ChangeCulture(name); } } } From abeb986ee2bc857f0b05dc18096f287f8e332793 Mon Sep 17 00:00:00 2001 From: veigr Date: Mon, 14 Dec 2015 15:55:32 +0900 Subject: [PATCH 08/67] =?UTF-8?q?*=20Fixes=20#97=20Diagnostic=20=E3=81=AE?= =?UTF-8?q?=20ID=20=E5=A4=89=E6=9B=B4=20*=20=E3=82=BF=E3=83=BC=E3=82=B2?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=83=95=E3=83=AC=E3=83=BC=E3=83=A0=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=82=AF=E3=82=92=204.6=20=E3=81=AB=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=20*=20=E5=8F=82=E7=85=A7=E3=82=A2=E3=82=BB=E3=83=B3=E3=83=96?= =?UTF-8?q?=E3=83=AA=E3=82=92=20VS2015=20Update1=20=E7=9B=B8=E5=BD=93?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=A6=E3=81=BF=E3=81=9F=E3=81=A4=E3=82=82?= =?UTF-8?q?=E3=82=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Diagnostic/results.json | 2 +- .../KanColleViewer.PluginAnalyzer.Test.csproj | 48 +++--- .../Verifiers/ConventionCodeFixVerifier.cs | 138 +++++++++++++----- .../packages.config | 16 +- .../DuplicateAttributeAnalyzer.cs | 2 +- .../DuplicateGuidAnalyzer.cs | 2 +- .../ExportAnalyzer.cs | 2 +- .../ExportGuidMetadataAnalyzer.cs | 2 +- .../ExportMetadataAnalyzer.cs | 2 +- .../InvalidGuidMetadataAnalyzer.cs | 2 +- .../KanColleViewer.PluginAnalyzer.csproj | 48 +++--- .../RequireIPluginAnalyzer.cs | 2 +- .../packages.config | 14 +- 13 files changed, 170 insertions(+), 110 deletions(-) diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/DataSource/InvalidGuidMetadataTest/DifferentFromIPluginGuid/Diagnostic/results.json b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/DataSource/InvalidGuidMetadataTest/DifferentFromIPluginGuid/Diagnostic/results.json index d111dfd09..80aded2dd 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/DataSource/InvalidGuidMetadataTest/DifferentFromIPluginGuid/Diagnostic/results.json +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/DataSource/InvalidGuidMetadataTest/DifferentFromIPluginGuid/Diagnostic/results.json @@ -1,6 +1,6 @@ [ { - "id": "KanColleViewer.PluginAnalyzer.InvalidGuidMetadata", + "id": "KanColleViewer_PluginAnalyzer_InvalidGuidMetadata", "sevirity": "Warning", "line": 7, "column": 2, diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/KanColleViewer.PluginAnalyzer.Test.csproj b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/KanColleViewer.PluginAnalyzer.Test.csproj index 901da9958..990025129 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/KanColleViewer.PluginAnalyzer.Test.csproj +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/KanColleViewer.PluginAnalyzer.Test.csproj @@ -10,7 +10,7 @@ Properties Grabacr07.KanColleViewer.PluginAnalyzer.Test KanColleViewer.PluginAnalyzer.Test - v4.5 + v4.6 512 @@ -34,24 +34,24 @@ false - - ..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.dll + + ..\..\packages\Microsoft.CodeAnalysis.Common.1.1.0\lib\net45\Microsoft.CodeAnalysis.dll True - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.1.1.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll True - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.1.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll True - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.1.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll True - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.1.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll True @@ -59,8 +59,8 @@ True - - ..\..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + + ..\..\packages\System.Collections.Immutable.1.1.37\lib\dotnet\System.Collections.Immutable.dll True @@ -85,8 +85,8 @@ True - - ..\..\packages\System.Reflection.Metadata.1.0.21\lib\portable-net45+win8\System.Reflection.Metadata.dll + + ..\..\packages\System.Reflection.Metadata.1.1.0\lib\dotnet5.2\System.Reflection.Metadata.dll True @@ -97,6 +97,10 @@ + + + + @@ -109,10 +113,6 @@ - - - - @@ -137,15 +137,11 @@ - - + + - - - - - + + \ No newline at end of file diff --git a/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs b/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs new file mode 100644 index 000000000..4a591d8c2 --- /dev/null +++ b/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Threading.Tasks; +using Grabacr07.KanColleViewer.Composition; + +namespace Grabacr07.KanColleViewer.Plugins +{ + public class TaskbarProgressPlugin : IPlugin + { + public void Initialize() + { + } + } +} diff --git a/source/Plugins/TaskbarProgress/app.config b/source/Plugins/TaskbarProgress/app.config new file mode 100644 index 000000000..d5bc0a4dc --- /dev/null +++ b/source/Plugins/TaskbarProgress/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + 20000 + + + + \ No newline at end of file diff --git a/source/Plugins/TaskbarProgress/packages.config b/source/Plugins/TaskbarProgress/packages.config new file mode 100644 index 000000000..7c8f44d45 --- /dev/null +++ b/source/Plugins/TaskbarProgress/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/source/Plugins/WindowsNotifier/Properties/AssemblyInfo.cs b/source/Plugins/WindowsNotifier/Properties/AssemblyInfo.cs index d63d7cf89..43498f9d1 100644 --- a/source/Plugins/WindowsNotifier/Properties/AssemblyInfo.cs +++ b/source/Plugins/WindowsNotifier/Properties/AssemblyInfo.cs @@ -1,32 +1,13 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 -// アセンブリに関連付けられている情報を変更するには、 -// これらの属性値を変更してください。 [assembly: AssemblyTitle("提督業も忙しい! Windows 通知プラグイン")] [assembly: AssemblyDescription("提督業も忙しい! Windows 通知プラグイン")] -[assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("grabacr.net")] [assembly: AssemblyProduct("KanColleViewer")] [assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから -// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 -// その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] +[assembly: Guid("16253877-0DA9-4BB1-97A0-2115110DD8E8")] -// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を -// 既定値にすることができます: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.0.0")] From b5d201ef0e990d10eaa7b2f2aceef37e8f4df217 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Tue, 2 Feb 2016 21:34:29 +0900 Subject: [PATCH 38/67] =?UTF-8?q?=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Grabacr07.KanColleViewer/Application.xaml.cs | 2 +- .../TaskbarProgress/TaskbarProgress.csproj | 1 - .../TaskbarProgress/TaskbarProgressPlugin.cs | 16 ---------------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs diff --git a/source/Grabacr07.KanColleViewer/Application.xaml.cs b/source/Grabacr07.KanColleViewer/Application.xaml.cs index 8ac1eea18..902b18f4e 100644 --- a/source/Grabacr07.KanColleViewer/Application.xaml.cs +++ b/source/Grabacr07.KanColleViewer/Application.xaml.cs @@ -87,8 +87,8 @@ protected override void OnStartup(StartupEventArgs e) KanColleClient.Current.Settings = new KanColleSettings(); ThemeService.Current.Register(this, Theme.Dark, Accent.Purple); - WindowService.Current.AddTo(this).Initialize(); PluginService.Current.AddTo(this).Initialize(); + WindowService.Current.AddTo(this).Initialize(); NotifyService.Current.AddTo(this).Initialize(); Helper.SetRegistryFeatureBrowserEmulation(); diff --git a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj index dcd2173ed..31990c119 100644 --- a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj +++ b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj @@ -78,7 +78,6 @@ True Settings.settings - diff --git a/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs b/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs deleted file mode 100644 index 4a591d8c2..000000000 --- a/source/Plugins/TaskbarProgress/TaskbarProgressPlugin.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Threading.Tasks; -using Grabacr07.KanColleViewer.Composition; - -namespace Grabacr07.KanColleViewer.Plugins -{ - public class TaskbarProgressPlugin : IPlugin - { - public void Initialize() - { - } - } -} From a45aea99d0737f7647f1bf7270aebc8587922dbb Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Tue, 2 Feb 2016 21:50:27 +0900 Subject: [PATCH 39/67] =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=82=A6=E3=82=92=E5=88=86=E5=89=B2=E3=81=97=E3=81=A6=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AF=E3=82=A4=E3=83=B3=E3=82=B8=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=BC=E3=82=92=E6=83=85=E5=A0=B1=E3=82=A6?= =?UTF-8?q?=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6=E5=81=B4=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=81=A7=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/InformationWindowViewModel.cs | 37 ++++++++++++++----- .../ViewModels/KanColleWindowViewModel.cs | 24 +++++++++++- .../Views/InformationWindow.xaml | 5 +++ 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/ViewModels/InformationWindowViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/InformationWindowViewModel.cs index adec64430..95e6a81f6 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/InformationWindowViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/InformationWindowViewModel.cs @@ -2,31 +2,39 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Grabacr07.KanColleViewer.Models; using Grabacr07.KanColleViewer.Models.Settings; using Grabacr07.KanColleViewer.Views; using MetroTrilithon.Mvvm; namespace Grabacr07.KanColleViewer.ViewModels -{ +{ /// /// アプリケーションの主機能である をホストするウィンドウのためのデータを提供します。 /// public class InformationWindowViewModel : MainWindowViewModelBase - { - public WindowSettings Settings { get; } + { + private readonly TaskbarProgress taskbarProgress; + public WindowSettings Settings { get; } + /// /// アタッチされたウィンドウが閉じられたときに発生します。 /// public event EventHandler Closed; public InformationWindowViewModel(MainWindowViewModelBase owner) : this(false) - { - // 別のメイン ウィンドウがいて、その分割ウィンドウとして表示されるケース - // メイン ウィンドウ側の Content と同じものを表示する - - // ReSharper disable once DoNotCallOverridableMethodsInConstructor - owner.Subscribe(nameof(this.Content), () => this.Content = owner.Content).AddTo(this); + { + // 別のメイン ウィンドウがいて、その分割ウィンドウとして表示されるケース + // メイン ウィンドウ側の Content と同じものを表示する + + // ReSharper disable once DoNotCallOverridableMethodsInConstructor + owner.Subscribe(nameof(this.Content), () => this.Content = owner.Content).AddTo(this); + + this.taskbarProgress = new TaskbarProgress(); + this.taskbarProgress + .Subscribe(nameof(TaskbarProgress), () => this.UpdateTaskbar()) + .AddTo(this); } public InformationWindowViewModel(bool isMainWindow) : base(isMainWindow) @@ -34,10 +42,21 @@ public InformationWindowViewModel(bool isMainWindow) : base(isMainWindow) this.Settings = new WindowSettings(nameof(InformationWindow)); } + protected override void InitializeCore() + { + base.InitializeCore(); + this.UpdateTaskbar(); + } + protected override void Dispose(bool disposing) { base.Dispose(disposing); this.Closed?.Invoke(this, new EventArgs()); } + + private void UpdateTaskbar() + { + this.UpdateTaskbar(this.taskbarProgress.State, this.taskbarProgress.Value); + } } } diff --git a/source/Grabacr07.KanColleViewer/ViewModels/KanColleWindowViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/KanColleWindowViewModel.cs index 7548d16e0..7cf3b8260 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/KanColleWindowViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/KanColleWindowViewModel.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Windows; using System.Windows.Controls; +using System.Windows.Shell; using Grabacr07.KanColleViewer.Models; using Grabacr07.KanColleViewer.Models.Settings; using Grabacr07.KanColleViewer.Properties; @@ -111,7 +112,6 @@ public double ToolAreaMaxWidth #endregion - public KanColleWindowViewModel(bool isMainWindow) : base(isMainWindow) { this.Settings = SettingsHost.Instance(); @@ -131,7 +131,7 @@ public KanColleWindowViewModel(bool isMainWindow) : base(isMainWindow) this.taskbarProgress = new TaskbarProgress(); this.taskbarProgress - .Subscribe(nameof(TaskbarProgress), () => this.UpdateTaskbar(this.taskbarProgress.State, this.taskbarProgress.Value)) + .Subscribe(nameof(TaskbarProgress), () => this.UpdateTaskbar()) .AddTo(this); } @@ -146,6 +146,8 @@ protected override void InitializeCore() // ウィンドウ表示時点で既に分割設定されていた場合、このタイミングで分割ウィンドウも一緒に表示 this.Transition(this.splitWindow, typeof(InformationWindow), TransitionMode.NewOrActive, false); } + + this.UpdateTaskbar(); } @@ -181,6 +183,7 @@ public void SplitWindow() this.ContentVisibility = Visibility.Collapsed; this.Settings.IsSplit.Value = true; + this.UpdateTaskbar(); } } @@ -202,6 +205,8 @@ public void MergeWindow() this.ContentVisibility = Visibility.Visible; this.Settings.IsSplit.Value = false; } + + this.UpdateTaskbar(); } } @@ -234,5 +239,20 @@ private double GetToolAreaWidth(Dock d) return double.PositiveInfinity; } } + + private void UpdateTaskbar() + { + // 分割ウィンドウがいなかったら、自身のタスク バーを設定する + // 分割ウィンドウがいる場合はそっちに任せる + + if (this.splitWindow == null) + { + this.UpdateTaskbar(this.taskbarProgress.State, this.taskbarProgress.Value); + } + else + { + this.UpdateTaskbar(TaskbarItemProgressState.None, .0); + } + } } } diff --git a/source/Grabacr07.KanColleViewer/Views/InformationWindow.xaml b/source/Grabacr07.KanColleViewer/Views/InformationWindow.xaml index 61f56b848..a08ded97c 100644 --- a/source/Grabacr07.KanColleViewer/Views/InformationWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/InformationWindow.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf" xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls" + xmlns:mtti="http://schemes.grabacr.net/winfx/2015/personal/interactivity" xmlns:kcvc="http://schemes.grabacr.net/winfx/2015/kancolleviewer/controls" xmlns:kcvi="http://schemes.grabacr.net/winfx/2015/kancolleviewer/interactivity" xmlns:kcvv="http://schemes.grabacr.net/winfx/2015/kancolleviewer/converters" @@ -57,6 +58,10 @@ MessageKey="Window.Transition"> + + + From fb9120bd34a655ad3a767cf2360a282029da655f Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Wed, 3 Feb 2016 02:00:57 +0900 Subject: [PATCH 40/67] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/Composition/PluginViewModel.cs | 3 + .../Views/Settings/PluginInfo.xaml | 10 + .../Views/Settings/RichText.cs | 7 + .../Views/Settings/Window.xaml | 430 +++++++++--------- source/MetroTrilithon | 2 +- .../TaskbarProgress/ExpeditionProgress.cs | 29 +- .../ExpeditionProgressSettings.xaml | 15 + .../ExpeditionProgressSettings.xaml.cs | 28 ++ .../Properties/Settings.Designer.cs | 20 +- .../Properties/Settings.settings | 3 + .../TaskbarProgress/TaskbarProgress.csproj | 9 + source/Plugins/TaskbarProgress/app.config | 3 + 12 files changed, 334 insertions(+), 225 deletions(-) create mode 100644 source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml create mode 100644 source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml.cs diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Composition/PluginViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Composition/PluginViewModel.cs index dcdb43006..773bfbf33 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Composition/PluginViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Composition/PluginViewModel.cs @@ -61,6 +61,9 @@ public IEnumerable Functions var tool = this.Plugin.OfType().FirstOrDefault(); if (tool != null) yield return new ToolText { Function = tool, }; + + var taskbarProgress = this.Plugin.OfType().FirstOrDefault(); + if (taskbarProgress != null) yield return new TaskbarProgressText { Function = taskbarProgress, }; } } diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/PluginInfo.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/PluginInfo.xaml index 7724f707c..f3c3edbf5 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/PluginInfo.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/PluginInfo.xaml @@ -97,6 +97,16 @@ + + + + + + + + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/RichText.cs b/source/Grabacr07.KanColleViewer/Views/Settings/RichText.cs index 02a35ca75..25ca635b2 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/RichText.cs +++ b/source/Grabacr07.KanColleViewer/Views/Settings/RichText.cs @@ -47,4 +47,11 @@ public override void Click() { } } + + public class TaskbarProgressText : FunctionLink + { + public override void Click() + { + } + } } diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml index 09d42a9e5..4df1bd4d9 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml @@ -15,364 +15,364 @@ d:DesignWidth="540" d:DesignHeight="600" d:DataContext="{d:DesignInstance vms:WindowSettingsViewModel}" - Background="{DynamicResource ThemeBrushKey}"> - - - - - - - - - + Background="{DynamicResource ThemeBrushKey}"> + + + + + + + + + - + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> + + Margin="20,0,0,10"> + Margin="0,0,10,0" /> - - + MinWidth="140" /> + + - + Style="{DynamicResource SeparatorRectangleStyleKey}" /> + + Margin="0,10" /> + Margin="20,0,0,10"> + Margin="0,0,10,0" /> - - + MinWidth="140" /> + + - + Style="{DynamicResource SeparatorRectangleStyleKey}" /> + + Margin="0,10" /> - + HorizontalAlignment="Left"> + + HorizontalAlignment="Center" /> - - - - + HorizontalAlignment="Center" /> + + + + - + Style="{DynamicResource SeparatorRectangleStyleKey}" /> + - - + Margin="0,10" /> + + - + Margin="16,0,0,5"> + - + Value="{DynamicResource InactiveForegroundBrushKey}" /> + + + + - + Value="{DynamicResource AccentForegroundBrushKey}" /> + + - - + + - - - - - + + + + + - - + Value="{DynamicResource HighlightBackgroundBrushKey}" /> + + + + + + Content="シングル ウィンドウ" /> + IsEnabled="{Binding ElementName=MergedCheckBox, Path=IsChecked}"> + Height="48" /> - + vs:Window.IsDockMatched="{Binding DockTop}" /> + - - - + vs:Window.IsDockMatched="{Binding DockLeft}" /> + + + - + vs:Window.IsDockMatched="{Binding DockRight}" /> + - - - - - - - - - - + Value="{DynamicResource HighlightBackgroundBrushKey}" /> + + + + + + Content="マルチ ウィンドウ" /> - - - - - - - - - - - + IsEnabled="{Binding ElementName=SplitCheckBox, Path=IsChecked}"> + + + + + + + + + + + - + Margin="12"> + - - + Value="{DynamicResource ActiveForegroundBrushKey}" /> + + + - - - - - + Style="{DynamicResource KanColleMarkStyleKey}" /> + + + + + + Margin="16,0,0,8"> + Margin="4,2" /> - - - + Margin="4,2" /> + + + - - - - + Style="{DynamicResource SeparatorRectangleStyleKey}" /> + + + + diff --git a/source/MetroTrilithon b/source/MetroTrilithon index 18bc1867d..6145c24aa 160000 --- a/source/MetroTrilithon +++ b/source/MetroTrilithon @@ -1 +1 @@ -Subproject commit 18bc1867dabca3a898872bfb53910d721d5bd995 +Subproject commit 6145c24aa037349b2a3ebf07754d35e75799fb0f diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs index 2a63198a8..daf56d276 100644 --- a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs +++ b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs @@ -21,7 +21,7 @@ namespace Grabacr07.KanColleViewer.Plugins [ExportMetadata("Description", "遠征の状況をタスク バー インジケーターに報告します。")] [ExportMetadata("Version", "1.0")] [ExportMetadata("Author", "@Grabacr07")] - public class ExpeditionProgress : IPlugin, ITaskbarProgress, IDisposableHolder + public class ExpeditionProgress : IPlugin, ITaskbarProgress, ISettings, IDisposableHolder { private readonly MultipleDisposable compositDisposable = new MultipleDisposable(); private ExpeditionWrapper[] wrappers; @@ -33,6 +33,19 @@ public class ExpeditionProgress : IPlugin, ITaskbarProgress, IDisposableHolder public double Value { get; private set; } + public bool ErrorIfAllWaiting + { + get { return Settings.Default.ErrorIfAllWaiting; } + set + { + Settings.Default.ErrorIfAllWaiting = value; + Settings.Default.Save(); + this.Update(); + } + } + + object ISettings.View => new ExpeditionProgressSettings { DataContext = this, }; + public event EventHandler Updated; public void Initialize() @@ -44,25 +57,29 @@ public void Initialize() var timer = new DispatcherTimer(DispatcherPriority.Normal) { Interval = TimeSpan.FromMilliseconds(Settings.Default.Interval), }; timer.Tick += (sender, e) => this.Update(); timer.Start(); + + Disposable.Create(() => Settings.Default.Save()); } - public void InitializeCore() + private void InitializeCore() { if (this.initialized) return; var homeport = KanColleClient.Current.Homeport; if (homeport != null) { + this.initialized = true; + homeport.Organization .Subscribe(nameof(Organization.Fleets), this.UpdateExpeditions) .AddTo(this); - - this.initialized = true; } } public void UpdateExpeditions() { + if (!this.initialized) return; + if (this.wrappers != null) { foreach (var wrapper in this.wrappers) wrapper.Dispose(); @@ -81,6 +98,8 @@ public void UpdateExpeditions() public void Update() { + if (!this.initialized) return; + if (this.wrappers.Length == 0) { this.State = TaskbarItemProgressState.None; @@ -108,7 +127,7 @@ public void Update() else { this.State = TaskbarItemProgressState.Error; - this.Value = .0; + this.Value = this.ErrorIfAllWaiting ? 1.0 : .0; } } diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml b/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml new file mode 100644 index 000000000..9f89d68a9 --- /dev/null +++ b/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml @@ -0,0 +1,15 @@ + + + + + diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml.cs b/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml.cs new file mode 100644 index 000000000..3381ed03b --- /dev/null +++ b/source/Plugins/TaskbarProgress/ExpeditionProgressSettings.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Grabacr07.KanColleViewer.Plugins +{ + /// + /// ExpeditionProgressSettings.xaml の相互作用ロジック + /// + public partial class ExpeditionProgressSettings : UserControl + { + public ExpeditionProgressSettings() + { + InitializeComponent(); + } + } +} diff --git a/source/Plugins/TaskbarProgress/Properties/Settings.Designer.cs b/source/Plugins/TaskbarProgress/Properties/Settings.Designer.cs index 5647d928d..18e8d2381 100644 --- a/source/Plugins/TaskbarProgress/Properties/Settings.Designer.cs +++ b/source/Plugins/TaskbarProgress/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 // //------------------------------------------------------------------------------ @@ -34,5 +34,17 @@ public double Interval { this["Interval"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ErrorIfAllWaiting { + get { + return ((bool)(this["ErrorIfAllWaiting"])); + } + set { + this["ErrorIfAllWaiting"] = value; + } + } } } diff --git a/source/Plugins/TaskbarProgress/Properties/Settings.settings b/source/Plugins/TaskbarProgress/Properties/Settings.settings index 65cb80439..b6b003fa3 100644 --- a/source/Plugins/TaskbarProgress/Properties/Settings.settings +++ b/source/Plugins/TaskbarProgress/Properties/Settings.settings @@ -5,5 +5,8 @@ 20000 + + False + \ No newline at end of file diff --git a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj index 31990c119..d80c09d8d 100644 --- a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj +++ b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj @@ -67,6 +67,9 @@ + + ExpeditionProgressSettings.xaml + @@ -105,6 +108,12 @@ Settings.Designer.cs + + + Designer + MSBuild:Compile + + mkdir "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins" diff --git a/source/Plugins/TaskbarProgress/app.config b/source/Plugins/TaskbarProgress/app.config index d5bc0a4dc..c9fb40d79 100644 --- a/source/Plugins/TaskbarProgress/app.config +++ b/source/Plugins/TaskbarProgress/app.config @@ -10,6 +10,9 @@ 20000 + + False + \ No newline at end of file From 50c6ffbfa549458803f10ecd384a2f390cf2c560 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Wed, 3 Feb 2016 03:06:10 +0900 Subject: [PATCH 41/67] =?UTF-8?q?=E5=90=8D=E5=89=8D=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=8F=20ID=20=E3=81=A7=E8=AA=8D=E8=AD=98=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Composition/ITaskbarProgress.cs | 7 +- .../Models/Settings/GeneralSettings.cs | 4 +- .../Models/TaskbarProgress.cs | 14 +- .../Settings/WindowSettingsViewModel.cs | 206 +++++++++--------- source/MetroTrilithon | 2 +- .../TaskbarProgress/ExpeditionProgress.cs | 8 +- 6 files changed, 128 insertions(+), 113 deletions(-) diff --git a/source/Grabacr07.KanColleViewer.Composition/Composition/ITaskbarProgress.cs b/source/Grabacr07.KanColleViewer.Composition/Composition/ITaskbarProgress.cs index 84100fc56..9d67330f6 100644 --- a/source/Grabacr07.KanColleViewer.Composition/Composition/ITaskbarProgress.cs +++ b/source/Grabacr07.KanColleViewer.Composition/Composition/ITaskbarProgress.cs @@ -13,10 +13,15 @@ namespace Grabacr07.KanColleViewer.Composition [PluginFeature] public interface ITaskbarProgress { + /// + /// この機能をシステムが識別するための ID を取得します。 + /// + string Id { get; } + /// /// この機能をユーザーが選択するときに識別するための名前を取得します。 /// - string Name { get; } + string DisplayName { get; } /// /// プログレス インジケーターに報告する現在の状態を取得します。 diff --git a/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs b/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs index 96adb8779..dbfcf2cb3 100644 --- a/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs +++ b/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs @@ -40,10 +40,10 @@ public static class GeneralSettings = new SerializableProperty(GetKey(), Providers.Roaming, Properties.Settings.Default.OverrideStyleSheet) { AutoSave = true }; /// - /// タスク バー インジケーターとして使用するプラグイン機能を識別する名前を取得します。 + /// タスク バー インジケーターとして使用するプラグイン機能を識別する ID を取得します。 /// public static SerializableProperty TaskbarProgressSource { get; } - = new SerializableProperty(GetKey(), Providers.Roaming) { AutoSave = true }; + = new SerializableProperty(GetKey(), Providers.Roaming, "") { AutoSave = true }; private static string GetKey([CallerMemberName] string propertyName = "") { diff --git a/source/Grabacr07.KanColleViewer/Models/TaskbarProgress.cs b/source/Grabacr07.KanColleViewer/Models/TaskbarProgress.cs index 8680b2e20..d427a5c39 100644 --- a/source/Grabacr07.KanColleViewer/Models/TaskbarProgress.cs +++ b/source/Grabacr07.KanColleViewer/Models/TaskbarProgress.cs @@ -15,7 +15,15 @@ public class TaskbarProgress : NotificationObject, ITaskbarProgress private ITaskbarProgress current; - string ITaskbarProgress.Name => "AggregateTaskbarProgress"; + string ITaskbarProgress.Id + { + get { throw new NotSupportedException(); } + } + + string ITaskbarProgress.DisplayName + { + get { throw new NotSupportedException(); } + } #region State 変更通知プロパティ @@ -62,9 +70,9 @@ public TaskbarProgress() GeneralSettings.TaskbarProgressSource.Subscribe(x => this.Change(x)); } - public void Change(string name) + public void Change(string id) { - this.Change(Features.FirstOrDefault(x => x.Name == name)); + this.Change(Features.FirstOrDefault(x => x.Id == id)); } public void Change(ITaskbarProgress progress) diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Settings/WindowSettingsViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Settings/WindowSettingsViewModel.cs index 198c52481..5e37f3e92 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Settings/WindowSettingsViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Settings/WindowSettingsViewModel.cs @@ -1,115 +1,113 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Controls; -using Grabacr07.KanColleViewer.Composition; -using Grabacr07.KanColleViewer.Models; -using Grabacr07.KanColleViewer.Models.Settings; -using Livet; -using MetroTrilithon.Linq; -using MetroTrilithon.Mvvm; - -namespace Grabacr07.KanColleViewer.ViewModels.Settings -{ - public class WindowSettingsViewModel : ViewModel - { - private KanColleWindowSettings settings; - +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Controls; +using Grabacr07.KanColleViewer.Models; +using Grabacr07.KanColleViewer.Models.Settings; +using Livet; +using MetroTrilithon.Linq; +using MetroTrilithon.Mvvm; + +namespace Grabacr07.KanColleViewer.ViewModels.Settings +{ + public class WindowSettingsViewModel : ViewModel + { + private KanColleWindowSettings settings; + public IReadOnlyCollection> ExitConfirmationTypes { get; } public IReadOnlyCollection> TaskbarProgressFeatures { get; } - #region IsSplit 変更通知プロパティ - - private bool _IsSplit; - - public bool IsSplit - { - get { return this._IsSplit; } - set - { - if (this._IsSplit != value) - { - this._IsSplit = value; - this.RaisePropertyChanged(); - } - } + #region IsSplit 変更通知プロパティ + + private bool _IsSplit; + + public bool IsSplit + { + get { return this._IsSplit; } + set + { + if (this._IsSplit != value) + { + this._IsSplit = value; + this.RaisePropertyChanged(); + } + } + } + + #endregion + + #region Dock 変更通知プロパティ + + private Dock _Dock; + + public Dock Dock + { + get { return this._Dock; } + set + { + if (this._Dock != value) + { + this._Dock = value; + this.RaisePropertyChanged(); + this.RaisePropertyChanged(nameof(this.DockLeft)); + this.RaisePropertyChanged(nameof(this.DockTop)); + this.RaisePropertyChanged(nameof(this.DockRight)); + this.RaisePropertyChanged(nameof(this.DockBottom)); + } + } } - #endregion - - #region Dock 変更通知プロパティ - - private Dock _Dock; - - public Dock Dock - { - get { return this._Dock; } - set - { - if (this._Dock != value) - { - this._Dock = value; - this.RaisePropertyChanged(); - this.RaisePropertyChanged(nameof(this.DockLeft)); - this.RaisePropertyChanged(nameof(this.DockTop)); - this.RaisePropertyChanged(nameof(this.DockRight)); - this.RaisePropertyChanged(nameof(this.DockBottom)); - } - } - } - - public bool DockLeft => this.Dock == Dock.Left; - public bool DockTop => this.Dock == Dock.Top; - public bool DockRight => this.Dock == Dock.Right; + public bool DockLeft => this.Dock == Dock.Left; + public bool DockTop => this.Dock == Dock.Top; + public bool DockRight => this.Dock == Dock.Right; public bool DockBottom => this.Dock == Dock.Bottom; #endregion + public WindowSettingsViewModel() + { + this.ExitConfirmationTypes = new List> + { + DisplayViewModel.Create(ExitConfirmationType.None, "確認しない"), + DisplayViewModel.Create(ExitConfirmationType.InSortieOnly, "出撃中のみ確認する"), + DisplayViewModel.Create(ExitConfirmationType.Always, "常に確認する"), + }; + this.TaskbarProgressFeatures = EnumerableEx + .Return(GeneralSettings.TaskbarProgressSource.ToDefaultDisplay("使用しない")) + .Concat(TaskbarProgress.Features.ToDisplay(x => x.Id, x => x.DisplayName)) + .ToList(); + } - public WindowSettingsViewModel() - { - this.ExitConfirmationTypes = new List> - { - DisplayViewModel.Create(ExitConfirmationType.None, "確認しない"), - DisplayViewModel.Create(ExitConfirmationType.InSortieOnly, "出撃中のみ確認する"), - DisplayViewModel.Create(ExitConfirmationType.Always, "常に確認する"), - }; - this.TaskbarProgressFeatures = EnumerableEx - .Return(DisplayViewModel.Create(GeneralSettings.TaskbarProgressSource.Default, "使用しない")) - .Concat(TaskbarProgress.Features.Select(x => DisplayViewModel.Create(x.Name, x.Name))) - .ToList(); - } - - public void Initialize() - { - this.settings = SettingsHost.Instance(); - this.settings?.IsSplit.Subscribe(x => this.IsSplit = x).AddTo(this); - this.settings?.Dock.Subscribe(x => this.Dock = x).AddTo(this); - } - - public void SetDockSettings(Dock dock) - { - this.Dock = dock; - } - - public void Apply() - { - if (this.settings != null) - { - this.settings.IsSplit.Value = this.IsSplit; - this.settings.Dock.Value = this.Dock; - } - } - - public void Cancel() - { - if (this.settings != null) - { - this.IsSplit = this.settings.IsSplit; - this.Dock = this.settings.Dock; - } - } - } -} + public void Initialize() + { + this.settings = SettingsHost.Instance(); + this.settings?.IsSplit.Subscribe(x => this.IsSplit = x).AddTo(this); + this.settings?.Dock.Subscribe(x => this.Dock = x).AddTo(this); + } + + public void SetDockSettings(Dock dock) + { + this.Dock = dock; + } + + public void Apply() + { + if (this.settings != null) + { + this.settings.IsSplit.Value = this.IsSplit; + this.settings.Dock.Value = this.Dock; + } + } + + public void Cancel() + { + if (this.settings != null) + { + this.IsSplit = this.settings.IsSplit; + this.Dock = this.settings.Dock; + } + } + } +} diff --git a/source/MetroTrilithon b/source/MetroTrilithon index 6145c24aa..4ef0b7cfc 160000 --- a/source/MetroTrilithon +++ b/source/MetroTrilithon @@ -1 +1 @@ -Subproject commit 6145c24aa037349b2a3ebf07754d35e75799fb0f +Subproject commit 4ef0b7cfcc264503e86a1e25d960c7ae73970a96 diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs index daf56d276..735a6ec4d 100644 --- a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs +++ b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs @@ -16,18 +16,22 @@ namespace Grabacr07.KanColleViewer.Plugins { [Export(typeof(IPlugin))] [Export(typeof(ITaskbarProgress))] - [ExportMetadata("Guid", "C8BF00A6-9FD4-4CC4-8FC5-ECCC5675CDEB")] + [ExportMetadata("Guid", guid)] [ExportMetadata("Title", "ExpeditionProgressIndicator")] [ExportMetadata("Description", "遠征の状況をタスク バー インジケーターに報告します。")] [ExportMetadata("Version", "1.0")] [ExportMetadata("Author", "@Grabacr07")] public class ExpeditionProgress : IPlugin, ITaskbarProgress, ISettings, IDisposableHolder { + private const string guid = "C8BF00A6-9FD4-4CC4-8FC5-ECCC5675CDEB"; + private readonly MultipleDisposable compositDisposable = new MultipleDisposable(); private ExpeditionWrapper[] wrappers; private bool initialized; - public string Name => "遠征状況"; + public string Id => guid + "-1"; + + public string DisplayName => "遠征状況"; public TaskbarItemProgressState State { get; private set; } From 49958f888351571cb8a6fa6de13fe5ed65c4e78e Mon Sep 17 00:00:00 2001 From: veigr Date: Wed, 3 Feb 2016 17:38:34 +0900 Subject: [PATCH 42/67] =?UTF-8?q?const=20=E3=81=AA=20GUID=20ExportMetadata?= =?UTF-8?q?=20=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvalidGuidMetadataTest.cs | 26 ++++++++++++++++ .../DuplicateGuidAnalyzer.cs | 2 +- .../DuplicateGuidCodeFixProvider.cs | 4 +-- .../ExportGuidMetadataCodeFixProvider.cs | 6 ++-- .../InvalidGuidMetadataAnalyzer.cs | 15 ++++++---- .../InvalidGuidMetadataCodeFixProvider.cs | 13 ++++---- .../Properties/AssemblyInfo.cs | 2 +- .../KanColleViewer.PluginAnalyzer/Utility.cs | 30 +++++++++++++++++-- .../TaskbarProgress/ExpeditionProgress.cs | 1 + .../TaskbarProgress/TaskbarProgress.csproj | 4 +++ 10 files changed, 82 insertions(+), 21 deletions(-) diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs index 7f0b3c72e..1345e9d4b 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs @@ -66,6 +66,32 @@ public void Initialize() { } this.VerifyCSharpDiagnostic(test); } + [TestMethod] + public void ValidGuidConst() + { + Utility.NewGuidValueForTest = Const.NewGuidValueForTest; + + var test = new[] { +@" +using System; +using System.ComponentModel.Composition; +using Grabacr07.KanColleViewer.Composition; + +[Export(typeof(IPlugin))] +[ExportMetadata(""Guid"", guid)] +[ExportMetadata(""Title"", ""MastarData"")] +[ExportMetadata(""Description"", ""start2 で取得される、艦これのマスター データを閲覧するためのビュー機能を提供します。"")] +[ExportMetadata(""Version"", ""1.0"")] +[ExportMetadata(""Author"", ""@Grabacr07"")] +class Hoge : IPlugin +{ + private const string guid = ""C8BF00A6-9FD4-4CC4-8FC5-ECCC5675CDEB""; + public void Initialize() { } +}", + }; + this.VerifyCSharpDiagnostic(test); + } + [TestMethod] public void MissingGuidValue() { diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidAnalyzer.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidAnalyzer.cs index 8ad81d600..8b91cf9d5 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidAnalyzer.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidAnalyzer.cs @@ -44,7 +44,7 @@ private static void AnalyzeCompilation(CompilationAnalysisContext context) .ToArray(); var dupe = plugins - .GroupBy(x => x.GetGuidMetadataValue()) + .GroupBy(x => x.GetGuidMetadataValue(compilation.GetSemanticModel(x.SyntaxTree))) .Where(x => 1 < x.Count()) .ToArray(); diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidCodeFixProvider.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidCodeFixProvider.cs index 404610541..7383cc718 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidCodeFixProvider.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/DuplicateGuidCodeFixProvider.cs @@ -50,12 +50,12 @@ public override sealed async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); //他のIPluginで使われてないGUIDを持ってるPluginFeatureがいたらそのGUIDを候補に - var candidates = features.Where(x => plugins.All(y => x.GetGuidMetadataValue() != y.GetGuidMetadataValue())); + var candidates = features.Where(x => plugins.All(y => x.GetGuidMetadataValue(model) != y.GetGuidMetadataValue(model))); foreach (var candidate in candidates) { var additionalAction = CodeAction.Create( $"Use Guid of {candidate.Identifier}", - _ => FixGuidExportMetadata(context.Document, root, classDeclaration, candidate.GetGuidMetadataValue()), + _ => FixGuidExportMetadata(context.Document, root, classDeclaration, candidate.GetGuidMetadataValue(model).ToString().ToUpper()), $"{DuplicateGuidAnalyzer.DiagnosticId} Use Guid of {candidate.Identifier}"); context.RegisterCodeFix(additionalAction, diagnostic); } diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/ExportGuidMetadataCodeFixProvider.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/ExportGuidMetadataCodeFixProvider.cs index 727ca52d6..f9bff654a 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/ExportGuidMetadataCodeFixProvider.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/ExportGuidMetadataCodeFixProvider.cs @@ -54,12 +54,12 @@ public override sealed async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); //他のIPluginで使われてないGUIDを持ってるPluginFeatureがいたらそのGUIDを候補に - var candidates = features.Where(x => plugins.All(y => x.GetGuidMetadataValue() != y.GetGuidMetadataValue())); + var candidates = features.Where(x => plugins.All(y => x.GetGuidMetadataValue(model) != y.GetGuidMetadataValue(model))); foreach (var candidate in candidates) { var additionalAction = CodeAction.Create( $"Add Guid of {candidate.Identifier}", - _ => AddGuidExportMetadata(context.Document, root, classDeclaration, candidate.GetGuidMetadataValue()), + _ => AddGuidExportMetadata(context.Document, root, classDeclaration, candidate.GetGuidMetadataValue(model).ToString().ToUpper()), $"{ExportGuidMetadataAnalyzer.DiagnosticId} Add Guid of {candidate.Identifier}"); context.RegisterCodeFix(additionalAction, diagnostic); } @@ -71,7 +71,7 @@ public override sealed async Task RegisterCodeFixesAsync(CodeFixContext context) { var additionalAction = CodeAction.Create( $"Add Guid of {plugin.Identifier}", - _ => AddGuidExportMetadata(context.Document, root, classDeclaration, plugin.GetGuidMetadataValue()), + _ => AddGuidExportMetadata(context.Document, root, classDeclaration, plugin.GetGuidMetadataValue(model).ToString().ToUpper()), $"{ExportGuidMetadataAnalyzer.DiagnosticId} Add Guid of {plugin.Identifier}"); context.RegisterCodeFix(additionalAction, diagnostic); } diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs index ae7e5737e..ad76c8eb5 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataAnalyzer.cs @@ -43,17 +43,20 @@ private static void AnalyzeCompilation(CompilationAnalysisContext context) .Where(x => x.IsPluginClass()) .ToArray(); var plugins = allPlugins.Where(x => x.IsExportIPlugin()).ToArray(); - + foreach (var p in allPlugins) { - var guidVaue = p.GetGuidMetadataValue(); - if (guidVaue == null) continue; //GUID な Metadata がない場合はスルー + var semanticModel = compilation.GetSemanticModel(p.SyntaxTree); + var syntax = p.GetGuidMetadataValueSyntax(); + if (syntax == null) continue; //GUID な Metadata がない場合はスルー // GUID として解釈できない値か、IPlugin で未定義の GUID が指定されてたらアウト - Guid guid; - if (!Guid.TryParse(guidVaue, out guid) - || plugins.All(x => x.GetGuidMetadataValue().ToUpper() != guidVaue.ToUpper())) + var guidMetadata = syntax.GetGuidMetadata(semanticModel); + if (!guidMetadata.HasValue + || plugins.All(x => x.GetGuidMetadataValueSyntax()?.GetGuidMetadata(semanticModel) != guidMetadata)) + { context.ReportDiagnostic(Diagnostic.Create(InvalidGuidMetadataRule, p.GetLocation())); + } } } } diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataCodeFixProvider.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataCodeFixProvider.cs index 5e900ad87..0892b1049 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataCodeFixProvider.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/InvalidGuidMetadataCodeFixProvider.cs @@ -41,24 +41,25 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) .ToArray(); var plugins = classes.Where(x => x.IsExportIPlugin()).ToArray(); - var guidValue = classDeclaration.GetGuidMetadataValue(); + var guidValue = classDeclaration.GetGuidMetadataValue(model); // IPlugin で未定義の GUID が指定されていた場合、既存の IPlugin の GUID を全て候補に - if (plugins.All(x => x.GetGuidMetadataValue() != guidValue)) + if (plugins.Select(x => x.GetGuidMetadataValue(model)) + .Where(x => x.HasValue) + .All(x => x != guidValue)) { foreach (var plugin in plugins) { var codeAction = CodeAction.Create( $"Use Guid of {plugin.Identifier}", - _ => FixGuidExportMetadata(context.Document, root, classDeclaration, plugin.GetGuidMetadataValue()), + _ => FixGuidExportMetadata(context.Document, root, classDeclaration, plugin.GetGuidMetadataValue(model).ToString().ToUpper()), $"{InvalidGuidMetadataAnalyzer.DiagnosticId} Use Guid of {plugin.Identifier}"); context.RegisterCodeFix(codeAction, diagnostic); } } - // GUID として解釈が指定されていた場合、新 GUID を候補に - Guid _guid; - if (!Guid.TryParse(guidValue, out _guid)) + // GUID として解釈出来ない値が指定されていた場合、新 GUID を候補に + if (!guidValue.HasValue) { var codeAction = CodeAction.Create( "Use New Guid", diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs index 0fe19d163..4654394ef 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/Properties/AssemblyInfo.cs @@ -24,4 +24,4 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.2.0")] +[assembly: AssemblyVersion("1.1.0.0")] diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs index 2eb5aa267..a6d654e03 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Grabacr07.KanColleViewer.Composition; using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis; namespace Grabacr07.KanColleViewer.PluginAnalyzer { @@ -111,11 +112,36 @@ public static bool RequireGuidMetadata(this ClassDeclarationSyntax classDeclarat return isRequired && !isDefined; } - public static string GetGuidMetadataValue(this ClassDeclarationSyntax classDeclaration) + public static Guid? GetGuidMetadata(this AttributeArgumentSyntax syntax, SemanticModel semanticModel) + { + Guid guid; + if (Guid.TryParse(syntax.GetGuidMetadataValue(), out guid)) return guid; + if (Guid.TryParse(syntax.GetGuidMetadataConstantValue(semanticModel), out guid)) return guid; + return null; + } + + public static Guid? GetGuidMetadataValue(this ClassDeclarationSyntax classDeclaration, SemanticModel semanticModel) + { + return classDeclaration.GetGuidMetadataValueSyntax()?.GetGuidMetadata(semanticModel); + } + + public static string GetGuidMetadataValue(this AttributeArgumentSyntax syntax) + { + return syntax?.ToString().Replace("\"", ""); + } + + private static string GetGuidMetadataConstantValue(this AttributeArgumentSyntax syntax, SemanticModel semanticModel) + { + if (syntax == null) return null; + var constantValue = semanticModel.GetConstantValue(syntax.Expression); + return constantValue.HasValue ? constantValue.Value.ToString() : null; + } + + public static AttributeArgumentSyntax GetGuidMetadataValueSyntax(this ClassDeclarationSyntax classDeclaration) { return classDeclaration.GetAttributes("ExportMetadata") .FirstOrDefault(a => a.ArgumentList.Arguments[0].ToString() == $"\"{nameof(IPluginGuid.Guid)}\"") - ?.ArgumentList.Arguments[1].ToString().Replace("\"", ""); + ?.ArgumentList.Arguments[1]; } public static IEnumerable GetAttributes(this ClassDeclarationSyntax classDeclaration, string attributeName) diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs index 735a6ec4d..d410d31d7 100644 --- a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs +++ b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs @@ -16,6 +16,7 @@ namespace Grabacr07.KanColleViewer.Plugins { [Export(typeof(IPlugin))] [Export(typeof(ITaskbarProgress))] + [Export(typeof(ISettings))] [ExportMetadata("Guid", guid)] [ExportMetadata("Title", "ExpeditionProgressIndicator")] [ExportMetadata("Description", "遠征の状況をタスク バー インジケーターに報告します。")] diff --git a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj index d80c09d8d..cf42ce91a 100644 --- a/source/Plugins/TaskbarProgress/TaskbarProgress.csproj +++ b/source/Plugins/TaskbarProgress/TaskbarProgress.csproj @@ -114,6 +114,10 @@ MSBuild:Compile + + + + mkdir "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins" From ae9397610a2880ee5acb18e3bd254887c4d133e3 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Wed, 3 Feb 2016 17:59:42 +0900 Subject: [PATCH 43/67] =?UTF-8?q?=E8=AC=8E=20package.config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/KanColleViewer.sln | 3 --- 1 file changed, 3 deletions(-) diff --git a/source/KanColleViewer.sln b/source/KanColleViewer.sln index 3ba37b4b3..89015248a 100644 --- a/source/KanColleViewer.sln +++ b/source/KanColleViewer.sln @@ -19,9 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".settings", ".settings", "{ EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{D844E42C-9406-43BF-9681-4F06F6CB3AD9}" - ProjectSection(SolutionItems) = preProject - MetroTrilithon\source\MetroTrilithon.Desktop\packages.config = MetroTrilithon\source\MetroTrilithon.Desktop\packages.config - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsNotifier", "Plugins\WindowsNotifier\WindowsNotifier.csproj", "{55C0036D-3206-4C63-A2C0-447C41CAFAF5}" EndProject From d7997028a05d93c655001ad12d5fb38eab65bf9e Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Wed, 3 Feb 2016 18:45:21 +0900 Subject: [PATCH 44/67] =?UTF-8?q?Dispose=20=E5=BF=98=E3=82=8C=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Plugins/TaskbarProgress/ExpeditionProgress.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs index 735a6ec4d..abdf9dd19 100644 --- a/source/Plugins/TaskbarProgress/ExpeditionProgress.cs +++ b/source/Plugins/TaskbarProgress/ExpeditionProgress.cs @@ -62,7 +62,7 @@ public void Initialize() timer.Tick += (sender, e) => this.Update(); timer.Start(); - Disposable.Create(() => Settings.Default.Save()); + Disposable.Create(() => Settings.Default.Save()).AddTo(this); } private void InitializeCore() From 581fe8b683f1aa9cee731c9ee65ff2e147d930a1 Mon Sep 17 00:00:00 2001 From: veigr Date: Wed, 3 Feb 2016 19:16:45 +0900 Subject: [PATCH 45/67] =?UTF-8?q?const=20=E3=81=A7=20GUID=20=E3=81=AB=20nu?= =?UTF-8?q?ll=20=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E6=AD=BB=E3=81=AC=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20Plugins=20=E3=81=AE=E4=B8=AD=E8=BA=AB=E3=81=AB=20An?= =?UTF-8?q?alyzer=20=E3=81=AE=E5=8F=82=E7=85=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvalidGuidMetadataTest.cs | 34 +++++++++++++++++++ .../KanColleViewer.PluginAnalyzer/Utility.cs | 2 +- source/Plugins/Counter/Counter.csproj | 4 +++ .../MasterDataViewer/MasterDataViewer.csproj | 4 +++ .../WindowsNotifier/WindowsNotifier.csproj | 4 +++ 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs index 1345e9d4b..27ceea1be 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer.Test/InvalidGuidMetadataTest.cs @@ -135,6 +135,40 @@ public void Initialize() { } this.VerifyCSharpDiagnostic(test, expected); } + + [TestMethod] + public void NullGuidValue() + { + Utility.NewGuidValueForTest = Const.NewGuidValueForTest; + + var test = new[] { +@" +using System; +using System.ComponentModel.Composition; +using Grabacr07.KanColleViewer.Composition; + +[Export(typeof(IPlugin))] +[ExportMetadata(""Guid"", guid)] +[ExportMetadata(""Title"", ""MastarData"")] +[ExportMetadata(""Description"", ""start2 で取得される、艦これのマスター データを閲覧するためのビュー機能を提供します。"")] +[ExportMetadata(""Version"", ""1.0"")] +[ExportMetadata(""Author"", ""@Grabacr07"")] +class Hoge : IPlugin +{ + private const string guid = null; + public void Initialize() { } +}", + }; + var expected = new DiagnosticResult + { + Id = InvalidGuidMetadataAnalyzer.DiagnosticId, + Severity = DiagnosticSeverity.Warning, + Message = invalidGuidMessage, + Locations = new[] { new DiagnosticResultLocation("Test0.cs", 6, 1) } + }; + this.VerifyCSharpDiagnostic(test, expected); + } + [TestMethod] public void DifferentFromIPluginGuid() { diff --git a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs index a6d654e03..48abde86e 100644 --- a/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs +++ b/source/Analyzers/KanColleViewer.PluginAnalyzer/Utility.cs @@ -134,7 +134,7 @@ private static string GetGuidMetadataConstantValue(this AttributeArgumentSyntax { if (syntax == null) return null; var constantValue = semanticModel.GetConstantValue(syntax.Expression); - return constantValue.HasValue ? constantValue.Value.ToString() : null; + return constantValue.Value?.ToString() ?? null; } public static AttributeArgumentSyntax GetGuidMetadataValueSyntax(this ClassDeclarationSyntax classDeclaration) diff --git a/source/Plugins/Counter/Counter.csproj b/source/Plugins/Counter/Counter.csproj index 3070683f8..5d22fb19f 100644 --- a/source/Plugins/Counter/Counter.csproj +++ b/source/Plugins/Counter/Counter.csproj @@ -175,6 +175,10 @@ MSBuild:Compile + + + + diff --git a/source/Plugins/MasterDataViewer/MasterDataViewer.csproj b/source/Plugins/MasterDataViewer/MasterDataViewer.csproj index 463974090..b8e810c52 100644 --- a/source/Plugins/MasterDataViewer/MasterDataViewer.csproj +++ b/source/Plugins/MasterDataViewer/MasterDataViewer.csproj @@ -149,6 +149,10 @@ MSBuild:Compile + + + + mkdir "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins" diff --git a/source/Plugins/WindowsNotifier/WindowsNotifier.csproj b/source/Plugins/WindowsNotifier/WindowsNotifier.csproj index 76682f570..021a5ebf4 100644 --- a/source/Plugins/WindowsNotifier/WindowsNotifier.csproj +++ b/source/Plugins/WindowsNotifier/WindowsNotifier.csproj @@ -90,6 +90,10 @@ + + + + mkdir "$(SolutionDir)Grabacr07.KanColleViewer\bin\$(ConfigurationName)\Plugins" From bc556a6ff5e6f5607c9697dd44374d2e60647a1b Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sat, 6 Feb 2016 02:24:09 +0900 Subject: [PATCH 46/67] =?UTF-8?q?=E8=AC=8E=E3=83=95=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=BA=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Grabacr07.KanColleWrapper/Internal/Extensions.cs | 11 ----------- source/Grabacr07.KanColleWrapper/KanColleClient.cs | 1 + source/MetroTrilithon | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/source/Grabacr07.KanColleWrapper/Internal/Extensions.cs b/source/Grabacr07.KanColleWrapper/Internal/Extensions.cs index 1d96d58f9..652c15e44 100644 --- a/source/Grabacr07.KanColleWrapper/Internal/Extensions.cs +++ b/source/Grabacr07.KanColleWrapper/Internal/Extensions.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using Nekoxy; @@ -21,15 +20,5 @@ public static string GetResponseAsJson(this Session session) { return array?.Length > index ? (int?)array[index] : null; } - - public static Task WhenAll(this IEnumerable tasks) - { - return Task.WhenAll(tasks); - } - - public static Task WhenAll(this IEnumerable> tasks) - { - return Task.WhenAll(tasks); - } } } diff --git a/source/Grabacr07.KanColleWrapper/KanColleClient.cs b/source/Grabacr07.KanColleWrapper/KanColleClient.cs index b7bcdc72e..bfe39327b 100644 --- a/source/Grabacr07.KanColleWrapper/KanColleClient.cs +++ b/source/Grabacr07.KanColleWrapper/KanColleClient.cs @@ -7,6 +7,7 @@ using Grabacr07.KanColleWrapper.Internal; using Grabacr07.KanColleWrapper.Models; using Grabacr07.KanColleWrapper.Models.Raw; +using MetroTrilithon.Threading.Tasks; namespace Grabacr07.KanColleWrapper { diff --git a/source/MetroTrilithon b/source/MetroTrilithon index 4ef0b7cfc..29cc769c3 160000 --- a/source/MetroTrilithon +++ b/source/MetroTrilithon @@ -1 +1 @@ -Subproject commit 4ef0b7cfcc264503e86a1e25d960c7ae73970a96 +Subproject commit 29cc769c363025ef0919ec58f31948afec0c682f From 3919d27402682ff0fc25dee0a0c8dbe6864caa99 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sat, 6 Feb 2016 06:30:49 +0900 Subject: [PATCH 47/67] =?UTF-8?q?=E8=89=A6=E9=9A=8A=E3=82=B9=E3=83=86?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=B9=E6=98=8E=E7=9F=B3=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=EF=BC=8B=E8=89=A6=E9=9A=8A=E8=A9=B3=E7=B4=B0?= =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Migration/_KanColleClientSettings.cs | 1 + .../Models/Settings/KanColleSettings.cs | 7 + .../Views/Contents/Overview.xaml | 10 - .../Contents/StateDetailIndicator.xaml.cs | 17 +- .../Views/FleetWindow.xaml | 669 +++++++++--------- .../Views/Settings/Operation.xaml | 8 +- .../IKanColleClientSettings.cs | 5 + .../Models/CombinedFleet.cs | 2 +- .../Models/FleetSituation.cs | 5 + .../Models/FleetState.cs | 10 + .../TimerNotifier.cs | 1 - .../TaskbarProgress/ExpeditionWrapper.cs | 6 +- 12 files changed, 383 insertions(+), 358 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/Models/Migration/_KanColleClientSettings.cs b/source/Grabacr07.KanColleViewer/Models/Migration/_KanColleClientSettings.cs index b330b7917..b73925755 100644 --- a/source/Grabacr07.KanColleViewer/Models/Migration/_KanColleClientSettings.cs +++ b/source/Grabacr07.KanColleViewer/Models/Migration/_KanColleClientSettings.cs @@ -19,6 +19,7 @@ public class _KanColleClientSettings : IKanColleClientSettings public int NotificationShorteningTime { get; set; } public int ReSortieCondition { get; set; } public string ViewRangeCalcType { get; set; } + public bool CheckFlagshipIsRepairShip { get; set; } event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { diff --git a/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs b/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs index 18209e6ae..9d5134444 100644 --- a/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs +++ b/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs @@ -75,6 +75,11 @@ public class KanColleSettings : IKanColleClientSettings public static SerializableProperty DisplayMaterial2 { get; } = new SerializableProperty(GetKey(), Providers.Roaming, nameof(Materials.InstantBuildMaterials)); + /// + /// 艦隊ステータスにおいて、旗艦が工作艦でないことを確認するかどうかを表す設定値を取得します。 + /// + public static SerializableProperty CheckFlagshipIsNotRepairShip { get; } + = new SerializableProperty(GetKey(), Providers.Roaming, true); #region instance members @@ -102,6 +107,8 @@ protected void RaisePropertyChanged([CallerMemberName] string propertyName = nul string IKanColleClientSettings.ViewRangeCalcType => ViewRangeCalcType.Value; + bool IKanColleClientSettings.CheckFlagshipIsRepairShip => CheckFlagshipIsNotRepairShip.Value; + #endregion diff --git a/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml b/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml index ffc6f697b..5118e60a3 100644 --- a/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Contents/Overview.xaml @@ -171,16 +171,6 @@ - - - /// StateDetailIndicator.xaml の相互作用ロジック - /// - public partial class StateDetailIndicator : UserControl + partial class StateDetailIndicator { public StateDetailIndicator() { - InitializeComponent(); + this.InitializeComponent(); } } } diff --git a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml index e9cef3888..20dddf307 100644 --- a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml @@ -479,23 +479,20 @@ - - - - - + + + + + - - - - - - - + + Margin="4"> - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - + + + + + + + - + + @@ -759,208 +753,231 @@ - - - - + + + + + + + + + + + + + + + + - - + Value="連合艦隊は遠征に参加できません" /> + + + + + + - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + - - + + - + d:DataContext="{d:DesignInstance fleetsVm:FleetViewModel}" + Margin="4"> @@ -970,8 +987,7 @@ + BorderBrush="{DynamicResource BorderBrushKey}"> @@ -1022,7 +1038,6 @@ diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml index f05f4468a..38d221817 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml @@ -19,13 +19,13 @@ - - + @@ -50,6 +50,10 @@ + + string ViewRangeCalcType { get; } + + /// + /// 艦隊ステータスにおいて、旗艦が工作艦かどうかを確認するかどうかを示す値を取得します。 + /// + bool CheckFlagshipIsRepairShip { get; } } } diff --git a/source/Grabacr07.KanColleWrapper/Models/CombinedFleet.cs b/source/Grabacr07.KanColleWrapper/Models/CombinedFleet.cs index c30de7a03..47b1b814e 100644 --- a/source/Grabacr07.KanColleWrapper/Models/CombinedFleet.cs +++ b/source/Grabacr07.KanColleWrapper/Models/CombinedFleet.cs @@ -90,7 +90,7 @@ public CombinedFleet(Homeport parent, params Fleet[] fleets) private void UpdateName() { - this.Name = this.Fleets.Select(x => x.Name).JoinString(", "); + this.Name = this.Fleets.Select(x => x.Name).JoinString(Environment.NewLine); } } } diff --git a/source/Grabacr07.KanColleWrapper/Models/FleetSituation.cs b/source/Grabacr07.KanColleWrapper/Models/FleetSituation.cs index c29866c23..f792225c6 100644 --- a/source/Grabacr07.KanColleWrapper/Models/FleetSituation.cs +++ b/source/Grabacr07.KanColleWrapper/Models/FleetSituation.cs @@ -47,5 +47,10 @@ public enum FleetSituation /// 艦隊に入渠中の艦娘がいます。 ///
Repairing = 1 << 6, + + /// + /// 旗艦が工作艦です。 + /// + FlagshipIsRepairShip = 1 << 7, } } diff --git a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs index beee65dc0..d9d8cb560 100644 --- a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs +++ b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs @@ -353,6 +353,16 @@ public void Update() ready = false; } + var flagshipIsRepairShip = this.source + .Where(x => x.Ships.Length >= 1) + .Select(x => x.Ships[0]) + .Any(x => x.Info.ShipType.Id == 19); + if (flagshipIsRepairShip) + { + state |= FleetSituation.FlagshipIsRepairShip; + if (KanColleClient.Current.Settings.CheckFlagshipIsRepairShip) ready = false; + } + this.Situation = state; this.IsReady = ready; diff --git a/source/Grabacr07.KanColleWrapper/TimerNotifier.cs b/source/Grabacr07.KanColleWrapper/TimerNotifier.cs index 65187f5ca..1002dec3d 100644 --- a/source/Grabacr07.KanColleWrapper/TimerNotifier.cs +++ b/source/Grabacr07.KanColleWrapper/TimerNotifier.cs @@ -4,7 +4,6 @@ using System.Reactive.Linq; using System.Reactive.Subjects; using System.Threading.Tasks; -using Grabacr07.KanColleWrapper.Internal; namespace Grabacr07.KanColleWrapper { diff --git a/source/Plugins/TaskbarProgress/ExpeditionWrapper.cs b/source/Plugins/TaskbarProgress/ExpeditionWrapper.cs index 387247e9d..3cc0a1aaa 100644 --- a/source/Plugins/TaskbarProgress/ExpeditionWrapper.cs +++ b/source/Plugins/TaskbarProgress/ExpeditionWrapper.cs @@ -38,8 +38,10 @@ public ExpeditionWrapper(int id, Expedition expedition) { this.Id = id; this.Source = expedition; - this.Source.Subscribe(nameof(Expedition.Remaining), () => this.UpdateState()).AddTo(this); - this.Source.Subscribe(nameof(Expedition.ReturnTime), () => this.UpdateState()).AddTo(this); + this.Source + .Subscribe(nameof(Expedition.ReturnTime), () => this.UpdateState()).AddTo(this) + .Subscribe(nameof(Expedition.Remaining), () => this.UpdateState()).AddTo(this); + } private void UpdateState() From 441fc4d344d9e770d98e07f50de077fc0395387a Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 01:50:24 +0900 Subject: [PATCH 48/67] =?UTF-8?q?=E8=89=A6=E9=9A=8A=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E7=9A=84=E3=81=AA=E3=82=82=E3=81=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KanColleViewer.csproj | 4 +++ .../Models/Settings/KanColleSettings.cs | 12 +++++++++ .../Contents/Fleets/FleetsViewModel.cs | 26 +++++++++++++++++-- .../Views/Settings/Operation.xaml | 18 ++++++++++++- .../Grabacr07.KanColleViewer/packages.config | 1 + .../Grabacr07.KanColleWrapper/Models/Fleet.cs | 19 +++++++++++++- source/MetroTrilithon | 2 +- 7 files changed, 77 insertions(+), 5 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj index eaa088218..dabd596e0 100644 --- a/source/Grabacr07.KanColleViewer/KanColleViewer.csproj +++ b/source/Grabacr07.KanColleViewer/KanColleViewer.csproj @@ -89,6 +89,10 @@ ..\packages\Nekoxy.1.5.2.20\lib\net45\Nekoxy.dll True
+ + ..\packages\StatefulModel.0.5.0\lib\portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10\StatefulModel.dll + True + diff --git a/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs b/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs index 9d5134444..195996a76 100644 --- a/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs +++ b/source/Grabacr07.KanColleViewer/Models/Settings/KanColleSettings.cs @@ -81,6 +81,18 @@ public class KanColleSettings : IKanColleClientSettings public static SerializableProperty CheckFlagshipIsNotRepairShip { get; } = new SerializableProperty(GetKey(), Providers.Roaming, true); + /// + /// 艦隊の編成が変更されたときに、その艦隊を自動的に選択状態にするかどうかを表す設定値を取得します。 + /// + public static SerializableProperty AutoFleetSelectWhenShipsChanged { get; } + = new SerializableProperty(GetKey(), Providers.Roaming, false); + + /// + /// 艦隊が出撃・帰投したときに、その艦隊を自動的に選択状態にするかどうかを表す設定値を取得します。 + /// + public static SerializableProperty AutoFleetSelectWhenSortie { get; } + = new SerializableProperty(GetKey(), Providers.Roaming, true); + #region instance members public event PropertyChangedEventHandler PropertyChanged; diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs index 68a034a3b..7453696d1 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs @@ -2,15 +2,20 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Grabacr07.KanColleViewer.Models.Settings; using Grabacr07.KanColleWrapper; -using Livet.EventListeners; +using Grabacr07.KanColleWrapper.Models; using Livet.Messaging; +using MetroTrilithon.Lifetime; using MetroTrilithon.Mvvm; +using StatefulModel; namespace Grabacr07.KanColleViewer.ViewModels.Contents.Fleets { public class FleetsViewModel : TabItemViewModel { + private MultipleDisposable fleetListeners; + public override string Name { get { return Properties.Resources.Fleets; } @@ -65,6 +70,9 @@ public FleetsViewModel() KanColleClient.Current.Homeport.Organization .Subscribe(nameof(Organization.Fleets), this.UpdateFleets) .AddTo(this); + Disposable + .Create(() => this.fleetListeners?.Dispose()) + .AddTo(this); } public void ShowFleetWindow() @@ -77,8 +85,22 @@ public void ShowFleetWindow() private void UpdateFleets() { - this.Fleets = KanColleClient.Current.Homeport.Organization.Fleets.Select(kvp => new FleetViewModel(kvp.Value)).ToArray(); + this.fleetListeners?.Dispose(); + this.fleetListeners = new MultipleDisposable(); + + this.Fleets = KanColleClient.Current.Homeport.Organization.Fleets + .Select(kvp => this.ToViewModel(kvp.Value)) + .ToArray(); this.SelectedFleet = this.Fleets.FirstOrDefault(); } + + private FleetViewModel ToViewModel(Fleet fleet) + { + var vm = new FleetViewModel(fleet).AddTo(this.fleetListeners); + fleet.Subscribe(nameof(Fleet.Ships), () => { if (KanColleSettings.AutoFleetSelectWhenShipsChanged) this.SelectedFleet = vm; }, false).AddTo(this.fleetListeners); + fleet.Subscribe(nameof(Fleet.IsInSortie), () => { if (KanColleSettings.AutoFleetSelectWhenSortie) this.SelectedFleet = vm; }, false).AddTo(this.fleetListeners); + + return vm; + } } } diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml index 38d221817..d216ccb48 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml @@ -8,7 +8,7 @@ xmlns:vms="clr-namespace:Grabacr07.KanColleViewer.ViewModels.Settings" mc:Ignorable="d" d:DesignWidth="500" - d:DesignHeight="300" + d:DesignHeight="500" d:DataContext="{d:DesignInstance vms:SettingsViewModel}"> @@ -86,6 +86,22 @@ + + + + + + + + + + diff --git a/source/Grabacr07.KanColleViewer/packages.config b/source/Grabacr07.KanColleViewer/packages.config index 28d59e243..8a366094e 100644 --- a/source/Grabacr07.KanColleViewer/packages.config +++ b/source/Grabacr07.KanColleViewer/packages.config @@ -11,4 +11,5 @@ + \ No newline at end of file diff --git a/source/Grabacr07.KanColleWrapper/Models/Fleet.cs b/source/Grabacr07.KanColleWrapper/Models/Fleet.cs index ada5344d9..132076dbc 100644 --- a/source/Grabacr07.KanColleWrapper/Models/Fleet.cs +++ b/source/Grabacr07.KanColleWrapper/Models/Fleet.cs @@ -75,7 +75,24 @@ private set #endregion - public bool IsInSortie { get; private set; } + #region IsInSortie 変更通知プロパティ + + private bool _IsInSortie; + + public bool IsInSortie + { + get { return this._IsInSortie; } + set + { + if (this._IsInSortie != value) + { + this._IsInSortie = value; + this.RaisePropertyChanged(); + } + } + } + + #endregion public FleetState State { get; } diff --git a/source/MetroTrilithon b/source/MetroTrilithon index 29cc769c3..c891fa0d2 160000 --- a/source/MetroTrilithon +++ b/source/MetroTrilithon @@ -1 +1 @@ -Subproject commit 29cc769c363025ef0919ec58f31948afec0c682f +Subproject commit c891fa0d28310cade91b235277ef91627c4ea084 From b0a4ef607f2b8adadb375c48f8f59b3a70e05577 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 01:56:00 +0900 Subject: [PATCH 49/67] =?UTF-8?q?=E4=BD=9C=E6=A5=AD=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Grabacr07.KanColleViewer/Application.xaml.cs | 8 ++++---- .../Models/Settings/GeneralSettings.cs | 6 ++++++ source/KanColleViewer.sln.DotSettings | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/Application.xaml.cs b/source/Grabacr07.KanColleViewer/Application.xaml.cs index 902b18f4e..f763630aa 100644 --- a/source/Grabacr07.KanColleViewer/Application.xaml.cs +++ b/source/Grabacr07.KanColleViewer/Application.xaml.cs @@ -48,7 +48,7 @@ static Application() } private readonly LivetCompositeDisposable compositeDisposable = new LivetCompositeDisposable(); - private event PropertyChangedEventHandler PropertyChangedInternal; + private event PropertyChangedEventHandler propertyChangedInternal; /// /// 現在の オブジェクトを取得します。 @@ -244,13 +244,13 @@ private static void ReportException(object sender, Exception exception) event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { - add { this.PropertyChangedInternal += value; } - remove { this.PropertyChangedInternal -= value; } + add { this.propertyChangedInternal += value; } + remove { this.propertyChangedInternal -= value; } } private void RaisePropertyChanged([CallerMemberName] string propertyName = null) { - this.PropertyChangedInternal?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + this.propertyChangedInternal?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } #endregion diff --git a/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs b/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs index dbfcf2cb3..671d5799b 100644 --- a/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs +++ b/source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs @@ -45,6 +45,12 @@ public static class GeneralSettings public static SerializableProperty TaskbarProgressSource { get; } = new SerializableProperty(GetKey(), Providers.Roaming, "") { AutoSave = true }; + /// + /// 出撃中にタスク バー インジケーターとして使用するプラグイン機能を識別する ID を取得します。 + /// + public static SerializableProperty TaskbarProgressSourceWhenSortie { get; } + = new SerializableProperty(GetKey(), Providers.Roaming, "") { AutoSave = true }; + private static string GetKey([CallerMemberName] string propertyName = "") { return nameof(GeneralSettings) + "." + propertyName; diff --git a/source/KanColleViewer.sln.DotSettings b/source/KanColleViewer.sln.DotSettings index 00cb01ac4..d02b631ae 100644 --- a/source/KanColleViewer.sln.DotSettings +++ b/source/KanColleViewer.sln.DotSettings @@ -82,6 +82,7 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb"><ExtraRule Prefix="_" Suffix="" Style="AaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy><Descriptor Staticness="Instance" AccessRightKinds="Protected" Description="Fileds (protected)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Private" Description="Event (private)"><ElementKinds><Kind Name="EVENT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> From 7ee720a069dc5b281614ece07b99694d28c105ca Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 03:46:54 +0900 Subject: [PATCH 50/67] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E5=91=A8=E3=82=8A?= =?UTF-8?q?=E3=81=AE=20XAML=20=E3=82=92=E6=95=B4=E7=90=86=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contents/Fleets/FleetsViewModel.cs | 2 +- .../Views/Contents/Fleets.xaml | 2 +- .../Views/Settings/Browser.xaml | 12 +- .../Views/Settings/Common.xaml | 13 +- .../Views/Settings/Network.xaml | 518 +++++++++--------- .../Views/Settings/Notification.xaml | 37 +- .../Views/Settings/Operation.xaml | 26 +- .../Views/Settings/Others.xaml | 24 +- .../Views/Settings/Plugins.xaml | 137 ++--- .../Settings/ProxyBootstrapperWindow.xaml | 3 +- .../Views/Settings/Window.xaml | 35 +- 11 files changed, 407 insertions(+), 402 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs index 7453696d1..ac6e24cb6 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs @@ -78,7 +78,7 @@ public FleetsViewModel() public void ShowFleetWindow() { var fleetwd = new FleetWindowViewModel(); - var message = new TransitionMessage(fleetwd, TransitionMode.Normal, "Show/FleetWindow"); + var message = new TransitionMessage(fleetwd, TransitionMode.Normal, "FleetWindow.Show"); this.Messenger.Raise(message); } diff --git a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml index f51d9c896..2c9900655 100644 --- a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml @@ -26,7 +26,7 @@ + MessageKey="FleetWindow.Show"> diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Browser.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Browser.xaml index e1c046b11..05a91127d 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Browser.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Browser.xaml @@ -6,7 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf" - xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls" + xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls" xmlns:metro2="http://schemes.grabacr.net/winfx/2015/personal/controls" xmlns:root="clr-namespace:Grabacr07.KanColleViewer" xmlns:views="clr-namespace:Grabacr07.KanColleViewer.Views" @@ -28,12 +28,11 @@ + Margin="43,-2,0,0" /> - + - + - + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml index 64cda59ac..4a79ae097 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml @@ -11,9 +11,18 @@ TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextStyleKey}"> + Value="0,0,0,8" /> - \ No newline at end of file + + + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Network.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Network.xaml index 7aaf7d068..a71b41f8c 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Network.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Network.xaml @@ -25,280 +25,292 @@ - - - - - + + - - - - - - - + + + - - - - - + + - - - + IsEnabled="{Binding ProxyType, Mode=TwoWay, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=SystemProxy}" + Margin="20,2,0,0"> + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Notification.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Notification.xaml index 5f2444356..af0223c78 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Notification.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Notification.xaml @@ -23,24 +23,20 @@ - + + IsChecked="{Binding Source={x:Static ms:KanColleSettings.NotifyBuildingCompleted}, Path=Value}" /> - + - + IsChecked="{Binding Source={x:Static ms:KanColleSettings.NotifyExpeditionReturned}, Path=Value}" /> + + IsChecked="{Binding Source={x:Static ms:KanColleSettings.NotifyRepairingCompleted}, Path=Value}" /> - + + IsChecked="{Binding Source={x:Static ms:KanColleSettings.NotifyFleetRejuvenated}, Path=Value}" /> - + + + + FontSize="10.5" /> + + + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml index d216ccb48..26ffe6b09 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml @@ -25,7 +25,8 @@ - + + @@ -51,17 +52,15 @@ + + IsChecked="{Binding Source={x:Static ms:KanColleSettings.CheckFlagshipIsNotRepairShip}, Path=Value}" /> - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> @@ -86,23 +85,20 @@ - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> + + IsChecked="{Binding Source={x:Static ms:KanColleSettings.AutoFleetSelectWhenShipsChanged}, Path=Value}" /> - + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Others.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Others.xaml index ec755ca90..2d9ac2b00 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Others.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Others.xaml @@ -33,7 +33,7 @@ + Margin="20,0,0,0"> @@ -82,8 +82,7 @@ - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> - - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> - + @@ -148,7 +145,7 @@ + Value="4,0" /> @@ -170,7 +167,6 @@ - + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml index 697f1f08a..e93019575 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml @@ -12,7 +12,7 @@ xmlns:vms="clr-namespace:Grabacr07.KanColleViewer.ViewModels.Settings" mc:Ignorable="d" d:DesignWidth="500" - d:DesignHeight="300" + d:DesignHeight="500" d:DataContext="{d:DesignInstance vms:SettingsViewModel}"> @@ -41,74 +41,74 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - - - - + + + + + - + + + Margin="0,-4"> @@ -133,5 +134,7 @@ + + diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/ProxyBootstrapperWindow.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/ProxyBootstrapperWindow.xaml index 9c15a1678..e0acfddd4 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/ProxyBootstrapperWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/ProxyBootstrapperWindow.xaml @@ -60,8 +60,7 @@ - + Margin="20,0,0,00"> - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> + + Margin="20,0,0,00"> - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> + - + + Style="{DynamicResource SettingsHeaderTextStyleKey}" /> + Margin="16,0,0,-2"> + - + - From 6c4358c0b42c807cff3ff4732c77eef6ebee4ac8 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 04:23:23 +0900 Subject: [PATCH 51/67] =?UTF-8?q?=E3=83=9E=E3=83=8D=E3=81=97=E3=81=A1?= =?UTF-8?q?=E3=82=83=E3=81=A0=E3=82=81=E3=81=A0=E3=82=88=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/Contents/Fleets/FleetsViewModel.cs | 2 +- source/Grabacr07.KanColleWrapper/Models/Fleet.cs | 11 +++++++++++ source/Grabacr07.KanColleWrapper/Organization.cs | 11 +++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs index ac6e24cb6..dc3ee04a0 100644 --- a/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs +++ b/source/Grabacr07.KanColleViewer/ViewModels/Contents/Fleets/FleetsViewModel.cs @@ -97,7 +97,7 @@ private void UpdateFleets() private FleetViewModel ToViewModel(Fleet fleet) { var vm = new FleetViewModel(fleet).AddTo(this.fleetListeners); - fleet.Subscribe(nameof(Fleet.Ships), () => { if (KanColleSettings.AutoFleetSelectWhenShipsChanged) this.SelectedFleet = vm; }, false).AddTo(this.fleetListeners); + fleet.Subscribe(nameof(Fleet.ShipsUpdated), () => { if (KanColleSettings.AutoFleetSelectWhenShipsChanged) this.SelectedFleet = vm; }, false).AddTo(this.fleetListeners); fleet.Subscribe(nameof(Fleet.IsInSortie), () => { if (KanColleSettings.AutoFleetSelectWhenSortie) this.SelectedFleet = vm; }, false).AddTo(this.fleetListeners); return vm; diff --git a/source/Grabacr07.KanColleWrapper/Models/Fleet.cs b/source/Grabacr07.KanColleWrapper/Models/Fleet.cs index 132076dbc..802659992 100644 --- a/source/Grabacr07.KanColleWrapper/Models/Fleet.cs +++ b/source/Grabacr07.KanColleWrapper/Models/Fleet.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Threading.Tasks; +using Grabacr07.KanColleWrapper.Annotations; using Grabacr07.KanColleWrapper.Models.Raw; namespace Grabacr07.KanColleWrapper.Models @@ -73,6 +75,10 @@ private set } } + [Dark("INotifyPropertyChanged が便利すぎる")] + [EditorBrowsable(EditorBrowsableState.Never)] + public object ShipsUpdated { get; set; } + #endregion #region IsInSortie 変更通知プロパティ @@ -221,6 +227,11 @@ private void UpdateShips(Ship[] ships) this.State.Update(); } + internal void RaiseShipsUpdated() + { + this.RaisePropertyChanged(nameof(this.ShipsUpdated)); + } + public override string ToString() { return $"ID = {this.Id}, Name = \"{this.Name}\", Ships = {this.Ships.Select(s => "\"" + s.Info.Name + "\"").ToString(",")}"; diff --git a/source/Grabacr07.KanColleWrapper/Organization.cs b/source/Grabacr07.KanColleWrapper/Organization.cs index 0d312bd9e..fd86646d5 100644 --- a/source/Grabacr07.KanColleWrapper/Organization.cs +++ b/source/Grabacr07.KanColleWrapper/Organization.cs @@ -232,7 +232,12 @@ internal void Update(kcsapi_deck[] source) internal void Update(kcsapi_deck source) { - this.Fleets[source.api_id]?.Update(source); + var fleet = this.Fleets[source.api_id]; + if (fleet != null) + { + fleet.Update(source); + fleet.RaiseShipsUpdated(); + } } @@ -243,6 +248,8 @@ private void Change(SvData data) try { var fleet = this.Fleets[int.Parse(data.Request["api_id"])]; + fleet.RaiseShipsUpdated(); + var index = int.Parse(data.Request["api_ship_idx"]); if (index == -1) { @@ -302,7 +309,7 @@ private void ExchangeSlot(SvData data) var fleet = this.Fleets.Values.FirstOrDefault(x => x.Ships.Any(y => y.Id == ship.Id)); if (fleet == null) return; - + fleet.State.Calculate(); } catch (Exception ex) From 17e8e1232bd403a8053c8a1f2038275c21619b3a Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 20:15:14 +0900 Subject: [PATCH 52/67] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=BE=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Controls/ZoomFactorSelector.xaml | 6 +++--- .../Views/Controls/ZoomFactorSelector.xaml.cs | 2 +- source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml index 0f3c4f46e..5fe240254 100644 --- a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml @@ -67,10 +67,10 @@ + BorderThickness="0.99"> - - + diff --git a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml.cs b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml.cs index f4e6fd7ec..54b604c03 100644 --- a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml.cs +++ b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml.cs @@ -51,7 +51,7 @@ public bool IsSelected public void Select() { - if (this.SelectAction != null) this.SelectAction(); + this.SelectAction?.Invoke(); } } diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml index 4a79ae097..f703fb778 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml @@ -20,7 +20,7 @@ TargetType="{x:Type Rectangle}" BasedOn="{StaticResource SeparatorRectangleStyleKey}"> + Value="0.99" /> From c5e5a04670f9f3759ba23b0211d78d30d32922a6 Mon Sep 17 00:00:00 2001 From: Grabacr07 Date: Sun, 7 Feb 2016 22:36:31 +0900 Subject: [PATCH 53/67] =?UTF-8?q?High-DPI=20=E8=A1=A8=E7=A4=BA=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Styles/Controls.ListView.xaml | 8 +- .../Themes/Generic.SlotItemIcon.xaml | 8 +- .../Themes/Generic.MetroComboBox.xaml | 6 +- .../Views/Catalogs/ShipCatalogWindow.xaml | 16 +- .../Views/Catalogs/SlotItemCatalogWindow.xaml | 6 +- .../Views/Contents/Expeditions.xaml | 19 +-- .../Views/Contents/Fleets.xaml | 156 +----------------- .../Views/Contents/Overview.xaml | 16 +- .../Views/Contents/Quests.xaml | 2 +- .../Views/Contents/Shipyard.xaml | 8 +- .../Views/Controls/ZoomFactorSelector.xaml | 4 +- .../Views/ExitDialog.xaml | 2 +- .../Views/FleetWindow.xaml | 6 +- .../Views/Information.xaml | 2 +- .../Views/KanColleWindowButtons.xaml | 2 +- .../Views/Settings/Common.xaml | 2 +- .../Views/Settings/Plugins.xaml | 4 +- .../Views/Settings/VersionInfo.xaml | 4 +- .../Views/Settings/Window.xaml | 6 +- .../Views/StartContent.xaml | 10 +- .../Models/ViewRange.cs | 6 +- source/MetroRadiance | 2 +- source/MetroTrilithon | 2 +- source/Plugins/Counter/CounterView.xaml | 2 +- 24 files changed, 71 insertions(+), 228 deletions(-) diff --git a/source/Grabacr07.KanColleViewer.Controls/Styles/Controls.ListView.xaml b/source/Grabacr07.KanColleViewer.Controls/Styles/Controls.ListView.xaml index 5a79ef698..ef2fc04e3 100644 --- a/source/Grabacr07.KanColleViewer.Controls/Styles/Controls.ListView.xaml +++ b/source/Grabacr07.KanColleViewer.Controls/Styles/Controls.ListView.xaml @@ -11,9 +11,9 @@ + Value="Recycling" /> + Value="Pixel" /> @@ -42,7 +42,7 @@ + Value="0,0,0,.99" /> @@ -69,7 +69,7 @@ + Value="0,0,.99,.99" /> @@ -468,7 +468,7 @@ - - diff --git a/source/Grabacr07.KanColleViewer/Themes/Generic.MetroComboBox.xaml b/source/Grabacr07.KanColleViewer/Themes/Generic.MetroComboBox.xaml index 081f23006..6ff168bb0 100644 --- a/source/Grabacr07.KanColleViewer/Themes/Generic.MetroComboBox.xaml +++ b/source/Grabacr07.KanColleViewer/Themes/Generic.MetroComboBox.xaml @@ -145,7 +145,7 @@ @@ -233,7 +233,7 @@ - - diff --git a/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml b/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml index eb8b13da9..9edc588fa 100644 --- a/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml @@ -107,7 +107,7 @@ Foreground="{DynamicResource ActiveForegroundBrushKey}" /> - @@ -229,7 +229,7 @@ - @@ -411,7 +411,7 @@ - - @@ -533,7 +533,7 @@ + Value="0,0,0,.99" /> - @@ -890,7 +890,7 @@ + Value="0,0,0,.99" /> + Value=".99" /> - - - @@ -159,4 +156,4 @@ - \ No newline at end of file + diff --git a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml index 2c9900655..b25291166 100644 --- a/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Contents/Fleets.xaml @@ -87,160 +87,6 @@ DataContext="{Binding SelectedFleet}" d:DataContext="{d:DesignData /SampleData/FleetViewModelSampleData.xaml}"> - - - - - - - - - - - - @@ -266,7 +266,7 @@ Value="8,2,16,0" /> - @@ -370,7 +370,7 @@ + BorderThickness=".99,.99,0,0"> diff --git a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml index 5fe240254..2b0f5ca37 100644 --- a/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Controls/ZoomFactorSelector.xaml @@ -67,10 +67,10 @@ + BorderThickness=".99"> - - diff --git a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml index 20dddf307..37419d64a 100644 --- a/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml +++ b/source/Grabacr07.KanColleViewer/Views/FleetWindow.xaml @@ -568,7 +568,7 @@ @@ -986,7 +986,7 @@ diff --git a/source/Grabacr07.KanColleViewer/Views/Information.xaml b/source/Grabacr07.KanColleViewer/Views/Information.xaml index 8493d509f..74f779944 100644 --- a/source/Grabacr07.KanColleViewer/Views/Information.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Information.xaml @@ -41,7 +41,7 @@ SelectedValue="{Binding SelectedItem}" /> diff --git a/source/Grabacr07.KanColleViewer/Views/KanColleWindowButtons.xaml b/source/Grabacr07.KanColleViewer/Views/KanColleWindowButtons.xaml index f37cdd77e..6a3939480 100644 --- a/source/Grabacr07.KanColleViewer/Views/KanColleWindowButtons.xaml +++ b/source/Grabacr07.KanColleViewer/Views/KanColleWindowButtons.xaml @@ -40,7 +40,7 @@ Style="{DynamicResource CircleButtonStyleKey}" Padding="6"> - diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml index f703fb778..b6c483eff 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Common.xaml @@ -20,7 +20,7 @@ TargetType="{x:Type Rectangle}" BasedOn="{StaticResource SeparatorRectangleStyleKey}"> + Value=".99" /> diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml index e93019575..d183600d8 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Plugins.xaml @@ -51,7 +51,7 @@ Margin="0,-4"> - @@ -124,7 +124,7 @@ Margin="0,-4"> - diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/VersionInfo.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/VersionInfo.xaml index 38310de1d..5c019f1ec 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/VersionInfo.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/VersionInfo.xaml @@ -55,7 +55,7 @@ Foreground="{DynamicResource ActiveForegroundBrushKey}" /> - @@ -101,7 +101,7 @@ - diff --git a/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml b/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml index 1e0f2cf99..0e1127cc3 100644 --- a/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml +++ b/source/Grabacr07.KanColleViewer/Views/Settings/Window.xaml @@ -94,7 +94,7 @@ + Value=".99" />