diff --git a/AuthenticationExample/AuthenticationExample.csproj b/AuthenticationExample/AuthenticationExample.csproj index 7b36cfa..baf260c 100644 --- a/AuthenticationExample/AuthenticationExample.csproj +++ b/AuthenticationExample/AuthenticationExample.csproj @@ -14,21 +14,6 @@ 4 true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true @@ -72,8 +57,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll @@ -177,18 +162,6 @@ - - - False - Microsoft .NET Framework 4.5.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - diff --git a/AuthenticationExample/Properties/AssemblyInfo.cs b/AuthenticationExample/Properties/AssemblyInfo.cs index 74aa330..982086d 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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/AuthenticationExample/packages.config b/AuthenticationExample/packages.config index 98a5b6b..028abcf 100644 --- a/AuthenticationExample/packages.config +++ b/AuthenticationExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/FDC3WPFExample/DefaultData.cs b/FDC3WPFExample/DefaultData.cs new file mode 100644 index 0000000..6f76706 --- /dev/null +++ b/FDC3WPFExample/DefaultData.cs @@ -0,0 +1,167 @@ +using ChartIQ.Finsemble.FDC3.Types; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; + +namespace FDC3WPFExample +{ + public static class DefaultData + { + public static Dictionary DefaultContexts = new Dictionary() + { + {"fdc3.contact", new Context(new JObject + { + ["type"] = "fdc3.contact", + ["name"] = "Jane Doe", + ["id"] = new JObject + { + ["email"] = "jane.doe@mail.com" + } + } + )}, + {"fdc3.contactList", new Context(new JObject + { + ["type"] = "fdc3.contactList", + ["contacts"] = new JArray + { + new JObject + { + ["type"] = "fdc3.contact", + ["name"] = "Jane Doe", + ["id"] = new JObject + { + ["email"] = "jane.doe@mail.com" + } + }, + new JObject + { + ["type"] = "fdc3.contact", + ["name"] = "John Doe", + ["id"] = new JObject + { + ["email"] = "john.doe@mail.com" + } + } + } + } + )}, + {"fdc3.instrument", new Context(new JObject + { + ["type"] = "fdc3.instrument", + ["name"] = "Microsoft", + ["id"] = new JObject + { + ["ticker"] = "MSFT", + ["RIC"] = "MSFT.OQ", + ["ISIN"] = "US5949181045" + } + } + )}, + {"fdc3.instrumentList", new Context(new JObject + { + ["type"] = "fdc3.instrumentList", + ["instruments"] = new JArray + { + new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "AAPL" + } + }, + new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "MSFT" + } + } + } + } + )}, + {"fdc3.organization", new Context(new JObject + { + ["type"] = "fdc3.organization", + ["name"] = "Cargill, Incorporated", + ["id"] = new JObject + { + ["LEI"] = "QXZYQNMR4JZ5RIRN4T31", + ["FDS_ID"] = "00161G-E" + } + } + )}, + {"fdc3.country", new Context(new JObject + { + ["type"] = "fdc3.country", + ["name"] = "Sweden", + ["id"] = new JObject + { + ["ISOALPHA3"] = "SWE" + } + } + )}, + {"fdc3.position", new Context(new JObject + { + ["type"] = "fdc3.position", + ["instrument"] = new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "AAPL" + } + }, + ["holding"] = 2000000 + } + )}, + {"fdc3.portfolio", new Context(new JObject + { + ["type"] = "fdc3.portfolio", + ["positions"] = new JArray + { + new JObject + { + ["type"] = "fdc3.position", + ["instrument"] = new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "AAPL" + } + }, + ["holding"] = 2000000 + }, + new JObject + { + ["type"] = "fdc3.position", + ["instrument"] = new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "MSFT" + } + }, + ["holding"] = 1500000 + }, + new JObject + { + ["type"] = "fdc3.position", + ["instrument"] = new JObject + { + ["type"] = "fdc3.instrument", + ["id"] = new JObject + { + ["ticker"] = "IBM" + } + }, + ["holding"] = 3000000 + } + } + } + )}, + }; + } +} diff --git a/FDC3WPFExample/FDC3WPFExample.csproj b/FDC3WPFExample/FDC3WPFExample.csproj index b611311..95d0ba6 100644 --- a/FDC3WPFExample/FDC3WPFExample.csproj +++ b/FDC3WPFExample/FDC3WPFExample.csproj @@ -57,8 +57,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll diff --git a/FDC3WPFExample/Properties/AssemblyInfo.cs b/FDC3WPFExample/Properties/AssemblyInfo.cs index 334c1c8..fa2d1ef 100644 --- a/FDC3WPFExample/Properties/AssemblyInfo.cs +++ b/FDC3WPFExample/Properties/AssemblyInfo.cs @@ -49,5 +49,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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/FDC3WPFExample/packages.config b/FDC3WPFExample/packages.config index 98a5b6b..028abcf 100644 --- a/FDC3WPFExample/packages.config +++ b/FDC3WPFExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/FreestandingWPFExample/FreestandingWPFExample.csproj b/FreestandingWPFExample/FreestandingWPFExample.csproj index 4b39b0b..560af6a 100644 --- a/FreestandingWPFExample/FreestandingWPFExample.csproj +++ b/FreestandingWPFExample/FreestandingWPFExample.csproj @@ -5,9 +5,9 @@ net5.0-windows true AnyCPU;x64 - 6.6.0.0 - 6.6.0.0 - 6.6.0 + 6.6.3.0 + 6.6.3.0 + 6.6.3 diff --git a/MultiWindowExample/MultiWindowExample.csproj b/MultiWindowExample/MultiWindowExample.csproj index 74222f7..5d8bdc0 100644 --- a/MultiWindowExample/MultiWindowExample.csproj +++ b/MultiWindowExample/MultiWindowExample.csproj @@ -57,8 +57,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll diff --git a/MultiWindowExample/Properties/AssemblyInfo.cs b/MultiWindowExample/Properties/AssemblyInfo.cs index 726913c..e8e1646 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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/MultiWindowExample/packages.config b/MultiWindowExample/packages.config index 98a5b6b..028abcf 100644 --- a/MultiWindowExample/packages.config +++ b/MultiWindowExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WPFExample/Properties/AssemblyInfo.cs b/WPFExample/Properties/AssemblyInfo.cs index f574271..dfe7b81 100644 --- a/WPFExample/Properties/AssemblyInfo.cs +++ b/WPFExample/Properties/AssemblyInfo.cs @@ -49,5 +49,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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/WPFExample/WPFExample.csproj b/WPFExample/WPFExample.csproj index 97d42f4..6f3a4d5 100644 --- a/WPFExample/WPFExample.csproj +++ b/WPFExample/WPFExample.csproj @@ -57,8 +57,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll diff --git a/WPFExample/packages.config b/WPFExample/packages.config index 98a5b6b..028abcf 100644 --- a/WPFExample/packages.config +++ b/WPFExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WPFExampleCore/WPFExampleCore.csproj b/WPFExampleCore/WPFExampleCore.csproj index e5f637e..2e69ccc 100644 --- a/WPFExampleCore/WPFExampleCore.csproj +++ b/WPFExampleCore/WPFExampleCore.csproj @@ -5,7 +5,7 @@ net5.0-windows true AnyCPU;x64 - 6.6.0 + 6.6.3 @@ -13,7 +13,7 @@ - + diff --git a/WPFMultiWindowExampleCore/WPFMultiWindowExampleCore.csproj b/WPFMultiWindowExampleCore/WPFMultiWindowExampleCore.csproj index fc99ef2..5a32caa 100644 --- a/WPFMultiWindowExampleCore/WPFMultiWindowExampleCore.csproj +++ b/WPFMultiWindowExampleCore/WPFMultiWindowExampleCore.csproj @@ -6,11 +6,11 @@ true WPFMultiWindowExampleCore.AppStartup AnyCPU;x64 - 6.6.0 + 6.6.3 - + diff --git a/WindowlessExample.Core/WindowlessExample.Core.csproj b/WindowlessExample.Core/WindowlessExample.Core.csproj index 36b0fad..3ec988f 100644 --- a/WindowlessExample.Core/WindowlessExample.Core.csproj +++ b/WindowlessExample.Core/WindowlessExample.Core.csproj @@ -1,14 +1,14 @@ - + WinExe net5.0 AnyCPU;x64 - 6.6.0 + 6.6.3 - + diff --git a/WindowlessExample/Properties/AssemblyInfo.cs b/WindowlessExample/Properties/AssemblyInfo.cs index f1566df..a1d5b14 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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/WindowlessExample/WindowlessExample.csproj b/WindowlessExample/WindowlessExample.csproj index a03addb..0165345 100644 --- a/WindowlessExample/WindowlessExample.csproj +++ b/WindowlessExample/WindowlessExample.csproj @@ -57,8 +57,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll diff --git a/WindowlessExample/packages.config b/WindowlessExample/packages.config index 98a5b6b..028abcf 100644 --- a/WindowlessExample/packages.config +++ b/WindowlessExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WinformExample/Properties/AssemblyInfo.cs b/WinformExample/Properties/AssemblyInfo.cs index 500c363..a1905d1 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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/WinformExample/WinformExample.csproj b/WinformExample/WinformExample.csproj index 7c1b556..cc1e9fa 100644 --- a/WinformExample/WinformExample.csproj +++ b/WinformExample/WinformExample.csproj @@ -56,8 +56,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll diff --git a/WinformExample/packages.config b/WinformExample/packages.config index c0966e3..61c9ec2 100644 --- a/WinformExample/packages.config +++ b/WinformExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WinformExampleCore/MainForm.cs b/WinformExampleCore/MainForm.cs index c17a01a..5b543ff 100644 --- a/WinformExampleCore/MainForm.cs +++ b/WinformExampleCore/MainForm.cs @@ -73,18 +73,38 @@ private async void Finsemble_Connected(object sender, EventArgs e) _bridge.Clients.RouterClient.Subscribe("Finsemble.WorkspaceService.groupUpdate", HandleWindowGrouping); #region FDC3 - //Setup channels - var systemChannels = await _bridge.Clients.Fdc3Client.DesktopAgentClient.GetSystemChannels(); - SetUpLinkerChannels(systemChannels); - // Listen to Fdc3Client state change to render connected channels - _bridge.Clients.Fdc3Client.StateChanged += Fdc3Client_StateChanged; ; - // Show joined channels - Fdc3Client_StateChanged(null, _bridge.Clients.Fdc3Client.LastStateChangedArgs); + if (_bridge.Clients.Fdc3Client != null) + { + //Setup channels + var systemChannels = await _bridge.Clients.Fdc3Client.DesktopAgentClient.GetSystemChannels(); + SetUpLinkerChannels(systemChannels); + + // Listen to Fdc3Client state change to render connected channels + _bridge.Clients.Fdc3Client.StateChanged += Fdc3Client_StateChanged; ; + // Show joined channels + Fdc3Client_StateChanged(null, _bridge.Clients.Fdc3Client.LastStateChangedArgs); + + // Example for Fdc3Client subscribe to specific context. The "*" for subscription to all contexts. + _contextListenter = _bridge.Clients.Fdc3Client.DesktopAgentClient.AddContextListener("fdc3.instrument", HandleContext); + } + + #endregion + + #region Linker Client + + if (_bridge.Clients.LinkerClient != null) + { + //setup linker channels + _bridge.Clients.LinkerClient.GetAllChannels(HandleLinkerChannelLabels); + + // Listen to Linker state change to render connected channels + _bridge.Clients.LinkerClient.OnStateChange(Fdc3Client_StateChanged); + + // Example for LinkerClient subscribe + _bridge.Clients.LinkerClient.Subscribe("symbol", HandleLinkerData); + } - // Example for Fdc3Client subscribe to specific context. The "*" for subscription to all contexts. - _contextListenter = _bridge.Clients.Fdc3Client.DesktopAgentClient.AddContextListener("fdc3.instrument", HandleContext); - #endregion //Example for Handling PubSub data @@ -239,6 +259,52 @@ private async void HandleComponentsList() _bridge.Clients.Logger.Error(new JToken[] { "Error when receiving spawnable component list: ", ex.ToString() }); } } + private void HandleLinkerChannelLabels(object sender, FinsembleEventArgs args) + { + this.Invoke(new Action(() => + { + if (args.error == null) + { + var groupLabels = new Button[] { GroupButton1, GroupButton2, GroupButton3, GroupButton4, GroupButton5, GroupButton6 }; + var allChannels = args.response as JArray; + int labelcount = 0; + foreach (JObject item in allChannels) + { + var theLabel = groupLabels[labelcount++]; + theLabel.Visible = false; + if (!LinkerGroups.ContainsKey(item["name"].ToString())) + LinkerGroups.Add(item["name"].ToString(), theLabel); + //limit channels to ones we enough labels for + if (labelcount == groupLabels.Length) + { + break; + } + } + } + else + { + _bridge.Clients.Logger.Error(new JToken[] { "Error when retrieving linker channels: ", args.error.ToString() }); + } + })); + } + + private void HandleLinkerData(object sender, FinsembleEventArgs response) + { + this.Invoke(new Action(() => + { + if (response.error != null) + { + _bridge.Clients.Logger.Error(new JToken[] { "Error when receiving linker data: ", response.error.ToString() }); + } + else if (response.response != null) + { + string value = response.response?["data"]?.ToString(); + DataLabel.Text = value; + SourceLabel.Text = "via Linker"; + DataToSendInput.Text = value; + } + })); + } private void HandleContext(Context context) { @@ -459,21 +525,39 @@ private void LoadAndSetButtonsFont() private void LinkerButton_Click(object sender, EventArgs e) { - _bridge.Clients.Util.OpenLinkerWindow(); + if (_bridge.Clients.LinkerClient != null) + { + _bridge.Clients.LinkerClient.OpenLinkerWindow(); + } + else + { + _bridge.Clients.Util.OpenLinkerWindow(); + } } private void SendButton_Click(object sender, EventArgs e) { - var param = new JObject + if (_bridge.Clients.LinkerClient != null) { - ["type"] = "fdc3.instrument", - ["name"] = DataToSendInput.Text, - ["id"] = new JObject + _bridge.Clients.LinkerClient.Publish(new JObject { - ["ticker"] = DataToSendInput.Text - } - }; - _bridge.Clients.Fdc3Client.DesktopAgentClient.Broadcast(new Context(param)); + ["dataType"] = "symbol", + ["data"] = DataToSendInput.Text + }); + } + else + { + var param = new JObject + { + ["type"] = "fdc3.instrument", + ["name"] = DataToSendInput.Text, + ["id"] = new JObject + { + ["ticker"] = DataToSendInput.Text + } + }; + _bridge.Clients.Fdc3Client.DesktopAgentClient.Broadcast(new Context(param)); + } } private void UpdateAlwaysOnTopButton(bool isAlwaysOnTop) diff --git a/WinformExampleCore/WinformExampleCore.csproj b/WinformExampleCore/WinformExampleCore.csproj index 3d0ce32..a1cdb3d 100644 --- a/WinformExampleCore/WinformExampleCore.csproj +++ b/WinformExampleCore/WinformExampleCore.csproj @@ -5,7 +5,7 @@ net5.0-windows true AnyCPU;x64 - 6.6.0 + 6.6.3 @@ -23,7 +23,7 @@ - + diff --git a/WinformMultiWindowExample/Properties/AssemblyInfo.cs b/WinformMultiWindowExample/Properties/AssemblyInfo.cs index dea527a..3315191 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("6.6.0.0")] -[assembly: AssemblyFileVersion("6.6.0.0")] +[assembly: AssemblyVersion("6.6.3.0")] +[assembly: AssemblyFileVersion("6.6.3.0")] diff --git a/WinformMultiWindowExample/WinformMultiWindowExample.csproj b/WinformMultiWindowExample/WinformMultiWindowExample.csproj index aea5a94..076f253 100644 --- a/WinformMultiWindowExample/WinformMultiWindowExample.csproj +++ b/WinformMultiWindowExample/WinformMultiWindowExample.csproj @@ -56,8 +56,8 @@ ..\packages\EventHook.1.4.105\lib\net45\EventHook.dll - - ..\packages\Finsemble.6.6.0\lib\net452\Finsemble.dll + + ..\packages\Finsemble.6.6.3\lib\net452\Finsemble.dll ..\packages\Microsoft.IdentityModel.Logging.6.12.1\lib\net45\Microsoft.IdentityModel.Logging.dll diff --git a/WinformMultiWindowExample/packages.config b/WinformMultiWindowExample/packages.config index 98a5b6b..028abcf 100644 --- a/WinformMultiWindowExample/packages.config +++ b/WinformMultiWindowExample/packages.config @@ -3,7 +3,7 @@ - + diff --git a/WinformMultiWindowExampleCore/WinformMultiWindowExampleCore.csproj b/WinformMultiWindowExampleCore/WinformMultiWindowExampleCore.csproj index 02aadef..5ca246b 100644 --- a/WinformMultiWindowExampleCore/WinformMultiWindowExampleCore.csproj +++ b/WinformMultiWindowExampleCore/WinformMultiWindowExampleCore.csproj @@ -5,11 +5,11 @@ net5.0-windows true AnyCPU;x64 - 6.6.0 + 6.6.3 - +