diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj
index 9b55bc0..e5e69b5 100644
--- a/AuthenticationExample/AuthenticationExample.csproj
+++ b/AuthenticationExample/AuthenticationExample.csproj
@@ -89,11 +89,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
-
-
- ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
@@ -116,6 +113,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
diff --git a/AuthenticationExample/MainWindow.xaml b/AuthenticationExample/MainWindow.xaml
index eb4a446..1ddda75 100644
--- a/AuthenticationExample/MainWindow.xaml
+++ b/AuthenticationExample/MainWindow.xaml
@@ -5,12 +5,56 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:AuthenticationExample"
mc:Ignorable="d"
- Title="MainWindow" Height="350" Width="525"
+ Title="MainWindow" Height="300" Width="350"
Closing="Window_Closing">
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AuthenticationExample/MainWindow.xaml.cs b/AuthenticationExample/MainWindow.xaml.cs
index 26addb9..872b7cd 100644
--- a/AuthenticationExample/MainWindow.xaml.cs
+++ b/AuthenticationExample/MainWindow.xaml.cs
@@ -1,19 +1,7 @@
-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;
-using ChartIQ.Finsemble;
+using ChartIQ.Finsemble;
using Newtonsoft.Json.Linq;
+using System;
+using System.Windows;
namespace AuthenticationExample
{
@@ -50,7 +38,7 @@ private void Finsemble_Connected(object sender, EventArgs e)
});
}
- private void Button_Click(object sender, RoutedEventArgs e)
+ private void PublishCredentials_Click(object sender, RoutedEventArgs e)
{
finsemble.AuthenticationClient.PublishAuthorization(UserName.Text, JObject.FromObject(new Credentials(Guid.NewGuid().ToString())));
}
diff --git a/AuthenticationExample/Properties/AssemblyInfo.cs b/AuthenticationExample/Properties/AssemblyInfo.cs
index cff6e40..9cdc56f 100644
--- a/AuthenticationExample/Properties/AssemblyInfo.cs
+++ b/AuthenticationExample/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("4.5.0.0")]
-[assembly: AssemblyFileVersion("4.5.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]
diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config
index 91a0366..7cab62a 100644
--- a/AuthenticationExample/packages.config
+++ b/AuthenticationExample/packages.config
@@ -3,13 +3,13 @@
-
-
-
+
+
+
diff --git a/MultiWindowExample/App.config b/MultiWindowExample/App.config
index c97a35c..3ffaea1 100644
--- a/MultiWindowExample/App.config
+++ b/MultiWindowExample/App.config
@@ -13,14 +13,6 @@
-
-
-
-
-
-
-
-
diff --git a/MultiWindowExample/App.xaml.cs b/MultiWindowExample/App.xaml.cs
index 7da60ce..ecb5484 100644
--- a/MultiWindowExample/App.xaml.cs
+++ b/MultiWindowExample/App.xaml.cs
@@ -7,7 +7,6 @@
using System.Windows;
using System.Windows.Threading;
using ChartIQ.Finsemble;
-using log4net;
using Microsoft.Shell;
namespace MultiWindowExample
@@ -17,10 +16,6 @@ namespace MultiWindowExample
///
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();
@@ -67,7 +62,6 @@ public static void Main(string[] args)
// 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.
@@ -94,9 +88,7 @@ public static void Main(string[] args)
// Allow single instance code to perform cleanup operations
SingleInstance.Cleanup();
}
-
}
-
}
///
@@ -146,7 +138,7 @@ private static bool LaunchWindow(IList args)
if (window == null)
{
- Logger.Error($"Could not create window: {name}");
+ Debug.Write($"Could not create window: {name}");
}
else
{
@@ -158,7 +150,7 @@ private static bool LaunchWindow(IList args)
IIntegratable fsblWin = window as IIntegratable;
if (fsblWin == null)
{
- Logger.Warn($"The window \"{name}\" is not a window that can be integrated into Finsemble.");
+ Debug.Write($"The window \"{name}\" is not a window that can be integrated into Finsemble.");
}
else
{
diff --git a/MultiWindowExample/MultiWindowExample.csproj b/MultiWindowExample/MultiWindowExample.csproj
index c7db519..17e1acb 100644
--- a/MultiWindowExample/MultiWindowExample.csproj
+++ b/MultiWindowExample/MultiWindowExample.csproj
@@ -49,8 +49,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
@@ -76,6 +76,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
@@ -163,9 +166,6 @@
ResXFileCodeGenerator
Resources.Designer.cs
-
- Always
-
SettingsSingleFileGenerator
diff --git a/MultiWindowExample/Properties/AssemblyInfo.cs b/MultiWindowExample/Properties/AssemblyInfo.cs
index 1db953b..5a7809a 100644
--- a/MultiWindowExample/Properties/AssemblyInfo.cs
+++ b/MultiWindowExample/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("4.5.0.0")]
-[assembly: AssemblyFileVersion("4.5.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]
diff --git a/MultiWindowExample/Window1.xaml.cs b/MultiWindowExample/Window1.xaml.cs
index 38d261a..84c389d 100644
--- a/MultiWindowExample/Window1.xaml.cs
+++ b/MultiWindowExample/Window1.xaml.cs
@@ -1,8 +1,7 @@
-using System.Reflection;
+using ChartIQ.Finsemble;
using System.Windows;
using System.Windows.Media;
-using ChartIQ.Finsemble;
-using log4net;
+using ChartIQ.Finsemble.Models;
namespace MultiWindowExample
{
@@ -11,11 +10,6 @@ namespace MultiWindowExample
///
public partial class Window1 : Window, IIntegratable
{
- ///
- /// The logger
- ///
- private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private Finsemble fsbl;
public Window1()
@@ -32,18 +26,30 @@ public void SetFinsemble(Finsemble fsbl)
FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance
//Styling the Finsemble Header
- 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);
+ FinsembleHeader.GetHandlingService().ActiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().InactiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().ButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().InactiveButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().CloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().InactiveCloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().DockingButtonDockedBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+ FinsembleHeader.GetHandlingService().ButtonForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+
+ FinsembleHeader.GetHandlingService().ButtonFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 8,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.Normal
+ };
+ FinsembleHeader.GetHandlingService().TitleFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 12,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.SemiBold
+ };
fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop.
diff --git a/MultiWindowExample/Window2.xaml.cs b/MultiWindowExample/Window2.xaml.cs
index a827356..280543c 100644
--- a/MultiWindowExample/Window2.xaml.cs
+++ b/MultiWindowExample/Window2.xaml.cs
@@ -1,6 +1,7 @@
using System.Windows;
using System.Windows.Media;
using ChartIQ.Finsemble;
+using ChartIQ.Finsemble.Models;
namespace MultiWindowExample
{
@@ -25,18 +26,30 @@ public void SetFinsemble(Finsemble fsbl)
FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance
//Styling the Finsemble Header
- 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);
+ FinsembleHeader.GetHandlingService().ActiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().InactiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().ButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().InactiveButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().CloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().InactiveCloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().DockingButtonDockedBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+ FinsembleHeader.GetHandlingService().ButtonForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+
+ FinsembleHeader.GetHandlingService().ButtonFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 8,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.Normal
+ };
+ FinsembleHeader.GetHandlingService().TitleFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 12,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.SemiBold
+ };
fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop.
diff --git a/MultiWindowExample/Window3.xaml.cs b/MultiWindowExample/Window3.xaml.cs
index f3147f9..4fae987 100644
--- a/MultiWindowExample/Window3.xaml.cs
+++ b/MultiWindowExample/Window3.xaml.cs
@@ -1,6 +1,7 @@
using System.Windows;
using System.Windows.Media;
using ChartIQ.Finsemble;
+using ChartIQ.Finsemble.Models;
namespace MultiWindowExample
{
@@ -25,18 +26,30 @@ public void SetFinsemble(Finsemble fsbl)
FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance
//Styling the Finsemble Header
- 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);
+ FinsembleHeader.GetHandlingService().ActiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().InactiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().ButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().InactiveButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().CloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().InactiveCloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().DockingButtonDockedBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+ FinsembleHeader.GetHandlingService().ButtonForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+
+ FinsembleHeader.GetHandlingService().ButtonFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 8,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.Normal
+ };
+ FinsembleHeader.GetHandlingService().TitleFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 12,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.SemiBold
+ };
fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop.
diff --git a/MultiWindowExample/Window4.xaml.cs b/MultiWindowExample/Window4.xaml.cs
index 01fca96..4e72c86 100644
--- a/MultiWindowExample/Window4.xaml.cs
+++ b/MultiWindowExample/Window4.xaml.cs
@@ -1,6 +1,7 @@
using System.Windows;
using System.Windows.Media;
using ChartIQ.Finsemble;
+using ChartIQ.Finsemble.Models;
namespace MultiWindowExample
{
@@ -25,18 +26,30 @@ public void SetFinsemble(Finsemble fsbl)
FinsembleHeader.SetBridge(fsbl); // The Header Control needs a connected finsemble instance
//Styling the Finsemble Header
- 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);
+ FinsembleHeader.GetHandlingService().ActiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().InactiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().ButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().InactiveButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().CloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().InactiveCloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().DockingButtonDockedBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+ FinsembleHeader.GetHandlingService().ButtonForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+
+ FinsembleHeader.GetHandlingService().ButtonFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 8,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.Normal
+ };
+ FinsembleHeader.GetHandlingService().TitleFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 12,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.SemiBold
+ };
fsbl.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop.
diff --git a/MultiWindowExample/log4net.config b/MultiWindowExample/log4net.config
deleted file mode 100644
index 91734ee..0000000
--- a/MultiWindowExample/log4net.config
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/MultiWindowExample/packages.config b/MultiWindowExample/packages.config
index 91a0366..3baf63b 100644
--- a/MultiWindowExample/packages.config
+++ b/MultiWindowExample/packages.config
@@ -3,13 +3,14 @@
-
+
+
diff --git a/WPFExample/App.xaml.cs b/WPFExample/App.xaml.cs
index 1c6f2e4..794cd8d 100644
--- a/WPFExample/App.xaml.cs
+++ b/WPFExample/App.xaml.cs
@@ -1,29 +1,22 @@
-using System.Diagnostics;
-using System.Reflection;
+using ChartIQ.Finsemble;
+using System.Diagnostics;
using System.Windows;
-using log4net;
-using ChartIQ.Finsemble;
-
namespace WPFExample
{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
{
- ///
- /// The logger
- ///
- private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private MainWindow mainWindow = null;
+ private MainWindow mainWindow = null;
- protected override void OnStartup(StartupEventArgs e)
+ protected override void OnStartup(StartupEventArgs e)
{
- Logger.Debug("OnStartup");
+ Debug.Print("OnStartup");
#if DEBUG
- Debugger.Launch();
+ Debugger.Launch();
#endif
mainWindow = new MainWindow(e.Args); // send command line arguments to main window.
}
@@ -31,11 +24,13 @@ protected override void OnStartup(StartupEventArgs e)
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
#if DEBUG
- Debugger.Launch();
+ Debugger.Launch();
#endif
- Finsemble.DispatcherUnhandledException(mainWindow, e);
- Logger.Error("An Unhandled Exception has occurred. Please Check your event Logs.", e.Exception);
- Shutdown();
- }
+
+ Finsemble.DispatcherUnhandledException(mainWindow, e);
+
+ Debug.Print($"An Unhandled Exception has occurred. Exception: {e.Exception}");
+ Shutdown();
+ }
}
}
diff --git a/WPFExample/MainWindow.xaml b/WPFExample/MainWindow.xaml
index c1b6b8a..3c2ac7c 100644
--- a/WPFExample/MainWindow.xaml
+++ b/WPFExample/MainWindow.xaml
@@ -1,36 +1,37 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
diff --git a/WPFExample/MainWindow.xaml.cs b/WPFExample/MainWindow.xaml.cs
index 1ebf4d0..457293f 100644
--- a/WPFExample/MainWindow.xaml.cs
+++ b/WPFExample/MainWindow.xaml.cs
@@ -1,11 +1,11 @@
-using System;
+using ChartIQ.Finsemble;
+using Newtonsoft.Json.Linq;
+using System;
using System.Collections.Generic;
-using System.Reflection;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
-using ChartIQ.Finsemble;
-using log4net;
-using Newtonsoft.Json.Linq;
+using ChartIQ.Finsemble.Models;
namespace WPFExample
{
@@ -17,7 +17,6 @@ public partial class MainWindow : Window
///
/// The logger
///
- private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Finsemble FSBL;
@@ -27,37 +26,127 @@ private void SpawnComponent_Click(object sender, RoutedEventArgs e)
if (selected != null)
{
string componentName = selected.ToString();
- FSBL.LauncherClient.Spawn(componentName, new JObject { ["addToWorkspace"] = true }, (s, a) => { });
+
+ if (FSBL.FDC3Client is object)
+ {
+ //FDC3 Usage example
+ //open
+ FSBL.FDC3Client.fdc3.open(componentName, new JObject
+ {
+ ["type"] = "fdc3.instrument",
+ ["name"] = DataToSend.Text,
+ ["id"] = new JObject
+ {
+ ["ticker"] = DataToSend.Text
+ }
+ }, (s, args) => { });
+
+ //Intent
+ //FSBL.FDC3Client.fdc3.raiseIntent("ViewChart", new JObject
+ //{
+ // ["type"] = "fdc3.instrument",
+ // ["name"] = DataToSend.Text,
+ // ["id"] = new JObject
+ // {
+ // ["ticker"] = DataToSend.Text
+ // }
+ //}, (s, args) => { });
+
+ //FSBL.FDC3Client.fdc3.findIntent("ViewChart", (s, intent) =>
+ //{
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example, findIntent.", intent });
+ //});
+
+ //FSBL.FDC3Client.fdc3.findIntent("ViewChart", new JObject
+ // {
+ // ["type"] = "fdc3.instrument"
+ // }, (s, intent) =>
+ // {
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example, findIntent.", intent });
+ // }
+ //);
+
+ //FSBL.FDC3Client.fdc3.findIntentsByContext(new JObject
+ // {
+ // ["type"] = "fdc3.instrument"
+ // }, (s, intents) =>
+ // {
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example, findIntentsByContext.", intents });
+ // }
+ //);
+
+ //Context
+ //FSBL.FDC3Client.fdc3.getCurrentChannel((s, channel) => {
+ // channel.getCurrentContext("fdc3.instrument", (sender, context) => {
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example: getCurrentContext.", context });
+ // });
+ //});
+
+ //Channels
+ //FSBL.FDC3Client.fdc3.getOrCreateChannel("test", (s, args) => { });
+
+ //FSBL.FDC3Client.fdc3.getSystemChannels((s, channelList) =>
+ //{
+ // foreach (IChannel channel in channelList)
+ // {
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example: getSystemChannels.", channel.id });
+ // }
+ //});
+
+ //FSBL.FDC3Client.fdc3.getCurrentChannel((s, channel) => {
+ // FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example: getCurrentChannel.", channel.id });
+ //});
+ }
+ else
+ {
+ FSBL.LauncherClient.Spawn(componentName, new JObject { ["addToWorkspace"] = true }, (s, a) => { });
+ }
}
}
private void Send_Click(object sender, RoutedEventArgs e)
{
- //set state on click
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ if (FSBL.FDC3Client is object)
{
- DroppedData.Content = DataToSend.Text;
- DroppedDataSource.Content = "via Linker";
- SaveState();
- });
+ //FDC3 Usage example
+ //Broadcast
+ FSBL.FDC3Client.fdc3.broadcast(new JObject
+ {
+ ["type"] = "fdc3.instrument",
+ ["name"] = DataToSend.Text,
+ ["id"] = new JObject
+ {
+ ["ticker"] = DataToSend.Text
+ }
+ });
+ }
+ else
+ {
+ // Use Default Linker
+ FSBL.LinkerClient.Publish(new JObject
+ {
+ ["dataType"] = "symbol",
+ ["data"] = DataToSend.Text
+ });
+ }
- FSBL.LinkerClient.Publish(new JObject
- {
- ["dataType"] = "symbol",
- ["data"] = DataToSend.Text
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
+ {
+ DroppedData.Content = DataToSend.Text;
+ DroppedDataSource.Content = "via Text entry";
+ await SaveStateAsync();
});
-
}
- ///
- /// The MainWindow is created by the App so that we can get command line arguments passed from Finsemble.
- ///
- ///
- public MainWindow(string[] args)
+ ///
+ /// The MainWindow is created by the App so that we can get command line arguments passed from Finsemble.
+ ///
+ ///
+ public MainWindow(string[] args)
{
-
- // Trigger actions on close when requested by Finsemble, e.g.:
+ // Trigger actions on close when requested by Finsemble, e.g.:
this.Closing += MainWindow_Closing;
+
//Ensure that your window has been created (so that its window handle exists) before connecting to Finsemble.
FSBL = new Finsemble(args, this); // Finsemble needs the command line arguments to connect and also this Window to manage snapping, docking etc.
FSBL.Connected += Finsemble_Connected;
@@ -73,60 +162,73 @@ 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("#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);
+
+ FinsembleHeader.GetHandlingService().ActiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().InactiveBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#22262F"));
+ FinsembleHeader.GetHandlingService().ButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().InactiveButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().CloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().InactiveCloseButtonHoverBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F26666"));
+ FinsembleHeader.GetHandlingService().DockingButtonDockedBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A8CF4"));
+ FinsembleHeader.GetHandlingService().TitleForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+ FinsembleHeader.GetHandlingService().ButtonForeground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ACB2C0"));
+
+ FinsembleHeader.GetHandlingService().ButtonFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 8,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.Normal
+ };
+ FinsembleHeader.GetHandlingService().TitleFont = new TitlebarFontConfiguration()
+ {
+ FontFamily = null,
+ FontSize = 12,
+ FontStyle = FontStyles.Normal,
+ FontWeight = FontWeights.SemiBold
+ };
//Set window title
- FinsembleHeader.SetTitle("WPF Example Component");
+ FinsembleHeader.GetHandlingService().Title = "WPF Example Component";
FSBL.DragAndDropClient.SetScrim(Scrim); // The Scrim Label Control is used for drag and drop.
- // Receivers for dropped data.
- FSBL.DragAndDropClient.AddReceivers(new List>>()
- {
- new KeyValuePair>("symbol", (s, args) =>
- {
- var data = args.response["data"]?["symbol"];
- if(data != null)
- {
- //Check if we received an object (so data.symbol.symbol) or a string (data.symbol) to support variations in the format
- if(data.HasValues) {
- data = data?["symbol"];
- }
- Application.Current.Dispatcher.Invoke((Action)delegate //main thread
- {
- Application.Current.Dispatcher.Invoke((Action)delegate //main thread
- {
- DroppedData.Content = data.ToString();
- DataToSend.Text = data.ToString();
- DroppedDataSource.Content = "via Drag and Drop";
- SaveState();
- });
- });
- }
- })
- });
-
- // Emitters for data that can be dragged using the drag icon.
- FSBL.DragAndDropClient.SetEmitters(new List>()
+ // Receivers for dropped data.
+ FSBL.DragAndDropClient.AddReceivers(new List>>()
+ {
+ new KeyValuePair>("symbol", (s, args) =>
+ {
+ var data = args.response["data"]?["symbol"];
+ if(data != null)
+ {
+ //Check if we received an object (so data.symbol.symbol) or a string (data.symbol) to support variations in the format
+ if(data.HasValues) {
+ data = data?["symbol"];
+ }
+ Application.Current.Dispatcher.Invoke((Action)delegate //main thread
+ {
+ Application.Current.Dispatcher.Invoke((Action)async delegate //main thread
+ {
+ DroppedData.Content = data.ToString();
+ DataToSend.Text = data.ToString();
+ DroppedDataSource.Content = "via Drag and Drop";
+ await SaveStateAsync();
+ });
+ });
+ }
+ })
+ });
+
+ // Emitters for data that can be dragged using the drag icon.
+ FSBL.DragAndDropClient.SetEmitters(new List>()
{
new KeyValuePair("symbol", () =>
{
//set state on drag so correct symbol is displayed
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
{
DroppedData.Content = DataToSend.Text;
- SaveState();
+ await SaveStateAsync();
});
return new JObject
{
@@ -145,7 +247,6 @@ private void Finsemble_Connected(object sender, EventArgs e)
{
if (response.error != null)
{
- Logger.Error(response.error);
return;
}
@@ -169,40 +270,76 @@ private void Finsemble_Connected(object sender, EventArgs e)
this.Show();
});
- // Subscribe to Finsemble Linker Channels
- FSBL.LinkerClient.Subscribe("symbol", (error, response) =>
+ if (FSBL.FDC3Client is object)
{
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ //FDC3 Usage example
+ Application.Current.Dispatcher.Invoke(delegate //main thread
{
- DataToSend.Text = response.response?["data"]?.ToString();
- DroppedData.Content = response.response?["data"]?.ToString();
- DroppedDataSource.Content = "via Linker";
- SaveState();
+ FDC3Label.Visibility = Visibility.Visible;
});
- });
+ //Context handler
+ EventHandler contextHandler = (s, context) =>
+ {
+ FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example, context received by contextHandler.", context });
+ if (context["type"].ToString().Equals("fdc3.instrument"))
+ {
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
+ {
+ DataToSend.Text = context?["id"]?["ticker"]?.ToString();
+ DroppedData.Content = context?["id"]?["ticker"]?.ToString();
+ DroppedDataSource.Content = "context shared via FDC3";
+ await SaveStateAsync();
+ });
+ }
+ };
+ FSBL.FDC3Client.fdc3.addContextListener(contextHandler);
+ //FSBL.FDC3Client.fdc3.addContextListener("fdc3.instrument", contextHandler);
+ EventHandler intentHandler = (s, context) =>
+ {
+ FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example: context received by intentHandler.", context });
+ if (context["type"].ToString().Equals("fdc3.instrument"))
+ {
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
+ {
+ DataToSend.Text = context?["id"]?["ticker"]?.ToString();
+ DroppedData.Content = context?["id"]?["ticker"]?.ToString();
+ DroppedDataSource.Content = "context shared via FDC3 intent";
+ await SaveStateAsync();
+ });
+ }
+ };
+ FSBL.FDC3Client.fdc3.addIntentListener("ViewChart", intentHandler);
+ }
+ else
+ {
+ //Use Default linker
+ //Subscribe to Finsemble Linker Channels
+ FSBL.LinkerClient.Subscribe("symbol", (error, response) =>
+ {
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
+ {
+ DataToSend.Text = response.response?["data"]?.ToString();
+ DroppedData.Content = response.response?["data"]?.ToString();
+ DroppedDataSource.Content = "via Linker";
+ await SaveStateAsync();
+ });
+ });
+ }
+
// Logging to the Finsemble Central Console
- /*FSBL.RPC("Logger.error", new List {
- "Error Test"
- });
+ /*
+ FSBL.Logger.Error(new JToken[] {"Error Test"});
- FSBL.RPC("Logger.log", new List {
- "Log Test"
- });
+ FSBL.Logger.Log(new JToken[] {"Log Test"});
- FSBL.RPC("Logger.debug", new List {
- "Debug Test"
- });
+ FSBL.Logger.Debug(new JToken[] {"Debug Test"});
- FSBL.RPC("Logger.info", new List {
- "Info Test"
- });
+ FSBL.Logger.Info(new JToken[] {"Info Test"});
- FSBL.RPC("Logger.verbose", new List {
- "Verbose Test"
- });
+ FSBL.Logger.Verbose(new JToken[] {"Verbose Test"});
*/
////Sample code to execute LauncherClient.getActiveDescriptors()
@@ -212,65 +349,87 @@ private void Finsemble_Connected(object sender, EventArgs e)
//});
}
- ///
- /// Example window close handler
- ///
- ///
- ///
+ ///
+ /// Example window close handler
+ ///
+ ///
+ ///
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- /*if (MessageBox.Show("Close Application?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
- {
- // Cancel Closing
- e.Cancel = true;
- return;
+ /*if (MessageBox.Show("Close Application?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
+ {
+ // Cancel Closing
+ e.Cancel = true;
+ return;
}*/
}
private void LinkToGroup_Click(object sender, RoutedEventArgs e)
{
- FSBL.LinkerClient.LinkToChannel("group1", null, (s, r) =>
- {
- FSBL.RPC("Logger.log", new List {
- "Link to Group1", r.response
- });
-
- });
+ if (FSBL.FDC3Client is null)
+ {
+ FSBL.LinkerClient.LinkToChannel("group1", null, (s, r) =>
+ {
+ FSBL.Logger.Log(new JToken[] { "Link to Group1", r.response });
+ });
+ }
+ else
+ {
+ //FDC3 Usage example
+ //joinChannel
+ FSBL.FDC3Client.fdc3.joinChannel("group1");
+ }
}
- private void SaveState()
+ private async Task SaveStateAsync()
{
try
{
- FSBL.WindowClient.SetComponentState(new JObject
+ await FSBL.WindowClient.SetComponentState(new JObject
{
["field"] = "symbol",
["value"] = DataToSend.Text
- }, delegate (object s, FinsembleEventArgs e) { });
+ });
+ }
+ catch (ApplicationException e)
+ {
+ FSBL.Logger.Warn(new JToken[] { "WPFExample SaveState Warn", e.Message, e.StackTrace });
}
catch (Exception e)
{
- //MessageBox.Show(e.Message);
+ FSBL.Logger.Error(new JToken[] { "WPFExample SaveState Error", e.Message, e.StackTrace });
}
}
- private void UnLinkFromGroup_Click(object sender, RoutedEventArgs e)
- {
- FSBL.LinkerClient.UnlinkFromChannel("group1", null, (s, r) =>
- {
- FSBL.RPC("Logger.log", new List {
- "Unlinked from Group1", r.response
- });
- });
- }
-
- private void UpdateDisplayData()
+ private void UnLinkFromGroup_Click(object sender, RoutedEventArgs e)
+ {
+ if (FSBL.FDC3Client is null)
+ {
+ FSBL.LinkerClient.UnlinkFromChannel("group1", null, (s, r) =>
+ {
+ FSBL.Logger.Log(new JToken[] { "Unlinked from Group1", r.response });
+ });
+ }
+ else
+ {
+ //FDC3 Usage Example
+ //leaveCurrentChannel
+ FSBL.FDC3Client.fdc3.leaveCurrentChannel((s, args) =>
+ {
+ FSBL.Logger.Log(new JToken[] { "WPF FDC3 Usage Example: leaveCurrentChannel.", args });
+ });
+ }
+ }
+
+
+ private void UpdateDisplayData()
{
FSBL.WindowClient.GetComponentState(
new JObject { ["field"] = "symbol" },
delegate (object s, FinsembleEventArgs state)
{
- try {
+ try
+ {
string symbolTxt = state.response == null ? null : state.response?.ToString();
if (!string.IsNullOrEmpty(symbolTxt) && !symbolTxt.Equals("{}"))
{
@@ -284,8 +443,9 @@ private void UpdateDisplayData()
else
{
//Get SpawnData if no previous state
- FSBL.WindowClient.getSpawnData((sender, r) => {
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ FSBL.WindowClient.GetSpawnData((sender, r) =>
+ {
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
{
symbolTxt = r.response == null ? null : r.response?["symbol"]?.ToString();
if (!string.IsNullOrEmpty(symbolTxt) && !symbolTxt.Equals("{}"))
@@ -300,14 +460,14 @@ private void UpdateDisplayData()
DroppedData.Content = "MSFT";
DroppedDataSource.Content = "via default value";
}
- SaveState();
+ await SaveStateAsync();
});
});
}
}
catch (Exception e)
{
- //MessageBox.Show(e.Message);
+ FSBL.Logger.Error(new JToken[] { "WPFExample UpdateDisplayData Error", e.Message, e.StackTrace });
}
}
);
@@ -316,19 +476,21 @@ private void UpdateDisplayData()
private void Publish_Click(object sender, RoutedEventArgs e)
{
//set state on click
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
{
DroppedData.Content = DataToSend.Text;
- SaveState();
+ await SaveStateAsync();
});
//N.B. You must add a PubSub responder before publishing or subscribing to any topic that doesn't start with 'Finsemble'
// This is not currently supported in the .Net RouterClient implementation and will need to done in a Finsemble HTML5 service
- FSBL.RouterClient.Publish("Finsemble.TestWPFPubSubSymbol", new JObject {
- ["symbol"] = DataToSend.Text
+ FSBL.RouterClient.Publish("Finsemble.TestWPFPubSubSymbol", new JObject
+ {
+ ["symbol"] = DataToSend.Text
});
}
+
private void Subscribe_to_pubsub()
{
FSBL.RouterClient.Subscribe("Finsemble.TestWPFPubSubSymbol", delegate (object s, FinsembleEventArgs state)
@@ -338,26 +500,27 @@ private void Subscribe_to_pubsub()
if (state.response != null)
{
var pubSubData = (JObject)state.response;
- Application.Current.Dispatcher.Invoke(delegate //main thread
+ Application.Current.Dispatcher.Invoke(async delegate //main thread
{
// The initial publish will always be an empty object.
// Therefore, we need these null operators to handle that case.
var theData = ((JValue)pubSubData?["data"]?["symbol"])?.ToString();
- if (theData != null) {
+ if (theData != null)
+ {
DataToSend.Text = theData;
DroppedData.Content = theData;
DroppedDataSource.Content = "via PubSub";
- SaveState();
+ await SaveStateAsync();
}
});
}
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message);
+ FSBL.Logger.Error(new JToken[] { "WPFExample Subscribe_to_Publish Error", ex.Message, ex.StackTrace });
}
});
}
- }
+ }
}
diff --git a/WPFExample/Properties/AssemblyInfo.cs b/WPFExample/Properties/AssemblyInfo.cs
index 0d4997a..cdd53be 100644
--- a/WPFExample/Properties/AssemblyInfo.cs
+++ b/WPFExample/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
@@ -15,7 +13,7 @@
[assembly: AssemblyCopyright("Copyright © 2017 - 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
+
// 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
@@ -52,5 +50,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("4.5.0.0")]
-[assembly: AssemblyFileVersion("4.5.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]
diff --git a/WPFExample/Properties/Resources.Designer.cs b/WPFExample/Properties/Resources.Designer.cs
index f6de805..3bc5c06 100644
--- a/WPFExample/Properties/Resources.Designer.cs
+++ b/WPFExample/Properties/Resources.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace FinsembleWPFDemo.Properties {
+namespace WPFExample.Properties {
using System;
@@ -39,7 +39,7 @@ internal Resources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FinsembleWPFDemo.Properties.Resources", typeof(Resources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFExample.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
diff --git a/WPFExample/Properties/Settings.Designer.cs b/WPFExample/Properties/Settings.Designer.cs
index ac48264..f3fffa9 100644
--- a/WPFExample/Properties/Settings.Designer.cs
+++ b/WPFExample/Properties/Settings.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace FinsembleWPFDemo.Properties {
+namespace WPFExample.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
diff --git a/WPFExample/WPFExample.csproj b/WPFExample/WPFExample.csproj
index 485cf8d..1dd34a6 100644
--- a/WPFExample/WPFExample.csproj
+++ b/WPFExample/WPFExample.csproj
@@ -6,8 +6,8 @@
AnyCPU
{B6FB5104-A0EA-479A-8BFC-4DFE207CEB24}
WinExe
- FinsembleWPFDemo
- FinsembleWPFDemo
+ WPFExample
+ WPFExample
v4.5.2
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
@@ -89,8 +89,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
@@ -116,6 +116,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
diff --git a/WPFExample/packages.config b/WPFExample/packages.config
index 91a0366..3baf63b 100644
--- a/WPFExample/packages.config
+++ b/WPFExample/packages.config
@@ -3,13 +3,14 @@
-
+
+
diff --git a/WindowlessExample/App.config b/WindowlessExample/App.config
index cc8a54b..37f69cf 100644
--- a/WindowlessExample/App.config
+++ b/WindowlessExample/App.config
@@ -9,10 +9,6 @@
-
-
-
-
diff --git a/WindowlessExample/Properties/AssemblyInfo.cs b/WindowlessExample/Properties/AssemblyInfo.cs
index 65d38fe..d354f00 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("4.5.0.0")]
-[assembly: AssemblyFileVersion("4.5.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]
diff --git a/WindowlessExample/WindowlessExample.csproj b/WindowlessExample/WindowlessExample.csproj
index 3fde31a..b4680e0 100644
--- a/WindowlessExample/WindowlessExample.csproj
+++ b/WindowlessExample/WindowlessExample.csproj
@@ -89,8 +89,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
@@ -116,6 +116,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
diff --git a/WindowlessExample/packages.config b/WindowlessExample/packages.config
index 91a0366..3baf63b 100644
--- a/WindowlessExample/packages.config
+++ b/WindowlessExample/packages.config
@@ -3,13 +3,14 @@
-
+
+
diff --git a/WinformExample/FormExample.cs b/WinformExample/FormExample.cs
index 410b74c..d1decd4 100644
--- a/WinformExample/FormExample.cs
+++ b/WinformExample/FormExample.cs
@@ -5,15 +5,14 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Text;
+using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Threading;
namespace WinformExample
{
-
public partial class FormExample : Form
{
-
private SortedDictionary LinkerGroups = new SortedDictionary();
private System.Drawing.Text.PrivateFontCollection finfont = new System.Drawing.Text.PrivateFontCollection();
@@ -29,6 +28,11 @@ public FormExample(String[] args)
//connect to Finsemble
//Ensure that your window has been created (so that its window handle exists) before connecting to Finsemble.
FSBL = new Finsemble(args, this);
+
+ // Use handle
+ // FSBL = new Finsemble(args, this.Handle);
+ //----
+
FSBL.Connected += FinsembleConnected;
FSBL.Connect();
}
@@ -42,7 +46,7 @@ public FormExample(String[] args)
private void FinsembleConnected(object sender, EventArgs e)
{
- FSBL.RPC("Logger.log", new List { "Winform example connected to Finsemble." });
+ FSBL.Logger.Log(new JToken[] { "Winform example connected to Finsemble." });
System.Diagnostics.Debug.WriteLine("FSBL Ready.");
//setup linker channels
@@ -61,6 +65,7 @@ private void FinsembleConnected(object sender, EventArgs e)
// Example for Handling PubSub data
FSBL.RouterClient.Subscribe("Finsemble.TestWPFPubSubSymbol", handlePubSub);
+ // If you passed a window handle to initiate FSBL, you have to comment the following code to disable drag and drop function
// Example for handling Drag and Drop
finfont.AddFontFile(@"Resources\finfont.ttf");
var font = new System.Drawing.Font(finfont.Families[0], 100);
@@ -83,14 +88,11 @@ private void FinsembleConnected(object sender, EventArgs e)
// Example for getting Spawnable component list
FSBL.ConfigClient.GetValue(new JObject { ["field"] = "finsemble.components" }, handleComponentsList);
-
-
}
private void handleLinkerChannelLabels(object sender, FinsembleEventArgs args)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(() => {
if (args.error == null)
{
Label[] groupLabels = new Label[] { group1, group2, group3, group4, group5, group6 };
@@ -110,18 +112,17 @@ private void handleLinkerChannelLabels(object sender, FinsembleEventArgs args)
}
else
{
- FSBL.RPC("Logger.error", new List { "Error when retrieving linker channels: ", args.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when retrieving linker channels: ", args.error.ToString() });
}
- });
+ }));
}
private void handleLinkerStateChange(Object sender, FinsembleEventArgs response)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(() => {
if (response.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when receiving linker state change data: ", response.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when receiving linker state change data: ", response.error.ToString() });
}
else if (response.response != null)
{
@@ -138,13 +139,12 @@ private void handleLinkerStateChange(Object sender, FinsembleEventArgs response)
LinkerGroups[channel.Value.ToString()].Visible = true;
}
}
- });
+ }));
}
private void handleWindowGrouping(object s, FinsembleEventArgs res)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(() => {
if (res.error != null)
{
return;
@@ -152,7 +152,7 @@ private void handleWindowGrouping(object s, FinsembleEventArgs res)
else
{
JObject groupData = res.response["data"]["groupData"] as JObject;
- String currentWindowName = FSBL.WindowClient.windowIdentifier["windowName"].ToString();
+ String currentWindowName = FSBL.WindowClient.GetWindowIdentifier()["windowName"].ToString();
JObject thisWindowGroups = new JObject();
thisWindowGroups.Add("dockingGroup", "");
thisWindowGroups.Add("snappingGroup", "");
@@ -209,13 +209,12 @@ private void handleWindowGrouping(object s, FinsembleEventArgs res)
groupCb.Enabled = false;
}
}
- });
+ }));
}
private void handleGetComponentState(object s, FinsembleEventArgs state)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(() => {
if (state.response != null)
{
// Example for restoring state
@@ -243,17 +242,16 @@ private void handleGetComponentState(object s, FinsembleEventArgs state)
// Example for Handling Spawn data
FSBL.WindowClient.getSpawnData(handleSpawnData);
}
- });
+ }));
}
private void handleSpawnData(Object sender, FinsembleEventArgs res)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(async () => {
var receivedData = (JObject)res.response;
if (res.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when retrieving spawn data: ", res.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when retrieving spawn data: ", res.error.ToString() });
}
else if (res.response != null)
{
@@ -263,21 +261,20 @@ private void handleSpawnData(Object sender, FinsembleEventArgs res)
datavalue.Text = value.ToString();
input.Text = value.ToString();
datasource.Text = "via Spawndata";
- saveState();
+ await SaveStateAsync();
}
}
- });
+ }));
}
private void handlePubSub(object sender, FinsembleEventArgs state)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(async () => {
try
{
if (state.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when retrieving spawn data: ", state.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when retrieving spawn data: ", state.error.ToString() });
}
else if (state.response != null)
{
@@ -288,24 +285,23 @@ private void handlePubSub(object sender, FinsembleEventArgs state)
datavalue.Text = theData;
input.Text = theData;
datasource.Text = "via PubSub";
- saveState();
+ await SaveStateAsync();
}
}
}
catch (Exception ex)
{
- FSBL.RPC("Logger.error", new List { "Error when retrieving linker channels: ", ex.Message });
+ FSBL.Logger.Error(new JToken[] { "Error when retrieving linker channels: ", ex.Message });
}
- });
+ }));
}
private void handleDragAndDropReceive(object sender, FinsembleEventArgs args)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(async () => {
if (args.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when receiving drag and drop data: ", args.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when receiving drag and drop data: ", args.error.ToString() });
}
else if (args.response != null)
{
@@ -319,11 +315,11 @@ private void handleDragAndDropReceive(object sender, FinsembleEventArgs args)
datavalue.Text = data.ToString();
input.Text = data.ToString();
datasource.Text = "via Drag and Drop";
- saveState();
+ await SaveStateAsync();
}
}
}
- });
+ }));
}
private JObject handleDragAndDropEmit()
@@ -337,11 +333,10 @@ private JObject handleDragAndDropEmit()
private void handleLinkerData(object sender, FinsembleEventArgs response)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(async () => {
if (response.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when receiving linker data: ", response.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when receiving linker data: ", response.error.ToString() });
}
else if (response.response != null)
{
@@ -349,18 +344,17 @@ private void handleLinkerData(object sender, FinsembleEventArgs response)
datavalue.Text = value;
datasource.Text = "via Linker";
input.Text = value;
- saveState();
+ await SaveStateAsync();
}
- });
+ }));
}
private void handleComponentsList(Object sender, FinsembleEventArgs response)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(() => {
if (response.error != null)
{
- FSBL.RPC("Logger.error", new List { "Error when receiving spawnable component list: ", response.error.ToString() });
+ FSBL.Logger.Error(new JToken[] { "Error when receiving spawnable component list: ", response.error.ToString() });
}
else if (response.response != null)
{
@@ -374,31 +368,30 @@ private void handleComponentsList(Object sender, FinsembleEventArgs response)
}
}
}
- });
+ }));
}
private void handleKeyPresses(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Return)
{
- Dispatcher.CurrentDispatcher.Invoke((System.Windows.Forms.MethodInvoker)delegate //main thread
- {
+ this.Invoke(new Action(async () => {
datavalue.Text = input.Text;
datasource.Text = "via Text input";
- saveState();
- });
+ await SaveStateAsync();
+ }));
e.Handled = true;
}
}
// Example for saving component state
- private void saveState()
+ private async Task SaveStateAsync()
{
- FSBL.WindowClient.SetComponentState(new JObject
+ await FSBL.WindowClient.SetComponentState(new JObject
{
["field"] = "symbol",
["value"] = datavalue.Text
- }, delegate (object s, FinsembleEventArgs e) { });
+ });
}
// Example for publishing to RouterClient
diff --git a/WinformExample/Properties/AssemblyInfo.cs b/WinformExample/Properties/AssemblyInfo.cs
index 56afad6..3d8f11d 100644
--- a/WinformExample/Properties/AssemblyInfo.cs
+++ b/WinformExample/Properties/AssemblyInfo.cs
@@ -32,5 +32,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("4.5.0.0")]
-[assembly: AssemblyFileVersion("4.5.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.0.0.0")]
diff --git a/WinformExample/WinformExample.csproj b/WinformExample/WinformExample.csproj
index d7ce174..7da97c9 100644
--- a/WinformExample/WinformExample.csproj
+++ b/WinformExample/WinformExample.csproj
@@ -48,11 +48,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
-
-
- ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
@@ -75,6 +72,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
diff --git a/WinformExample/app.manifest b/WinformExample/app.manifest
index 0bbe6b5..48bfddf 100644
--- a/WinformExample/app.manifest
+++ b/WinformExample/app.manifest
@@ -1,6 +1,6 @@
-
+
diff --git a/WinformExample/packages.config b/WinformExample/packages.config
index 1a64808..09cac20 100644
--- a/WinformExample/packages.config
+++ b/WinformExample/packages.config
@@ -3,13 +3,14 @@
-
-
+
+
+
diff --git a/WinformMultiWindowExample/Properties/AssemblyInfo.cs b/WinformMultiWindowExample/Properties/AssemblyInfo.cs
index e45ff80..04cbf1a 100644
--- a/WinformMultiWindowExample/Properties/AssemblyInfo.cs
+++ b/WinformMultiWindowExample/Properties/AssemblyInfo.cs
@@ -32,5 +32,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("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]
diff --git a/WinformMultiWindowExample/WinformMultiWindowExample.csproj b/WinformMultiWindowExample/WinformMultiWindowExample.csproj
index 2231f53..9c88a6c 100644
--- a/WinformMultiWindowExample/WinformMultiWindowExample.csproj
+++ b/WinformMultiWindowExample/WinformMultiWindowExample.csproj
@@ -48,8 +48,8 @@
..\packages\EventHook.1.4.105\lib\net45\EventHook.dll
-
- ..\packages\Finsemble.4.5.0\lib\net452\Finsemble.dll
+
+ ..\packages\Finsemble.5.2.0\lib\net452\Finsemble.dll
..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
@@ -76,6 +76,9 @@
..\packages\Nito.AsyncEx.4.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll
+
+ ..\packages\PInvoke.Windows.Core.0.6.49\lib\net20\PInvoke.Windows.Core.dll
+
..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll
diff --git a/WinformMultiWindowExample/app.manifest b/WinformMultiWindowExample/app.manifest
index c65a481..ff38f9b 100644
--- a/WinformMultiWindowExample/app.manifest
+++ b/WinformMultiWindowExample/app.manifest
@@ -1,6 +1,6 @@
-
+
diff --git a/WinformMultiWindowExample/packages.config b/WinformMultiWindowExample/packages.config
index 91a0366..3baf63b 100644
--- a/WinformMultiWindowExample/packages.config
+++ b/WinformMultiWindowExample/packages.config
@@ -3,13 +3,14 @@
-
+
+
diff --git a/wpfExample.json b/wpfExample.json
index f35701a..e56e368 100644
--- a/wpfExample.json
+++ b/wpfExample.json
@@ -19,7 +19,8 @@
}
},
"component": {
- "spawnOnStartup": false
+ "spawnOnStartup": false,
+ "useFdc3": false
},
"foreign": {
"services": {
@@ -42,4 +43,4 @@
}
}
}
-}
\ No newline at end of file
+}