Index: Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -r49861b2d7698649a70eb22308a7858dd364109f1 -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 49861b2d7698649a70eb22308a7858dd364109f1) +++ Core/Gui/src/Core.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -28,6 +28,7 @@ using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Interop; +using System.Windows.Media; using Core.Common.Base.Data; using Core.Common.Controls.Views; using Core.Common.Util.Settings; @@ -289,7 +290,7 @@ applicationSelection = null; } - internal void AddStateButton(string text, string symbol, Func getRootData) + internal void AddStateButton(string text, string symbol, FontFamily fontFamily, Func getRootData) { var stateToggleButton = new ToggleButton { @@ -298,7 +299,8 @@ Content = new TextBlock { Style = (Style) FindResource("ButtonLargeIconStyle"), - Text = symbol + Text = symbol, + FontFamily = fontFamily } }; Index: Core/Gui/src/Core.Gui/GuiCore.cs =================================================================== diff -u -ra8f8849871d5cb8ecc684c6082caadc641d4d4e4 -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision a8f8849871d5cb8ecc684c6082caadc641d4d4e4) +++ Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -497,7 +497,7 @@ foreach (StateInfo stateInfo in GetStateInfos()) { - mainWindow.AddStateButton(stateInfo.Name, stateInfo.Symbol, stateInfo.GetRootData); + mainWindow.AddStateButton(stateInfo.Name, stateInfo.Symbol, stateInfo.FontFamily, stateInfo.GetRootData); } mainWindow.SubscribeToGui(); Index: Core/Gui/src/Core.Gui/Plugin/StateInfo.cs =================================================================== diff -u -r369400e3add949c344017f34f89620f095eac05a -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/src/Core.Gui/Plugin/StateInfo.cs (.../StateInfo.cs) (revision 369400e3add949c344017f34f89620f095eac05a) +++ Core/Gui/src/Core.Gui/Plugin/StateInfo.cs (.../StateInfo.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Windows.Media; using Core.Common.Base.Data; namespace Core.Gui.Plugin @@ -34,13 +35,26 @@ /// /// The name of the state. /// The symbol of the state. + /// The font family of the symbol. /// The method for obtaining the root data of the state. - /// Thrown when is null. - public StateInfo(string name, string symbol, Func getRootData) + /// Thrown when + /// or is null. + public StateInfo(string name, string symbol, FontFamily fontFamily, Func getRootData) { + if (fontFamily == null) + { + throw new ArgumentNullException(nameof(fontFamily)); + } + + if (getRootData == null) + { + throw new ArgumentNullException(nameof(getRootData)); + } + Name = name; Symbol = symbol; - GetRootData = getRootData ?? throw new ArgumentNullException(nameof(getRootData)); + FontFamily = fontFamily; + GetRootData = getRootData; } /// @@ -54,6 +68,11 @@ public string Symbol { get; } /// + /// Gets the font family of the symbol. + /// + public FontFamily FontFamily { get; } + + /// /// Gets the method for obtaining the root data of the state. Function arguments: /// /// The current to get the state data from. Index: Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs =================================================================== diff -u -re426893bd2c1d93c5d054e505957ab6d20f02b2f -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision e426893bd2c1d93c5d054e505957ab6d20f02b2f) +++ Core/Gui/test/Core.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -27,6 +27,7 @@ using System.Threading; using System.Windows; using System.Windows.Input; +using System.Windows.Media; using Core.Common.Base.Data; using Core.Common.Base.Storage; using Core.Common.Controls.TreeView; @@ -590,7 +591,7 @@ { gui.Plugins.Add(new TestPlugin(new[] { - new StateInfo("Name", "Symbol", p => p) + new StateInfo("Name", "Symbol", new FontFamily(), p => p) })); gui.Run(); @@ -627,8 +628,8 @@ { gui.Plugins.Add(new TestPlugin(new[] { - new StateInfo("Name", "Symbol", p => p), - new StateInfo("Name", "Symbol", p => new object()) + new StateInfo("Name", "Symbol", new FontFamily(), p => p), + new StateInfo("Name", "Symbol", new FontFamily(), p => new object()) })); gui.Run(); @@ -707,7 +708,7 @@ { gui.Plugins.Add(new TestPlugin(new[] { - new StateInfo("Name", "Symbol", p => p) + new StateInfo("Name", "Symbol", new FontFamily(), p => p) })); gui.Run(); @@ -752,8 +753,8 @@ { gui.Plugins.Add(new TestPlugin(new[] { - new StateInfo("Name", "Symbol", p => p), - new StateInfo("Name", "Symbol", p => new object()) + new StateInfo("Name", "Symbol", new FontFamily(), p => p), + new StateInfo("Name", "Symbol", new FontFamily(), p => new object()) })); gui.Run(); Index: Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs =================================================================== diff -u -r2bb78c041989c4970c56a3d74f0afa82083625ae -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 2bb78c041989c4970c56a3d74f0afa82083625ae) +++ Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -26,6 +26,7 @@ using System.Threading; using System.Windows.Forms; using System.Windows.Forms.Integration; +using System.Windows.Media; using Core.Common.Base.Data; using Core.Common.Base.Storage; using Core.Common.Controls.TreeView; @@ -630,7 +631,7 @@ { gui.Plugins.Add(new TestPlugin(new[] { - new StateInfo("Name", "Symbol", p => p) + new StateInfo("Name", "Symbol", new FontFamily(), p => p) })); // Call Index: Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs =================================================================== diff -u -r369400e3add949c344017f34f89620f095eac05a -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs (.../StateInfoTest.cs) (revision 369400e3add949c344017f34f89620f095eac05a) +++ Core/Gui/test/Core.Gui.Test/Plugin/StateInfoTest.cs (.../StateInfoTest.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Windows.Media; using Core.Common.Base.Data; using Core.Gui.Plugin; using NUnit.Framework; @@ -35,22 +36,35 @@ // Setup const string name = "Name"; const string symbol = "Symbol"; + var fontFamily = new FontFamily(); Func getRootData = o => new object(); // Call - var stateInfo = new StateInfo(name, symbol, getRootData); + var stateInfo = new StateInfo(name, symbol, fontFamily, getRootData); // Assert Assert.AreEqual(name, stateInfo.Name); Assert.AreEqual(symbol, stateInfo.Symbol); + Assert.AreSame(fontFamily, stateInfo.FontFamily); Assert.AreSame(getRootData, stateInfo.GetRootData); } [Test] + public void Constructor_FontFamilyNull_ThrowsArgumentNullException() + { + // Call + void Call() => new StateInfo(string.Empty, string.Empty, null, project => project); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("fontFamily", exception.ParamName); + } + + [Test] public void Constructor_GetRootDataNull_ThrowsArgumentNullException() { // Call - void Call() => new StateInfo(string.Empty, string.Empty, null); + void Call() => new StateInfo(string.Empty, string.Empty, new FontFamily(), null); // Assert var exception = Assert.Throws(Call); Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/Resources/Riskeer-Symbols.ttf =================================================================== diff -u Binary files differ Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/Riskeer.Integration.Plugin.csproj =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/Riskeer.Integration.Plugin.csproj (.../Riskeer.Integration.Plugin.csproj) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/Riskeer.Integration.Plugin.csproj (.../Riskeer.Integration.Plugin.csproj) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -87,6 +87,9 @@ all + + + Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -rf2663f49768e7339f499240ba081fcb52f6393e0 -r6c6e35803f103849428c1e9bea47c817fe55c496 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision f2663f49768e7339f499240ba081fcb52f6393e0) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 6c6e35803f103849428c1e9bea47c817fe55c496) @@ -114,6 +114,7 @@ using RiskeerCommonIOResources = Riskeer.Common.IO.Properties.Resources; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; using RiskeerCommonServiceResources = Riskeer.Common.Service.Properties.Resources; +using FontFamily = System.Windows.Media.FontFamily; namespace Riskeer.Integration.Plugin { @@ -273,7 +274,9 @@ public override IEnumerable GetStateInfos() { - yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_AssessmentSection, "\uE94E", project => + var fontFamily = new FontFamily(new Uri("pack://application:,,,/Riskeer.Integration.Plugin;component/Resources/"), "./#Deltares-Riskeer-Symbols"); + + yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_AssessmentSection, "\uE900", fontFamily, project => { if (project is RiskeerProject riskeerProject) { @@ -285,7 +288,7 @@ return null; }); - yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_Calculations, "\uE91D", project => + yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_Calculations, "\uE901", fontFamily, project => { if (project is RiskeerProject riskeerProject) { @@ -295,7 +298,7 @@ return null; }); - yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_FailurePaths, "\uE953", project => + yield return new StateInfo(Resources.RiskeerPlugin_GetStateInfos_FailurePaths, "\uE902", fontFamily, project => { if (project is RiskeerProject riskeerProject) {