From d74b9a6b7b78ad41fccb0c709b5a88f2dd520969 Mon Sep 17 00:00:00 2001 From: sidd Date: Fri, 13 Dec 2019 14:23:09 -0500 Subject: [PATCH 1/4] updated finsemble version --- AuthenticationExample/AuthenticationExample.csproj | 4 ++-- AuthenticationExample/packages.config | 2 +- WPFExample/WPFExample.csproj | 4 ++-- WPFExample/packages.config | 2 +- WindowlessExample/WindowlessExample.csproj | 4 ++-- WindowlessExample/packages.config | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj index be2e07d..0150452 100644 --- a/AuthenticationExample/AuthenticationExample.csproj +++ b/AuthenticationExample/AuthenticationExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.1\lib\net452\Finsemble.dll + + ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config index 3cf50dd..341487b 100644 --- a/AuthenticationExample/packages.config +++ b/AuthenticationExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WPFExample/WPFExample.csproj b/WPFExample/WPFExample.csproj index 9fa2c12..28197f1 100644 --- a/WPFExample/WPFExample.csproj +++ b/WPFExample/WPFExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.1\lib\net452\Finsemble.dll + + ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/WPFExample/packages.config b/WPFExample/packages.config index b8be4af..0cbb9f4 100644 --- a/WPFExample/packages.config +++ b/WPFExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WindowlessExample/WindowlessExample.csproj b/WindowlessExample/WindowlessExample.csproj index ba0fe75..a79e06d 100644 --- a/WindowlessExample/WindowlessExample.csproj +++ b/WindowlessExample/WindowlessExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.1\lib\net452\Finsemble.dll + + ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/WindowlessExample/packages.config b/WindowlessExample/packages.config index 3cf50dd..341487b 100644 --- a/WindowlessExample/packages.config +++ b/WindowlessExample/packages.config @@ -3,7 +3,7 @@ - + From cafc8f8e7c3f1518afd07a7201ab5ba6c0f8538d Mon Sep 17 00:00:00 2001 From: sidd Date: Thu, 23 Jan 2020 14:44:05 -0500 Subject: [PATCH 2/4] Finsemble 4.0.0 updates --- .../AuthenticationExample.csproj | 4 +- AuthenticationExample/packages.config | 2 +- WPFExample/MainWindow.xaml.cs | 42 ++++++------------- WPFExample/Properties/AssemblyInfo.cs | 4 +- WPFExample/WPFExample.csproj | 4 +- WPFExample/packages.config | 2 +- WindowlessExample/Properties/AssemblyInfo.cs | 4 +- WindowlessExample/WindowlessExample.csproj | 4 +- WindowlessExample/packages.config | 2 +- 9 files changed, 25 insertions(+), 43 deletions(-) diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj index 0150452..c699c7a 100644 --- a/AuthenticationExample/AuthenticationExample.csproj +++ b/AuthenticationExample/AuthenticationExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll + + ..\packages\Finsemble.4.0.0\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config index 341487b..ab5592a 100644 --- a/AuthenticationExample/packages.config +++ b/AuthenticationExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WPFExample/MainWindow.xaml.cs b/WPFExample/MainWindow.xaml.cs index b7a5b73..5fe4525 100644 --- a/WPFExample/MainWindow.xaml.cs +++ b/WPFExample/MainWindow.xaml.cs @@ -74,18 +74,18 @@ private void Finsemble_Connected(object sender, EventArgs e) FinsembleHeader.SetBridge(FSBL); // The Header Control needs a connected finsemble instance //Styling the Finsemble Header - FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3C4C58"))); - FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#303D47"))); - FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); - FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#004BA3"))); - FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); - FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); - FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); - FinsembleHeader.SetTitleForeground(new SolidColorBrush(Colors.White)); - FinsembleHeader.SetButtonForeground(new SolidColorBrush(Colors.White)); - - FinsembleHeader.SetButtonFont(null, 14, FontStyles.Normal, FontWeights.Normal); - FinsembleHeader.SetTitleFont(null, 14, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"))); + FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"))); + FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"))); + FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"))); + FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"))); + FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"))); + FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"))); + FinsembleHeader.SetTitleForeground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"))); + FinsembleHeader.SetButtonForeground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"))); + + FinsembleHeader.SetButtonFont(null, 8, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetTitleFont(null, 12, FontStyles.Normal, FontWeights.SemiBold); FSBL.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop. @@ -108,24 +108,6 @@ private void Finsemble_Connected(object sender, EventArgs e) }) }); - string fieldName = "finsemble.components." + FSBL.componentType; - FSBL.ConfigClient.GetValue(new JObject { ["field"] = fieldName }, (routerClient, response) => - { - if (response.error != null) - { - Logger.Error(response.error); - return; - } - - bool? alwaysOnTopIconConfigValue = (bool?)response.response?["data"]?["foreign"]?["components"]?["Window Manager"]?["alwaysOnTopIcon"]; - bool showAlwaysOnTopButton = false; - if (alwaysOnTopIconConfigValue != null) - { - showAlwaysOnTopButton = (bool) alwaysOnTopIconConfigValue; - } - FinsembleHeader.setAlwaysOnTopButton(showAlwaysOnTopButton); - }); - // Emitters for data that can be dragged using the drag icon. FSBL.DragAndDropClient.SetEmitters(new List>() { diff --git a/WPFExample/Properties/AssemblyInfo.cs b/WPFExample/Properties/AssemblyInfo.cs index e6b7c66..748497c 100644 --- a/WPFExample/Properties/AssemblyInfo.cs +++ b/WPFExample/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // 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.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] diff --git a/WPFExample/WPFExample.csproj b/WPFExample/WPFExample.csproj index 28197f1..306f5a8 100644 --- a/WPFExample/WPFExample.csproj +++ b/WPFExample/WPFExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll + + ..\packages\Finsemble.4.0.0\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/WPFExample/packages.config b/WPFExample/packages.config index 0cbb9f4..cf03cf9 100644 --- a/WPFExample/packages.config +++ b/WPFExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WindowlessExample/Properties/AssemblyInfo.cs b/WindowlessExample/Properties/AssemblyInfo.cs index bf9353a..4c01879 100644 --- a/WindowlessExample/Properties/AssemblyInfo.cs +++ b/WindowlessExample/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // 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.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] diff --git a/WindowlessExample/WindowlessExample.csproj b/WindowlessExample/WindowlessExample.csproj index a79e06d..ab1c9a6 100644 --- a/WindowlessExample/WindowlessExample.csproj +++ b/WindowlessExample/WindowlessExample.csproj @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.3.13.2\lib\net452\Finsemble.dll + + ..\packages\Finsemble.4.0.0\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll diff --git a/WindowlessExample/packages.config b/WindowlessExample/packages.config index 341487b..ab5592a 100644 --- a/WindowlessExample/packages.config +++ b/WindowlessExample/packages.config @@ -3,7 +3,7 @@ - + From a3fd08e2411e852997fa3f3c97133cbe3be26586 Mon Sep 17 00:00:00 2001 From: jclaus Date: Thu, 20 Feb 2020 15:45:59 -0500 Subject: [PATCH 3/4] Update dependencies --- AuthenticationExample/App.config | 4 +-- .../AuthenticationExample.csproj | 28 +++++++---------- AuthenticationExample/packages.config | 18 +++++------ WPFExample/App.config | 4 +-- WPFExample/WPFExample.csproj | 21 +++++++------ WPFExample/packages.config | 14 ++++----- WindowlessExample/App.config | 4 +-- WindowlessExample/WindowlessExample.csproj | 31 +++++++------------ WindowlessExample/packages.config | 19 +++++------- 9 files changed, 63 insertions(+), 80 deletions(-) diff --git a/AuthenticationExample/App.config b/AuthenticationExample/App.config index 70c116e..0fda0b4 100644 --- a/AuthenticationExample/App.config +++ b/AuthenticationExample/App.config @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj index c699c7a..7bc5382 100644 --- a/AuthenticationExample/AuthenticationExample.csproj +++ b/AuthenticationExample/AuthenticationExample.csproj @@ -80,8 +80,8 @@ true - - ..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll + + ..\packages\DotNetZip.1.13.5\lib\net40\DotNetZip.dll ..\packages\EngineIoClientDotNet.1.0.7\lib\net45\EngineIoClientDotNet.dll @@ -105,7 +105,7 @@ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.dll @@ -116,14 +116,14 @@ ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll - - ..\packages\Openfin.WinForm.8.1.3\lib\net40\Openfin.WinForm.dll + + ..\packages\Openfin.WinForm.14.1.1\lib\net452\Openfin.WinForm.dll - - ..\packages\OpenFin.WPF.8.1.3\lib\net40\OpenFin.WPF.dll + + ..\packages\OpenFin.WPF.14.1.1\lib\net452\OpenFin.WPF.dll - - ..\packages\OpenfinDesktop.14.0.0\lib\net452\OpenfinDesktop.dll + + ..\packages\OpenfinDesktop.14.1.1\lib\net452\OpenfinDesktop.dll ..\packages\SuperSocket.ClientEngine.0.10.0\lib\net45\SuperSocket.ClientEngine.dll @@ -132,8 +132,8 @@ ..\packages\SuperSocket.ProtoBase.1.7.0.17\lib\net45\SuperSocket.ProtoBase.dll - - ..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll + + ..\packages\System.Collections.Immutable.1.7.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll @@ -151,18 +151,12 @@ ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll - - ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config index ab5592a..5fbc857 100644 --- a/AuthenticationExample/packages.config +++ b/AuthenticationExample/packages.config @@ -1,6 +1,6 @@  - + @@ -8,15 +8,15 @@ - + - - - + + + - + @@ -24,14 +24,12 @@ - + - - - + diff --git a/WPFExample/App.config b/WPFExample/App.config index 70c116e..0fda0b4 100644 --- a/WPFExample/App.config +++ b/WPFExample/App.config @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/WPFExample/WPFExample.csproj b/WPFExample/WPFExample.csproj index 306f5a8..6dcd35c 100644 --- a/WPFExample/WPFExample.csproj +++ b/WPFExample/WPFExample.csproj @@ -80,8 +80,8 @@ true - - ..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll + + ..\packages\DotNetZip.1.13.5\lib\net40\DotNetZip.dll ..\packages\EngineIoClientDotNet.1.0.7\lib\net45\EngineIoClientDotNet.dll @@ -96,16 +96,16 @@ ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\Openfin.WinForm.8.1.3\lib\net40\Openfin.WinForm.dll + + ..\packages\Openfin.WinForm.14.1.1\lib\net452\Openfin.WinForm.dll - - ..\packages\OpenFin.WPF.8.1.3\lib\net40\OpenFin.WPF.dll + + ..\packages\OpenFin.WPF.14.1.1\lib\net452\OpenFin.WPF.dll - - ..\packages\OpenfinDesktop.14.0.0\lib\net452\OpenfinDesktop.dll + + ..\packages\OpenfinDesktop.14.1.1\lib\net452\OpenfinDesktop.dll ..\packages\SuperSocket.ClientEngine.0.10.0\lib\net45\SuperSocket.ClientEngine.dll @@ -114,6 +114,9 @@ ..\packages\SuperSocket.ProtoBase.1.7.0.17\lib\net45\SuperSocket.ProtoBase.dll + + ..\packages\System.Collections.Immutable.1.7.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + diff --git a/WPFExample/packages.config b/WPFExample/packages.config index cf03cf9..fd52573 100644 --- a/WPFExample/packages.config +++ b/WPFExample/packages.config @@ -1,6 +1,6 @@  - + @@ -8,19 +8,19 @@ - + - - - + + + - + - + diff --git a/WindowlessExample/App.config b/WindowlessExample/App.config index a75f1ee..2c1e078 100644 --- a/WindowlessExample/App.config +++ b/WindowlessExample/App.config @@ -11,7 +11,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/WindowlessExample/WindowlessExample.csproj b/WindowlessExample/WindowlessExample.csproj index ab1c9a6..03ff68f 100644 --- a/WindowlessExample/WindowlessExample.csproj +++ b/WindowlessExample/WindowlessExample.csproj @@ -80,8 +80,8 @@ - - ..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll + + ..\packages\DotNetZip.1.13.5\lib\net40\DotNetZip.dll ..\packages\EngineIoClientDotNet.1.0.7\lib\net45\EngineIoClientDotNet.dll @@ -105,7 +105,7 @@ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.dll @@ -116,14 +116,14 @@ ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll - - ..\packages\Openfin.WinForm.8.1.3\lib\net40\Openfin.WinForm.dll + + ..\packages\Openfin.WinForm.14.1.1\lib\net452\Openfin.WinForm.dll - - ..\packages\OpenFin.WPF.8.1.3\lib\net40\OpenFin.WPF.dll + + ..\packages\OpenFin.WPF.14.1.1\lib\net452\OpenFin.WPF.dll - - ..\packages\OpenfinDesktop.14.0.0\lib\net452\OpenfinDesktop.dll + + ..\packages\OpenfinDesktop.14.1.1\lib\net452\OpenfinDesktop.dll ..\packages\SuperSocket.ClientEngine.0.10.0\lib\net45\SuperSocket.ClientEngine.dll @@ -132,8 +132,8 @@ ..\packages\SuperSocket.ProtoBase.1.7.0.17\lib\net45\SuperSocket.ProtoBase.dll - - ..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll + + ..\packages\System.Collections.Immutable.1.7.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll @@ -145,24 +145,15 @@ ..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll - - ..\packages\System.Net.Security.4.3.0\lib\net46\System.Net.Security.dll - ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll - - ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - diff --git a/WindowlessExample/packages.config b/WindowlessExample/packages.config index ab5592a..b420d97 100644 --- a/WindowlessExample/packages.config +++ b/WindowlessExample/packages.config @@ -1,6 +1,6 @@  - + @@ -8,30 +8,27 @@ - + - - - + + + - + - - + - - - + From 7505c4ab41a7f762d97b6895b114d1a2ea2b0c0e Mon Sep 17 00:00:00 2001 From: Sidd Date: Thu, 7 May 2020 10:24:34 -0400 Subject: [PATCH 4/4] 4.2.0 Changes --- .gitignore | 3 +- AuthenticationExample/App.config | 8 - .../AuthenticationExample.csproj | 32 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/Settings.Designer.cs | 2 +- AuthenticationExample/packages.config | 32 +- FinsembleDemo.sln | 32 +- MultiWindowExample/App.config | 34 ++ MultiWindowExample/App.xaml | 10 + MultiWindowExample/App.xaml.cs | 277 ++++++++++ MultiWindowExample/IIntegrateable.cs | 17 + MultiWindowExample/MainWindow.xaml | 12 + MultiWindowExample/MainWindow.xaml.cs | 28 + MultiWindowExample/MultiWindowExample.csproj | 196 +++++++ MultiWindowExample/Properties/AssemblyInfo.cs | 55 ++ .../Properties/Resources.Designer.cs | 63 +++ MultiWindowExample/Properties/Resources.resx | 117 +++++ .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + MultiWindowExample/README.md | 11 + MultiWindowExample/SingleInstance.cs | 485 ++++++++++++++++++ MultiWindowExample/Window1.xaml | 28 + MultiWindowExample/Window1.xaml.cs | 54 ++ MultiWindowExample/Window2.xaml | 28 + MultiWindowExample/Window2.xaml.cs | 47 ++ MultiWindowExample/Window3.xaml | 28 + MultiWindowExample/Window3.xaml.cs | 47 ++ MultiWindowExample/Window4.xaml | 28 + MultiWindowExample/Window4.xaml.cs | 47 ++ MultiWindowExample/log4net.config | 23 + MultiWindowExample/packages.config | 20 + WPFExample/App.config | 14 +- WPFExample/MainWindow.xaml | 10 +- WPFExample/MainWindow.xaml.cs | 281 +++++----- WPFExample/Properties/AssemblyInfo.cs | 6 +- WPFExample/Properties/Settings.Designer.cs | 2 +- WPFExample/WPFExample.csproj | 37 +- WPFExample/packages.config | 11 +- WindowlessExample/App.config | 9 +- WindowlessExample/Program.cs | 108 ++-- WindowlessExample/Properties/AssemblyInfo.cs | 6 +- .../Properties/Settings.Designer.cs | 2 +- WindowlessExample/WindowlessExample.csproj | 43 +- WindowlessExample/packages.config | 31 +- WinformExample/App.config | 26 + WinformExample/FormExample.Designer.cs | 102 ++++ WinformExample/FormExample.cs | 68 +++ WinformExample/FormExample.resx | 120 +++++ WinformExample/Program.cs | 31 ++ WinformExample/Properties/AssemblyInfo.cs | 36 ++ .../Properties/Resources.Designer.cs | 63 +++ WinformExample/Properties/Resources.resx | 117 +++++ .../Properties/Settings.Designer.cs | 26 + WinformExample/Properties/Settings.settings | 7 + WinformExample/Settings.cs | 28 + WinformExample/WinformExample.csproj | 159 ++++++ WinformExample/app.manifest | 76 +++ WinformExample/packages.config | 20 + multiWindowComponents.json | 149 ++++++ windowlessComponent.json | 25 + winformExample.json | 45 ++ wpfExample.json | 45 ++ 62 files changed, 3149 insertions(+), 355 deletions(-) create mode 100644 MultiWindowExample/App.config create mode 100644 MultiWindowExample/App.xaml create mode 100644 MultiWindowExample/App.xaml.cs create mode 100644 MultiWindowExample/IIntegrateable.cs create mode 100644 MultiWindowExample/MainWindow.xaml create mode 100644 MultiWindowExample/MainWindow.xaml.cs create mode 100644 MultiWindowExample/MultiWindowExample.csproj create mode 100644 MultiWindowExample/Properties/AssemblyInfo.cs create mode 100644 MultiWindowExample/Properties/Resources.Designer.cs create mode 100644 MultiWindowExample/Properties/Resources.resx create mode 100644 MultiWindowExample/Properties/Settings.Designer.cs create mode 100644 MultiWindowExample/Properties/Settings.settings create mode 100644 MultiWindowExample/README.md create mode 100644 MultiWindowExample/SingleInstance.cs create mode 100644 MultiWindowExample/Window1.xaml create mode 100644 MultiWindowExample/Window1.xaml.cs create mode 100644 MultiWindowExample/Window2.xaml create mode 100644 MultiWindowExample/Window2.xaml.cs create mode 100644 MultiWindowExample/Window3.xaml create mode 100644 MultiWindowExample/Window3.xaml.cs create mode 100644 MultiWindowExample/Window4.xaml create mode 100644 MultiWindowExample/Window4.xaml.cs create mode 100644 MultiWindowExample/log4net.config create mode 100644 MultiWindowExample/packages.config create mode 100644 WinformExample/App.config create mode 100644 WinformExample/FormExample.Designer.cs create mode 100644 WinformExample/FormExample.cs create mode 100644 WinformExample/FormExample.resx create mode 100644 WinformExample/Program.cs create mode 100644 WinformExample/Properties/AssemblyInfo.cs create mode 100644 WinformExample/Properties/Resources.Designer.cs create mode 100644 WinformExample/Properties/Resources.resx create mode 100644 WinformExample/Properties/Settings.Designer.cs create mode 100644 WinformExample/Properties/Settings.settings create mode 100644 WinformExample/Settings.cs create mode 100644 WinformExample/WinformExample.csproj create mode 100644 WinformExample/app.manifest create mode 100644 WinformExample/packages.config create mode 100644 multiWindowComponents.json create mode 100644 windowlessComponent.json create mode 100644 winformExample.json create mode 100644 wpfExample.json diff --git a/.gitignore b/.gitignore index f1fe5c4..48a07ae 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ artifacts/ *.meta *.obj *.pch +*.pdb *.pgc *.pgd *.rsp @@ -257,4 +258,4 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc diff --git a/AuthenticationExample/App.config b/AuthenticationExample/App.config index 0fda0b4..a032c57 100644 --- a/AuthenticationExample/App.config +++ b/AuthenticationExample/App.config @@ -21,14 +21,6 @@ - - - - - - - - diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj index 7bc5382..438bcf1 100644 --- a/AuthenticationExample/AuthenticationExample.csproj +++ b/AuthenticationExample/AuthenticationExample.csproj @@ -80,8 +80,8 @@ true - - ..\packages\DotNetZip.1.13.5\lib\net40\DotNetZip.dll + + ..\packages\DotNetZip.1.13.7\lib\net40\DotNetZip.dll ..\packages\EngineIoClientDotNet.1.0.7\lib\net45\EngineIoClientDotNet.dll @@ -89,8 +89,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.4.0.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.4.2.0\lib\net452\Finsemble.dll ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll @@ -126,37 +126,15 @@ ..\packages\OpenfinDesktop.14.1.1\lib\net452\OpenfinDesktop.dll - ..\packages\SuperSocket.ClientEngine.0.10.0\lib\net45\SuperSocket.ClientEngine.dll - - - ..\packages\SuperSocket.ProtoBase.1.7.0.17\lib\net45\SuperSocket.ProtoBase.dll + ..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll ..\packages\System.Collections.Immutable.1.7.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll - - - - ..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll - - - ..\packages\System.Net.Security.4.3.0\lib\net46\System.Net.Security.dll - - - ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll - - - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - - - ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - diff --git a/AuthenticationExample/Properties/AssemblyInfo.cs b/AuthenticationExample/Properties/AssemblyInfo.cs index 70b05fb..e75e4d1 100644 --- a/AuthenticationExample/Properties/AssemblyInfo.cs +++ b/AuthenticationExample/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Authentication")] -[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyCopyright("Copyright © 2017 - 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +51,5 @@ // 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.*")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("4.2.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AuthenticationExample/Properties/Settings.Designer.cs b/AuthenticationExample/Properties/Settings.Designer.cs index ac9572d..019fc71 100644 --- a/AuthenticationExample/Properties/Settings.Designer.cs +++ b/AuthenticationExample/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace AuthenticationExample.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config index 5fbc857..8858c6d 100644 --- a/AuthenticationExample/packages.config +++ b/AuthenticationExample/packages.config @@ -1,36 +1,20 @@  - - - - + + + + - - - + + + - + - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FinsembleDemo.sln b/FinsembleDemo.sln index 6712afe..b868aa7 100644 --- a/FinsembleDemo.sln +++ b/FinsembleDemo.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFExample", "WPFExample\WPFExample.csproj", "{B6FB5104-A0EA-479A-8BFC-4DFE207CEB24}" EndProject @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationExample", "Au EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowlessExample", "WindowlessExample\WindowlessExample.csproj", "{E65C4A9D-90CD-42E2-B426-724F290043ED}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinformExample", "WinformExample\WinformExample.csproj", "{30963A3F-17AD-4685-A8DF-B945012E02F4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiWindowExample", "MultiWindowExample\MultiWindowExample.csproj", "{E068C337-DF06-4A33-B227-A97B9649E88F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -55,6 +59,30 @@ Global {E65C4A9D-90CD-42E2-B426-724F290043ED}.Release|x64.Build.0 = Release|Any CPU {E65C4A9D-90CD-42E2-B426-724F290043ED}.Release|x86.ActiveCfg = Release|Any CPU {E65C4A9D-90CD-42E2-B426-724F290043ED}.Release|x86.Build.0 = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|x64.ActiveCfg = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|x64.Build.0 = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|x86.ActiveCfg = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Debug|x86.Build.0 = Debug|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|Any CPU.Build.0 = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|x64.ActiveCfg = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|x64.Build.0 = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|x86.ActiveCfg = Release|Any CPU + {30963A3F-17AD-4685-A8DF-B945012E02F4}.Release|x86.Build.0 = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|x64.ActiveCfg = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|x64.Build.0 = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|x86.ActiveCfg = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Debug|x86.Build.0 = Debug|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|Any CPU.Build.0 = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|x64.ActiveCfg = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|x64.Build.0 = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|x86.ActiveCfg = Release|Any CPU + {E068C337-DF06-4A33-B227-A97B9649E88F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MultiWindowExample/App.config b/MultiWindowExample/App.config new file mode 100644 index 0000000..c97a35c --- /dev/null +++ b/MultiWindowExample/App.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MultiWindowExample/App.xaml b/MultiWindowExample/App.xaml new file mode 100644 index 0000000..7bc1406 --- /dev/null +++ b/MultiWindowExample/App.xaml @@ -0,0 +1,10 @@ + + + + + diff --git a/MultiWindowExample/App.xaml.cs b/MultiWindowExample/App.xaml.cs new file mode 100644 index 0000000..eb58b71 --- /dev/null +++ b/MultiWindowExample/App.xaml.cs @@ -0,0 +1,277 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Windows; +using System.Windows.Threading; +using ChartIQ.Finsemble; +using log4net; +using Microsoft.Shell; + +namespace MultiWindowExample +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application, ISingleInstanceApp + { + /// + /// The logger + /// + private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private static readonly object lockObj = new object(); + + private const string Unique = "6bea6fc4-5d9c-4961-b39d-89addcd65a73"; + + private static App application = null; + + private static Finsemble FSBL = null; + + /// + /// + /// + [STAThread] + public static void Main(string[] args) + { +#if DEBUG + Debugger.Launch(); +#endif + // create a global mutex + using (var mutex = new Mutex(false, "Finsemble")) + { + var mutexAcquired = false; + try + { + // acquire the mutex (or timeout after 60 seconds) + // will return false if it timed out + mutexAcquired = mutex.WaitOne(60000); + } + catch (AbandonedMutexException) + { + // abandoned mutexes are still acquired, we just need + // to handle the exception and treat it as acquisition + mutexAcquired = true; + } + + // if it wasn't acquired, it timed out, so can handle that how ever we want + if (!mutexAcquired) + { + Console.WriteLine("I have timed out acquiring the mutex and can handle that somehow"); + return; + } + + // otherwise, we've acquired the mutex and should do what we need to do, + // then ensure that we always release the mutex + if (SingleInstance.InitializeAsFirstInstance(Unique)) + { + + application = new App(); + + // If window type passed for initial launch, add listener to launch window when connected. + var argsList = args.ToList(); + IEnumerable nonFSBLArgs = GetNonFinsembleArgs(argsList); + if ((nonFSBLArgs != null) && nonFSBLArgs.Any()) + { + // Non-finsemble arguments passed, launch window + LaunchWindow(args.ToList()); + } + + application.InitializeComponent(); + mutex.ReleaseMutex(); + application.Run(); + + // Allow single instance code to perform cleanup operations + SingleInstance.Cleanup(); + } + + } + + } + + /// + /// Giving a list of arguments, returns an enumerable of non-Finsemble arguments (no =) + /// + /// List of arguments + /// Enumerable of non-Finsemble arguments + private static IEnumerable GetNonFinsembleArgs(IList args) + { + var nonFSBLArgs = args.Where(str => !str.Contains("=") && !str.Contains(".exe")); + + return nonFSBLArgs; + } + + /// + /// Launches a Finsemble aware window with the passed arguments. + /// + /// The arguments passed to the process. + /// Always true? + private static bool LaunchWindow(IList args) + { +#if DEBUG + Debugger.Launch(); +#endif + + if (args.Count < 2) + { + // Invalid number of arguments + return true; + } + + var nonFSBLArgs = GetNonFinsembleArgs(args); + if ((nonFSBLArgs == null) || !nonFSBLArgs.Any()) + { + // no non-finsemble arguments. Cannot launch window. + return true; + } + + string name = nonFSBLArgs.First(); + + // handle command line arguments of second instance + Window window = null; + Current.Dispatcher.Invoke(() => + { + window = CreateWindow(name); + }); + + if (window == null) + { + Logger.Error($"Could not create window: {name}"); + } + else + { + // Register with Finsemble + var fsbl = new Finsemble(args.ToArray(), window); + fsbl.Connected += (s, e) => + { + IIntegratable fsblWin = window as IIntegratable; + if (fsblWin == null) + { + Logger.Warn($"The window \"{name}\" is not a window that can be integrated into Finsemble."); + } + else + { + fsblWin.SetFinsemble(fsbl); + } + + Current.Dispatcher.Invoke(window.Show); + }; + + // Dispose of Finsemble object when window is closed. + window.Closed += (s, e) => + { + Debug.WriteLine("disposing window from app.xaml"); + fsbl.Dispose(); + Debug.WriteLine("dispose completed"); + }; + + fsbl.Connect(); + } + + return true; + } + + private static void OnShutdown(object sender, EventArgs e) + { + if (FSBL != null) + { + lock (lockObj) + { + if (FSBL != null) + { + try + { + // Dispose of Finsemble. + FSBL.Dispose(); + } + catch { } + finally + { + FSBL = null; + } + } + + } + } + + try + { + // Release main thread so application can exit. + Current.Dispatcher.Invoke(application.Shutdown); + } + catch + { + // An error occurred, but I don't care as long as it exits. + ; + } + } + + /// + /// Create a window based on the name passed. + /// + /// The name passed in + /// The window created. + private static Window CreateWindow(string name) + { + Window window = null; + switch (name) + { + case "Window1": + { + window = new Window1(); + break; + } + case "Window2": + { + window = new Window2(); + break; + } + case "Window3": + { + window = new Window3(); + break; + } + case "Window4": + { + window = new Window4(); + break; + } + default: + { + // Unknown window, ignore + break; + } + } + + return window; + } + + #region ISingleInstanceApp Members + /// + /// + /// + /// + /// + public bool SignalExternalCommandLineArgs(IList args) + { + return LaunchWindow(args); + } + #endregion + + /// + /// + /// + /// + /// + private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) + { +#if DEBUG + Debugger.Launch(); +#endif + + MessageBox.Show("An Unhandled Exception has occurred. Please Check your event Logs."); + } + } +} \ No newline at end of file diff --git a/MultiWindowExample/IIntegrateable.cs b/MultiWindowExample/IIntegrateable.cs new file mode 100644 index 0000000..fbe2602 --- /dev/null +++ b/MultiWindowExample/IIntegrateable.cs @@ -0,0 +1,17 @@ +using System.Windows; +using ChartIQ.Finsemble; + +namespace MultiWindowExample +{ + /// + /// + /// + interface IIntegratable + { + /// + /// + /// + /// + void SetFinsemble(Finsemble fsbl); + } +} diff --git a/MultiWindowExample/MainWindow.xaml b/MultiWindowExample/MainWindow.xaml new file mode 100644 index 0000000..85483ba --- /dev/null +++ b/MultiWindowExample/MainWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/MultiWindowExample/MainWindow.xaml.cs b/MultiWindowExample/MainWindow.xaml.cs new file mode 100644 index 0000000..e990011 --- /dev/null +++ b/MultiWindowExample/MainWindow.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 MultiWindowExample +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/MultiWindowExample/MultiWindowExample.csproj b/MultiWindowExample/MultiWindowExample.csproj new file mode 100644 index 0000000..cb401a5 --- /dev/null +++ b/MultiWindowExample/MultiWindowExample.csproj @@ -0,0 +1,196 @@ + + + + + Debug + AnyCPU + {E068C337-DF06-4A33-B227-A97B9649E88F} + WinExe + MultiWindowExample + MultiWindowExample + v4.5.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + MultiWindowExample.App + + + + ..\packages\DotNetZip.1.13.7\lib\net40\DotNetZip.dll + + + ..\packages\EngineIoClientDotNet.1.0.7\lib\net45\EngineIoClientDotNet.dll + + + ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll + + + ..\packages\Finsemble.4.2.0\lib\net452\Finsemble.dll + + + ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.dll + + + ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Concurrent.dll + + + ..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll + + + ..\packages\Openfin.WinForm.14.1.1\lib\net452\Openfin.WinForm.dll + + + ..\packages\OpenFin.WPF.14.1.1\lib\net452\OpenFin.WPF.dll + + + ..\packages\OpenfinDesktop.14.1.1\lib\net452\OpenfinDesktop.dll + + + ..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll + + + + ..\packages\System.Collections.Immutable.1.7.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + + + + + + + + + + + + + 4.0 + + + + + ..\packages\WebSocket4Net.0.15.2\lib\net45\WebSocket4Net.dll + + + + + + + + + + Window1.xaml + + + Window2.xaml + + + Window3.xaml + + + Window4.xaml + + + MSBuild:Compile + Designer + + + + App.xaml + Code + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + Always + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/MultiWindowExample/Properties/AssemblyInfo.cs b/MultiWindowExample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..75c0168 --- /dev/null +++ b/MultiWindowExample/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MultiWindowExample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MultiWindowExample")] +[assembly: AssemblyCopyright("Copyright © 2018 - 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.*")] +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] diff --git a/MultiWindowExample/Properties/Resources.Designer.cs b/MultiWindowExample/Properties/Resources.Designer.cs new file mode 100644 index 0000000..cec14e4 --- /dev/null +++ b/MultiWindowExample/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MultiWindowExample.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MultiWindowExample.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/MultiWindowExample/Properties/Resources.resx b/MultiWindowExample/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/MultiWindowExample/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MultiWindowExample/Properties/Settings.Designer.cs b/MultiWindowExample/Properties/Settings.Designer.cs new file mode 100644 index 0000000..fd8908d --- /dev/null +++ b/MultiWindowExample/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MultiWindowExample.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/MultiWindowExample/Properties/Settings.settings b/MultiWindowExample/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/MultiWindowExample/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/MultiWindowExample/README.md b/MultiWindowExample/README.md new file mode 100644 index 0000000..670ff83 --- /dev/null +++ b/MultiWindowExample/README.md @@ -0,0 +1,11 @@ +# Multi-Window Example + +Set a `multiWindowRoot` variable in the manifest that points to folder where _MultiWindowExample.exe_ is built (e.g. _C:/Users/andy/Documents/SourceCode/finsemble-dll/MultiWindowExample/bin/Debug_). Copy _multiWindowComponents.json_ to _configs/applications_ in the seed project, and add the following to the `importConfig` array: `"$applicationRoot/configs/application/multiWindowComponents.json"`. + +```JSON + "multiWindowRoot": "C:/Users/andy/Documents/SourceCode/finsemble-dll/MultiWindowExample/bin/Debug", + "importConfig": [ + "$applicationRoot/configs/application/config.json", + "$applicationRoot/configs/application/multiWindowComponents.json" + ], +``` \ No newline at end of file diff --git a/MultiWindowExample/SingleInstance.cs b/MultiWindowExample/SingleInstance.cs new file mode 100644 index 0000000..62a207c --- /dev/null +++ b/MultiWindowExample/SingleInstance.cs @@ -0,0 +1,485 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// +// This class checks to make sure that only one instance of +// this application is running at a time. +// +//----------------------------------------------------------------------- + +namespace Microsoft.Shell +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Runtime.InteropServices; + using System.Runtime.Remoting; + using System.Runtime.Remoting.Channels; + using System.Runtime.Remoting.Channels.Ipc; + using System.Runtime.Serialization.Formatters; + using System.Security; + using System.Threading; + using System.Windows; + using System.Windows.Threading; + + internal enum WM + { + NULL = 0x0000, + CREATE = 0x0001, + DESTROY = 0x0002, + MOVE = 0x0003, + SIZE = 0x0005, + ACTIVATE = 0x0006, + SETFOCUS = 0x0007, + KILLFOCUS = 0x0008, + ENABLE = 0x000A, + SETREDRAW = 0x000B, + SETTEXT = 0x000C, + GETTEXT = 0x000D, + GETTEXTLENGTH = 0x000E, + PAINT = 0x000F, + CLOSE = 0x0010, + QUERYENDSESSION = 0x0011, + QUIT = 0x0012, + QUERYOPEN = 0x0013, + ERASEBKGND = 0x0014, + SYSCOLORCHANGE = 0x0015, + SHOWWINDOW = 0x0018, + ACTIVATEAPP = 0x001C, + SETCURSOR = 0x0020, + MOUSEACTIVATE = 0x0021, + CHILDACTIVATE = 0x0022, + QUEUESYNC = 0x0023, + GETMINMAXINFO = 0x0024, + + WINDOWPOSCHANGING = 0x0046, + WINDOWPOSCHANGED = 0x0047, + + CONTEXTMENU = 0x007B, + STYLECHANGING = 0x007C, + STYLECHANGED = 0x007D, + DISPLAYCHANGE = 0x007E, + GETICON = 0x007F, + SETICON = 0x0080, + NCCREATE = 0x0081, + NCDESTROY = 0x0082, + NCCALCSIZE = 0x0083, + NCHITTEST = 0x0084, + NCPAINT = 0x0085, + NCACTIVATE = 0x0086, + GETDLGCODE = 0x0087, + SYNCPAINT = 0x0088, + NCMOUSEMOVE = 0x00A0, + NCLBUTTONDOWN = 0x00A1, + NCLBUTTONUP = 0x00A2, + NCLBUTTONDBLCLK = 0x00A3, + NCRBUTTONDOWN = 0x00A4, + NCRBUTTONUP = 0x00A5, + NCRBUTTONDBLCLK = 0x00A6, + NCMBUTTONDOWN = 0x00A7, + NCMBUTTONUP = 0x00A8, + NCMBUTTONDBLCLK = 0x00A9, + + SYSKEYDOWN = 0x0104, + SYSKEYUP = 0x0105, + SYSCHAR = 0x0106, + SYSDEADCHAR = 0x0107, + COMMAND = 0x0111, + SYSCOMMAND = 0x0112, + + MOUSEMOVE = 0x0200, + LBUTTONDOWN = 0x0201, + LBUTTONUP = 0x0202, + LBUTTONDBLCLK = 0x0203, + RBUTTONDOWN = 0x0204, + RBUTTONUP = 0x0205, + RBUTTONDBLCLK = 0x0206, + MBUTTONDOWN = 0x0207, + MBUTTONUP = 0x0208, + MBUTTONDBLCLK = 0x0209, + MOUSEWHEEL = 0x020A, + XBUTTONDOWN = 0x020B, + XBUTTONUP = 0x020C, + XBUTTONDBLCLK = 0x020D, + MOUSEHWHEEL = 0x020E, + + + CAPTURECHANGED = 0x0215, + + ENTERSIZEMOVE = 0x0231, + EXITSIZEMOVE = 0x0232, + + IME_SETCONTEXT = 0x0281, + IME_NOTIFY = 0x0282, + IME_CONTROL = 0x0283, + IME_COMPOSITIONFULL = 0x0284, + IME_SELECT = 0x0285, + IME_CHAR = 0x0286, + IME_REQUEST = 0x0288, + IME_KEYDOWN = 0x0290, + IME_KEYUP = 0x0291, + + NCMOUSELEAVE = 0x02A2, + + DWMCOMPOSITIONCHANGED = 0x031E, + DWMNCRENDERINGCHANGED = 0x031F, + DWMCOLORIZATIONCOLORCHANGED = 0x0320, + DWMWINDOWMAXIMIZEDCHANGE = 0x0321, + + #region Windows 7 + DWMSENDICONICTHUMBNAIL = 0x0323, + DWMSENDICONICLIVEPREVIEWBITMAP = 0x0326, + #endregion + + USER = 0x0400, + + // This is the hard-coded message value used by WinForms for Shell_NotifyIcon. + // It's relatively safe to reuse. + TRAYMOUSEMESSAGE = 0x800, //WM_USER + 1024 + APP = 0x8000, + } + + [SuppressUnmanagedCodeSecurity] + internal static class NativeMethods + { + /// + /// Delegate declaration that matches WndProc signatures. + /// + public delegate IntPtr MessageHandler(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled); + + [DllImport("shell32.dll", EntryPoint = "CommandLineToArgvW", CharSet = CharSet.Unicode)] + private static extern IntPtr _CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] string cmdLine, out int numArgs); + + + [DllImport("kernel32.dll", EntryPoint = "LocalFree", SetLastError = true)] + private static extern IntPtr _LocalFree(IntPtr hMem); + + + public static string[] CommandLineToArgvW(string cmdLine) + { + IntPtr argv = IntPtr.Zero; + try + { + int numArgs = 0; + + argv = _CommandLineToArgvW(cmdLine, out numArgs); + if (argv == IntPtr.Zero) + { + throw new Win32Exception(); + } + var result = new string[numArgs]; + + for (int i = 0; i < numArgs; i++) + { + IntPtr currArg = Marshal.ReadIntPtr(argv, i * Marshal.SizeOf(typeof(IntPtr))); + result[i] = Marshal.PtrToStringUni(currArg); + } + + return result; + } + finally + { + + IntPtr p = _LocalFree(argv); + // Otherwise LocalFree failed. + // Assert.AreEqual(IntPtr.Zero, p); + } + } + + } + + public interface ISingleInstanceApp + { + bool SignalExternalCommandLineArgs(IList args); + } + + /// + /// This class checks to make sure that only one instance of + /// this application is running at a time. + /// + /// + /// Note: this class should be used with some caution, because it does no + /// security checking. For example, if one instance of an app that uses this class + /// is running as Administrator, any other instance, even if it is not + /// running as Administrator, can activate it with command line arguments. + /// For most apps, this will not be much of an issue. + /// + public static class SingleInstance + where TApplication : Application, ISingleInstanceApp + + { + #region Private Fields + + /// + /// String delimiter used in channel names. + /// + private const string Delimiter = ":"; + + /// + /// Suffix to the channel name. + /// + private const string ChannelNameSuffix = "SingeInstanceIPCChannel"; + + /// + /// Remote service name. + /// + private const string RemoteServiceName = "SingleInstanceApplicationService"; + + /// + /// IPC protocol used (string). + /// + private const string IpcProtocol = "ipc://"; + + /// + /// Application mutex. + /// + private static Mutex singleInstanceMutex; + + /// + /// IPC channel for communications. + /// + private static IpcServerChannel channel; + + /// + /// List of command line arguments for the application. + /// + private static IList commandLineArgs; + + #endregion + + #region Public Properties + + /// + /// Gets list of command line arguments for the application. + /// + public static IList CommandLineArgs + { + get { return commandLineArgs; } + } + + #endregion + + #region Public Methods + + /// + /// Checks if the instance of the application attempting to start is the first instance. + /// If not, activates the first instance. + /// + /// True if this is the first instance of the application. + public static bool InitializeAsFirstInstance(string uniqueName) + { + commandLineArgs = GetCommandLineArgs(uniqueName); + + // Build unique application Id and the IPC channel name. + string applicationIdentifier = uniqueName + Environment.UserName; + + string channelName = String.Concat(applicationIdentifier, Delimiter, ChannelNameSuffix); + + // Create mutex based on unique application Id to check if this is the first instance of the application. + bool firstInstance; + singleInstanceMutex = new Mutex(true, applicationIdentifier, out firstInstance); + if (firstInstance) + { + CreateRemoteService(channelName); + } + else + { + SignalFirstInstance(channelName, commandLineArgs); + } + + return firstInstance; + } + + /// + /// Cleans up single-instance code, clearing shared resources, mutexes, etc. + /// + public static void Cleanup() + { + if (singleInstanceMutex != null) + { + singleInstanceMutex.Close(); + singleInstanceMutex = null; + } + + if (channel != null) + { + ChannelServices.UnregisterChannel(channel); + channel = null; + } + } + + #endregion + + #region Private Methods + + /// + /// Gets command line args - for ClickOnce deployed applications, command line args may not be passed directly, they have to be retrieved. + /// + /// List of command line arg strings. + private static IList GetCommandLineArgs(string uniqueApplicationName) + { + string[] args = null; + if (AppDomain.CurrentDomain.ActivationContext == null) + { + // The application was not clickonce deployed, get args from standard API's + args = Environment.GetCommandLineArgs(); + } + else + { + // The application was clickonce deployed + // Clickonce deployed apps cannot recieve traditional commandline arguments + // As a workaround commandline arguments can be written to a shared location before + // the app is launched and the app can obtain its commandline arguments from the + // shared location + string appFolderPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), uniqueApplicationName); + + string cmdLinePath = Path.Combine(appFolderPath, "cmdline.txt"); + if (File.Exists(cmdLinePath)) + { + try + { + using (TextReader reader = new StreamReader(cmdLinePath, System.Text.Encoding.Unicode)) + { + args = NativeMethods.CommandLineToArgvW(reader.ReadToEnd()); + } + + File.Delete(cmdLinePath); + } + catch (IOException) + { + } + } + } + + if (args == null) + { + args = new string[] { }; + } + + return new List(args); + } + + /// + /// Creates a remote service for communication. + /// + /// Application's IPC channel name. + private static void CreateRemoteService(string channelName) + { + BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); + serverProvider.TypeFilterLevel = TypeFilterLevel.Full; + IDictionary props = new Dictionary(); + + props["name"] = channelName; + props["portName"] = channelName; + props["exclusiveAddressUse"] = "false"; + + // Create the IPC Server channel with the channel properties + channel = new IpcServerChannel(props, serverProvider); + + // Register the channel with the channel services + ChannelServices.RegisterChannel(channel, true); + + // Expose the remote service with the REMOTE_SERVICE_NAME + IPCRemoteService remoteService = new IPCRemoteService(); + RemotingServices.Marshal(remoteService, RemoteServiceName); + } + + /// + /// Creates a client channel and obtains a reference to the remoting service exposed by the server - + /// in this case, the remoting service exposed by the first instance. Calls a function of the remoting service + /// class to pass on command line arguments from the second instance to the first and cause it to activate itself. + /// + /// Application's IPC channel name. + /// + /// Command line arguments for the second instance, passed to the first instance to take appropriate action. + /// + private static void SignalFirstInstance(string channelName, IList args) + { + IpcClientChannel secondInstanceChannel = new IpcClientChannel(); + ChannelServices.RegisterChannel(secondInstanceChannel, true); + + string remotingServiceUrl = IpcProtocol + channelName + "/" + RemoteServiceName; + + // Obtain a reference to the remoting service exposed by the server i.e the first instance of the application + IPCRemoteService firstInstanceRemoteServiceReference = (IPCRemoteService)RemotingServices.Connect(typeof(IPCRemoteService), remotingServiceUrl); + + // Check that the remote service exists, in some cases the first instance may not yet have created one, in which case + // the second instance should just exit + if (firstInstanceRemoteServiceReference != null) + { + // Invoke a method of the remote service exposed by the first instance passing on the command line + // arguments and causing the first instance to activate itself + firstInstanceRemoteServiceReference.InvokeFirstInstance(args); + } + } + + /// + /// Callback for activating first instance of the application. + /// + /// Callback argument. + /// Always null. + private static object ActivateFirstInstanceCallback(object arg) + { + // Get command line args to be passed to first instance + IList args = arg as IList; + ActivateFirstInstance(args); + return null; + } + + /// + /// Activates the first instance of the application with arguments from a second instance. + /// + /// List of arguments to supply the first instance of the application. + private static void ActivateFirstInstance(IList args) + { + // Set main window state and process command line args + if (Application.Current == null) + { + return; + } + + ((TApplication)Application.Current).SignalExternalCommandLineArgs(args); + } + + #endregion + + #region Private Classes + + /// + /// Remoting service class which is exposed by the server i.e the first instance and called by the second instance + /// to pass on the command line arguments to the first instance and cause it to activate itself. + /// + private class IPCRemoteService : MarshalByRefObject + { + /// + /// Activates the first instance of the application. + /// + /// List of arguments to pass to the first instance. + public void InvokeFirstInstance(IList args) + { + if (Application.Current != null) + { + // Do an asynchronous call to ActivateFirstInstance function + Application.Current.Dispatcher.BeginInvoke( + DispatcherPriority.Normal, new DispatcherOperationCallback(SingleInstance.ActivateFirstInstanceCallback), args); + } + } + + /// + /// Remoting Object's ease expires after every 5 minutes by default. We need to override the InitializeLifetimeService class + /// to ensure that lease never expires. + /// + /// Always null. + public override object InitializeLifetimeService() + { + return null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/MultiWindowExample/Window1.xaml b/MultiWindowExample/Window1.xaml new file mode 100644 index 0000000..d9e05fa --- /dev/null +++ b/MultiWindowExample/Window1.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/MultiWindowExample/Window1.xaml.cs b/MultiWindowExample/Window1.xaml.cs new file mode 100644 index 0000000..30b4547 --- /dev/null +++ b/MultiWindowExample/Window1.xaml.cs @@ -0,0 +1,54 @@ +using System.Reflection; +using System.Windows; +using System.Windows.Media; +using ChartIQ.Finsemble; +using log4net; + +namespace MultiWindowExample +{ + /// + /// Interaction logic for Window1.xaml + /// + public partial class Window1 : Window, IIntegratable + { + /// + /// The logger + /// + private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private Finsemble fsbl; + + public Window1() + { + InitializeComponent(); + } + + public void SetFinsemble(Finsemble fsbl) + { + this.fsbl = fsbl; + + Application.Current.Dispatcher.Invoke(() => + { + FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance + + // Styling the Finsemble Header + FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3C4C58"))); + FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#303D47"))); + FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#004BA3"))); + FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetTitleForeground(new SolidColorBrush(Colors.White)); + FinsembleHeader.SetButtonForeground(new SolidColorBrush(Colors.White)); + + FinsembleHeader.SetButtonFont(null, 14, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetTitleFont(null, 14, FontStyles.Normal, FontWeights.Normal); + + fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop. + + Show(); + }); + } + } +} diff --git a/MultiWindowExample/Window2.xaml b/MultiWindowExample/Window2.xaml new file mode 100644 index 0000000..1301464 --- /dev/null +++ b/MultiWindowExample/Window2.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/MultiWindowExample/Window2.xaml.cs b/MultiWindowExample/Window2.xaml.cs new file mode 100644 index 0000000..6738e07 --- /dev/null +++ b/MultiWindowExample/Window2.xaml.cs @@ -0,0 +1,47 @@ +using System.Windows; +using System.Windows.Media; +using ChartIQ.Finsemble; + +namespace MultiWindowExample +{ + /// + /// Interaction logic for Window2.xaml + /// + public partial class Window2 : Window, IIntegratable + { + private Finsemble fsbl; + + public Window2() + { + InitializeComponent(); + } + + public void SetFinsemble(Finsemble fsbl) + { + this.fsbl = fsbl; + + Application.Current.Dispatcher.Invoke(() => + { + FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance + + // Styling the Finsemble Header + FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3C4C58"))); + FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#303D47"))); + FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#004BA3"))); + FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetTitleForeground(new SolidColorBrush(Colors.White)); + FinsembleHeader.SetButtonForeground(new SolidColorBrush(Colors.White)); + + FinsembleHeader.SetButtonFont(null, 14, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetTitleFont(null, 14, FontStyles.Normal, FontWeights.Normal); + + fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop. + + Show(); + }); + } + } +} diff --git a/MultiWindowExample/Window3.xaml b/MultiWindowExample/Window3.xaml new file mode 100644 index 0000000..32b0b0b --- /dev/null +++ b/MultiWindowExample/Window3.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/MultiWindowExample/Window3.xaml.cs b/MultiWindowExample/Window3.xaml.cs new file mode 100644 index 0000000..217d523 --- /dev/null +++ b/MultiWindowExample/Window3.xaml.cs @@ -0,0 +1,47 @@ +using System.Windows; +using System.Windows.Media; +using ChartIQ.Finsemble; + +namespace MultiWindowExample +{ + /// + /// Interaction logic for Window3.xaml + /// + public partial class Window3 : Window, IIntegratable + { + private Finsemble fsbl; + + public Window3() + { + InitializeComponent(); + } + + public void SetFinsemble(Finsemble fsbl) + { + this.fsbl = fsbl; + + Application.Current.Dispatcher.Invoke(() => + { + FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance + + // Styling the Finsemble Header + FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3C4C58"))); + FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#303D47"))); + FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#004BA3"))); + FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetTitleForeground(new SolidColorBrush(Colors.White)); + FinsembleHeader.SetButtonForeground(new SolidColorBrush(Colors.White)); + + FinsembleHeader.SetButtonFont(null, 14, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetTitleFont(null, 14, FontStyles.Normal, FontWeights.Normal); + + fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop. + + Show(); + }); + } + } +} diff --git a/MultiWindowExample/Window4.xaml b/MultiWindowExample/Window4.xaml new file mode 100644 index 0000000..ed66c58 --- /dev/null +++ b/MultiWindowExample/Window4.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/MultiWindowExample/Window4.xaml.cs b/MultiWindowExample/Window4.xaml.cs new file mode 100644 index 0000000..12b8d37 --- /dev/null +++ b/MultiWindowExample/Window4.xaml.cs @@ -0,0 +1,47 @@ +using System.Windows; +using System.Windows.Media; +using ChartIQ.Finsemble; + +namespace MultiWindowExample +{ + /// + /// Interaction logic for Window4.xaml + /// + public partial class Window4 : Window, IIntegratable + { + private Finsemble fsbl; + + public Window4() + { + InitializeComponent(); + } + + public void SetFinsemble(Finsemble fsbl) + { + this.fsbl = fsbl; + + Application.Current.Dispatcher.Invoke(() => + { + FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance + + // Styling the Finsemble Header + FinsembleHeader.SetActiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3C4C58"))); + FinsembleHeader.SetInactiveBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#303D47"))); + FinsembleHeader.SetButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetInactiveButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#004BA3"))); + FinsembleHeader.SetCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetInactiveCloseButtonHoverBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#D30E2D"))); + FinsembleHeader.SetDockingButtonDockedBackground(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#005BC5"))); + FinsembleHeader.SetTitleForeground(new SolidColorBrush(Colors.White)); + FinsembleHeader.SetButtonForeground(new SolidColorBrush(Colors.White)); + + FinsembleHeader.SetButtonFont(null, 14, FontStyles.Normal, FontWeights.Normal); + FinsembleHeader.SetTitleFont(null, 14, FontStyles.Normal, FontWeights.Normal); + + fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop. + + Show(); + }); + } + } +} diff --git a/MultiWindowExample/log4net.config b/MultiWindowExample/log4net.config new file mode 100644 index 0000000..91734ee --- /dev/null +++ b/MultiWindowExample/log4net.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MultiWindowExample/packages.config b/MultiWindowExample/packages.config new file mode 100644 index 0000000..8858c6d --- /dev/null +++ b/MultiWindowExample/packages.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WPFExample/App.config b/WPFExample/App.config index 0fda0b4..03f1e9d 100644 --- a/WPFExample/App.config +++ b/WPFExample/App.config @@ -1,6 +1,6 @@  - + @@ -14,6 +14,10 @@ + + + + @@ -21,14 +25,6 @@ - - - - - - - - diff --git a/WPFExample/MainWindow.xaml b/WPFExample/MainWindow.xaml index fa4cdc8..8af84fa 100644 --- a/WPFExample/MainWindow.xaml +++ b/WPFExample/MainWindow.xaml @@ -18,18 +18,18 @@ ResizeBorderThickness="4" GlassFrameThickness="0"/> - +