diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/ComposeUI.Example.DataService.csproj b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/ComposeUI.Example.DataService.csproj
deleted file mode 100644
index c92fdc966..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/ComposeUI.Example.DataService.csproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- Exe
- net6.0
- enable
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesData.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesData.cs
deleted file mode 100644
index bf8fd68d8..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesData.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-namespace ComposeUI.Example.DataService
-{
- internal class MonthlySalesData
- {
- internal static Dictionary MyList { get; } = new Dictionary()
- {
- ["IBM"] = new()
- {
- Symbol = "IBM",
- Buy = new int[] { 49, 71, 106, 129, 144, 63, 89, 15, 203, 58, 115, 32 },
- Sell = new int[] { 83, 78, 98, 93, 106, 82, 45, 305, 263, 33, 112, 87 }
- },
- ["AAPL"] = new()
- {
- Symbol = "AAPL",
- Buy = new int[] { 18, 49, 62, 110, 134, 162, 166, 210, 215, 277, 290, 297 },
- Sell = new int[] { 62, 93, 114, 140, 150, 161, 191, 206, 224, 255, 286, 295 }
- },
- ["TSLA"] = new()
- {
- Symbol = "TSLA",
- Buy = new int[] { 33, 93, 124, 177, 187, 210, 225, 234, 236, 247, 250, 282 },
- Sell = new int[] { 33, 62, 64, 94, 124, 166, 186, 191, 225, 247, 267, 294 }
- },
- ["SMSN"] = new()
- {
- Symbol = "SMSN",
- Buy = new int[] { 14, 25, 73, 84, 138, 155, 181, 195, 200, 209, 231, 254 },
- Sell = new int[] { 30, 37, 67, 86, 182, 199, 219, 225, 238, 245, 250, 262 }
- },
- ["GOOG"] = new()
- {
- Symbol = "GOOG",
- Buy = new int[] { 25, 42, 43, 175, 189, 190, 201, 218, 223, 231, 263, 284 },
- Sell = new int[] { 28, 29, 57, 109, 129, 184, 196, 224, 230, 259, 277, 278 }
- }
- };
- }
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataModel.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataModel.cs
deleted file mode 100644
index 9216f2244..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataModel.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace ComposeUI.Example.DataService
-{
- [Serializable]
- internal sealed class MonthlySalesDataModel
- {
- public string Symbol { get; set; } = string.Empty;
- public int[]? Buy { get; set; }
- public int[]? Sell { get; set; }
-
- public static JsonSerializerOptions JsonSerializerOptions = new()
- {
- Converters =
- {
- new JsonStringEnumConverter()
- },
- PropertyNamingPolicy = JsonNamingPolicy.CamelCase
- };
- }
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataService.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataService.cs
deleted file mode 100644
index 21e5c7330..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/MonthlySalesDataService.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System.Reactive;
-using System.Reactive.Linq;
-using Microsoft.Extensions.Logging;
-using MorganStanley.ComposeUI.Messaging;
-
-namespace ComposeUI.Example.DataService
-{
- internal class MonthlySalesDataService : IAsyncDisposable
- {
- private readonly IMessageRouter _messageRouter;
- private readonly ILogger? _logger;
- private readonly List _subscriptions = new();
-
- public MonthlySalesDataService(IMessageRouter messageRouter, ILogger? logger = null)
- {
- _messageRouter = messageRouter;
- _logger = logger;
- }
-
- public async Task Start()
- {
- _logger?.LogInformation("Start");
-
- try
- {
- _subscriptions.Add(
- await _messageRouter.SubscribeAsync(
- "proto_select_marketData",
- AsyncObserver.Create(OnSymbolSelected, OnSymbolSelectionError, () => default)));
- }
- catch (Exception exception)
- {
- _logger?.LogError(exception, exception.Message);
- }
- }
-
- private async ValueTask OnSymbolSelected(TopicMessage message)
- {
- var payload = message.Payload;
-
- _logger?.LogInformation("Message {payload}", payload?.GetString());
-
- if (payload != null)
- {
- var selected = payload.ReadJson(MonthlySalesDataModel.JsonSerializerOptions);
-
- if (selected != null)
- {
- var toPublish = MonthlySalesData.MyList[selected.Symbol];
-
- try
- {
- await _messageRouter.PublishJsonAsync(
- "proto_select_monthlySales",
- toPublish,
- MonthlySalesDataModel.JsonSerializerOptions);
- }
- catch (Exception exception)
- {
- _logger?.LogError(exception.ToString());
- }
- }
- }
- }
-
- private ValueTask OnSymbolSelectionError(Exception exception)
- {
- _logger?.LogError(exception, exception.Message);
-
- return default;
- }
-
- public ValueTask DisposeAsync()
- {
- return new ValueTask(
- Task.WhenAll(
- _subscriptions.Select(x => x.DisposeAsync().AsTask())));
- }
-
- private class SymbolSelectedModel
- {
- public string Symbol { get; set; } = null!;
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/Program.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/Program.cs
deleted file mode 100644
index 44a45d544..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.DataService/Program.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using MorganStanley.ComposeUI.Messaging.Client.WebSocket;
-
-namespace ComposeUI.Example.DataService;
-
-class Program
-{
- public static Uri WebsocketUri = new("ws://localhost:5000/ws");
-
- public static async Task Main()
- {
- Console.WriteLine("Data Service");
-
- ServiceCollection serviceCollection = new();
-
- serviceCollection
- .AddMessageRouter(
- mr => mr.UseWebSocket(
- new MessageRouterWebSocketOptions
- {
- Uri = WebsocketUri
- }))
- .AddLogging(
- builder => builder.AddConsole())
- .AddSingleton();
-
- var serviceProvider = serviceCollection.BuildServiceProvider();
- var monthlySalesDataService = serviceProvider.GetRequiredService();
- await monthlySalesDataService.Start();
-
- var stopTaskSource = new TaskCompletionSource();
-
- Console.CancelKeyPress += (sender, args) =>
- {
- stopTaskSource.SetResult();
- args.Cancel = true;
- };
-
- await stopTaskSource.Task;
-
- Console.WriteLine("Exiting");
-
- await serviceProvider.DisposeAsync();
-
- Console.WriteLine("Done");
- }
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml
deleted file mode 100644
index ee5538a66..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml.cs
deleted file mode 100644
index 22b053f72..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/App.xaml.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-// Morgan Stanley makes this available to you under the Apache License,
-// Version 2.0 (the "License"). You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0.
-//
-// See the NOTICE file distributed with this work for additional information
-// regarding copyright ownership. Unless required by applicable law or agreed
-// to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions
-// and limitations under the License.
-
-using WPFDataGrid.Views;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Serilog;
-using System;
-using System.IO;
-using System.Linq;
-using System.Windows;
-using MorganStanley.ComposeUI.Messaging.Client.WebSocket;
-using System.Collections.Generic;
-
-namespace WPFDataGrid.TestApp;
-
-///
-/// Interaction logic for App.xaml
-///
-public partial class App : Application
-{
- private IServiceProvider? _serviceProvider;
-
- ///
- /// Url to connect
- ///
- public static Uri WebsocketURI { get; set; } = new("ws://localhost:5000/ws");
-
- ///
- /// Overriding Statup so we can do DI.
- ///
- ///
- protected override void OnStartup(StartupEventArgs e)
- {
- ServiceCollection serviceCollection = new();
-
- base.OnStartup(e);
-
- if (e.Args.Any() && Uri.TryCreate(e.Args[0], UriKind.Absolute, out Uri? uri))
- {
- WebsocketURI = uri;
- }
-
- var serilogger = new LoggerConfiguration()
- .WriteTo.File($"{Directory.GetCurrentDirectory()}/log.log")
- .CreateLogger();
-
- serviceCollection
- .AddLogging(
- builder =>
- {
- builder.AddSerilog(serilogger);
- })
- .AddMessageRouter(
- mr =>
- mr.UseWebSocket(new MessageRouterWebSocketOptions { Uri = WebsocketURI }));
-
- serviceCollection.AddSingleton(typeof(DataGridView));
-
- _serviceProvider = serviceCollection.BuildServiceProvider();
-
- var dataGridView = _serviceProvider?.GetRequiredService();
-
- dataGridView?.Show();
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/AssemblyInfo.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/AssemblyInfo.cs
deleted file mode 100644
index 8b5504ecf..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/AssemblyInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Windows;
-
-[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)
-)]
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/WPFDataGrid.TestApp.csproj b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/WPFDataGrid.TestApp.csproj
deleted file mode 100644
index 8979f73a9..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid.TestApp/WPFDataGrid.TestApp.csproj
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- WinExe
- net6.0-windows
- enable
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/MarketDataAccess.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/MarketDataAccess.cs
deleted file mode 100644
index 77a523329..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/MarketDataAccess.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System.Collections.Generic;
-using WPFDataGrid.Models;
-
-namespace WPFDataGrid;
-
-///
-/// Initializes the data for the DataGrid.
-///
-internal static class MarketDataAccess
-{
- //TODO(Lilla): Get the messages from dataService
- internal static IReadOnlyCollection MarketData { get; } = new List
- {
- new() { Fullname = "Google", Symbol = "GOOG", Amount = 2500, AverageProfit = 18643, SymbolRating = SymbolRating.Long },
- new() { Fullname = "Apple", Symbol = "AAPL", Amount = 549, AverageProfit = 54345, SymbolRating = SymbolRating.Short },
- new() { Fullname = "Apple", Symbol = "AAPL", Amount = 1000, AverageProfit = 152968, SymbolRating = SymbolRating.Long },
- new() { Fullname = "Google", Symbol = "GOOG", Amount = 4897, AverageProfit = 1234, SymbolRating = SymbolRating.Short },
- new() { Fullname = "IBM", Symbol = "IBM", Amount = 6543, AverageProfit = 65496, SymbolRating = SymbolRating.Long },
- new() { Fullname = "IBM", Symbol = "IBM", Amount = 7894, AverageProfit = 464332, SymbolRating = SymbolRating.Short },
- new() { Fullname = "Samsung Electronics Co Ltd", Symbol = "SMSN", Amount = 9872, AverageProfit = 156313, SymbolRating = SymbolRating.Long },
- new() { Fullname = "Samsung Electronics Co Ltd", Symbol = "SMSN", Amount = 1234, AverageProfit = 789465, SymbolRating = SymbolRating.Short },
- new() { Fullname = "Tesla", Symbol = "TSLA", Amount = 45678, AverageProfit = 978546, SymbolRating = SymbolRating.Long },
- new() { Fullname = "Tesla", Symbol = "TSLA", Amount = 65478, AverageProfit = 987877, SymbolRating = SymbolRating.Short }
- };
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolModel.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolModel.cs
deleted file mode 100644
index f694faa1e..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolModel.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace WPFDataGrid.Models;
-
-///
-/// Model for symbol. We can show the short and long market of the product. (The amount of the symbolRating's trading, the avarage profit of the stock's position)
-/// For now we are just sending the symbol name.
-///
-[Serializable]
-public sealed class SymbolModel
-{
- ///
- /// Name for the symbol.
- ///
- public string Symbol { get; set; } = string.Empty;
-
- ///
- /// Fullname of the symbol.
- ///
-
- [JsonIgnore]
- public string Fullname { get; set; } = string.Empty;
-
- ///
- /// Price of the symbol for the rating.
- ///
- [JsonIgnore]
- public decimal AverageProfit { get; set; }
-
- ///
- /// Count of the symbol.
- ///
- [JsonIgnore]
- public double Amount { get; set; }
-
- ///
- /// Rating/type of the symbol. (LONG/SHORT)
- ///
- [JsonIgnore]
- [JsonConverter(typeof(JsonStringEnumConverter))]
- public SymbolRating SymbolRating { get; set; }
-
- ///
- /// Gets a JsonSerializableOptions, which contains EnumConverter
- ///
- public static JsonSerializerOptions JsonSerializerOptions = new()
- {
- Converters =
- {
- new JsonStringEnumConverter()
- },
- PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
- };
-}
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolRating.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolRating.cs
deleted file mode 100644
index 4f73cee56..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Models/SymbolRating.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System.ComponentModel;
-
-namespace WPFDataGrid.Models
-{
- ///
- /// Rating/type of the symbol.
- ///
- public enum SymbolRating
- {
- ///
- /// Description for financial short: we want to sell our product on the public market with actual market price.
- ///
- [Description("Short")]
- Short,
-
- ///
- /// Description for financial long: we want to buy product on the public market with actual market price, and we are hoping for this price to increase so we can make profit from them.
- ///
- [Description("Long")]
- Long
- }
-}
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Theme/Style.xaml b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Theme/Style.xaml
deleted file mode 100644
index 519e568a4..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Theme/Style.xaml
+++ /dev/null
@@ -1,802 +0,0 @@
-
-
-
-
-
-
-
-
-
- #506477
- #506477
- #135e98
- #506477
- #506477
- #135e98
- #EFEFEF
- #1D7874
- #525252
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- M3.5445026,0 L7.0890052,7.0890053 L3.0459049E-09,7.0890053 z
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml
deleted file mode 100644
index 51f04a916..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml.cs
deleted file mode 100644
index 289865238..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/Views/DataGridView.xaml.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// /*
-// * Morgan Stanley makes this available to you under the Apache License,
-// * Version 2.0 (the "License"). You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0.
-// *
-// * See the NOTICE file distributed with this work for additional information
-// * regarding copyright ownership. Unless required by applicable law or agreed
-// * to in writing, software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// * or implied. See the License for the specific language governing permissions
-// * and limitations under the License.
-// */
-
-using System;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Windows;
-using System.Windows.Controls;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Logging.Abstractions;
-using MorganStanley.ComposeUI.Messaging;
-using WPFDataGrid.Models;
-
-namespace WPFDataGrid.Views;
-
-///
-/// Interaction logic for ShellView.xaml
-///
-public partial class DataGridView : Window
-{
- private readonly ILogger _logger;
- private readonly IMessageRouter _messageRouter;
- private readonly ObservableCollection _symbols;
-
- ///
- /// Constructor for the View.
- ///
- ///
- ///
- public DataGridView(
- ILogger? logger,
- IMessageRouter messageRouter)
- {
- _logger = logger ?? NullLogger.Instance;
- _messageRouter = messageRouter;
- _symbols = new(MarketDataAccess.MarketData);
- InitializeComponent();
- }
-
- private async void Window_Loaded(object sender, RoutedEventArgs e)
- {
- MyDataGridMarketData.ItemsSource = _symbols;
- }
-
- private async void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- try
- {
- var selectedObject = e.AddedItems.Cast().FirstOrDefault();
-
- if (selectedObject != null)
- {
- _logger.LogInformation(string.Format("You have selected: {0}", selectedObject.Fullname));
- await _messageRouter.PublishJsonAsync("proto_select_marketData", selectedObject, SymbolModel.JsonSerializerOptions);
- }
- }
- catch (Exception exception)
- {
- _logger.LogError(exception.ToString());
- }
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/WPFDataGrid.csproj b/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/WPFDataGrid.csproj
deleted file mode 100644
index bbfd81b9c..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ComposeUI.Example.WPFDataGrid/WPFDataGrid.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- net6.0-windows
- enable
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln
deleted file mode 100644
index 44fd85e29..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln
+++ /dev/null
@@ -1,74 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.32112.339
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesPrototype", "ModulesPrototype\ModulesPrototype.csproj", "{49279A6F-C9BC-4EFF-BBBB-72789599A46C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ModuleLoader", "..\..\src\module-loader\dotnet\ModuleLoader\MorganStanley.ComposeUI.ModuleLoader.csproj", "{2D16F7EF-D833-4D9C-90C0-C633F8E33A2B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.Messaging.Server", "..\..\..\..\src\messaging\dotnet\src\Server\MorganStanley.ComposeUI.Messaging.Server.csproj", "{6019D5A5-3D0C-4A30-8025-B8F30050BEB6}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.Messaging.Core", "..\..\..\..\src\messaging\dotnet\src\Core\MorganStanley.ComposeUI.Messaging.Core.csproj", "{11D505AF-310E-4536-A6DA-3E8DB053D1D6}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.Messaging.Client", "..\..\..\..\src\messaging\dotnet\src\Client\MorganStanley.ComposeUI.Messaging.Client.csproj", "{47CA77F0-3D59-47A6-AE1F-A2BAE2F72222}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComposeUI.Example.DataService", "ComposeUI.Example.DataService\ComposeUI.Example.DataService.csproj", "{C20FA602-71E5-4383-8F8F-B966873EFA69}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDataGrid", "ComposeUI.Example.WPFDataGrid\WPFDataGrid.csproj", "{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{E761C6B7-625B-47D8-811B-A67B3E7221D5}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDataGrid.TestApp", "ComposeUI.Example.WPFDataGrid.TestApp\WPFDataGrid.TestApp.csproj", "{DC7886A9-7639-4748-8FAE-D208672BAEB9}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {49279A6F-C9BC-4EFF-BBBB-72789599A46C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49279A6F-C9BC-4EFF-BBBB-72789599A46C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49279A6F-C9BC-4EFF-BBBB-72789599A46C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49279A6F-C9BC-4EFF-BBBB-72789599A46C}.Release|Any CPU.Build.0 = Release|Any CPU
- {2D16F7EF-D833-4D9C-90C0-C633F8E33A2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2D16F7EF-D833-4D9C-90C0-C633F8E33A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2D16F7EF-D833-4D9C-90C0-C633F8E33A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2D16F7EF-D833-4D9C-90C0-C633F8E33A2B}.Release|Any CPU.Build.0 = Release|Any CPU
- {6019D5A5-3D0C-4A30-8025-B8F30050BEB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6019D5A5-3D0C-4A30-8025-B8F30050BEB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6019D5A5-3D0C-4A30-8025-B8F30050BEB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6019D5A5-3D0C-4A30-8025-B8F30050BEB6}.Release|Any CPU.Build.0 = Release|Any CPU
- {11D505AF-310E-4536-A6DA-3E8DB053D1D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {11D505AF-310E-4536-A6DA-3E8DB053D1D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {11D505AF-310E-4536-A6DA-3E8DB053D1D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {11D505AF-310E-4536-A6DA-3E8DB053D1D6}.Release|Any CPU.Build.0 = Release|Any CPU
- {47CA77F0-3D59-47A6-AE1F-A2BAE2F72222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {47CA77F0-3D59-47A6-AE1F-A2BAE2F72222}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {47CA77F0-3D59-47A6-AE1F-A2BAE2F72222}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {47CA77F0-3D59-47A6-AE1F-A2BAE2F72222}.Release|Any CPU.Build.0 = Release|Any CPU
- {C20FA602-71E5-4383-8F8F-B966873EFA69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C20FA602-71E5-4383-8F8F-B966873EFA69}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C20FA602-71E5-4383-8F8F-B966873EFA69}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C20FA602-71E5-4383-8F8F-B966873EFA69}.Release|Any CPU.Build.0 = Release|Any CPU
- {EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Release|Any CPU.Build.0 = Release|Any CPU
- {DC7886A9-7639-4748-8FAE-D208672BAEB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DC7886A9-7639-4748-8FAE-D208672BAEB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DC7886A9-7639-4748-8FAE-D208672BAEB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DC7886A9-7639-4748-8FAE-D208672BAEB9}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {C20FA602-71E5-4383-8F8F-B966873EFA69} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
- {EFF70E7E-C320-4F47-8A13-C1FE5C8F2982} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
- {DC7886A9-7639-4748-8FAE-D208672BAEB9} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {98497725-4038-46B9-910E-2BADC6FDC7E4}
- EndGlobalSection
-EndGlobal
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln.DotSettings b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln.DotSettings
deleted file mode 100644
index e3d9e1fe1..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype.sln.DotSettings
+++ /dev/null
@@ -1,12 +0,0 @@
-
- Morgan Stanley makes this available to you under the Apache License,
-Version 2.0 (the "License"). You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0.
-
-See the NOTICE file distributed with this work for additional information
-regarding copyright ownership. Unless required by applicable law or agreed
-to in writing, software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-or implied. See the License for the specific language governing permissions
-and limitations under the License.
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/ModulesPrototype.csproj b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/ModulesPrototype.csproj
deleted file mode 100644
index 31c4b1352..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/ModulesPrototype.csproj
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
- Exe
- net6.0
- enable
-
- copyused
- true
- Always
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Program.cs b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Program.cs
deleted file mode 100644
index b4c330525..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Program.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-// Morgan Stanley makes this available to you under the Apache License,
-// Version 2.0 (the "License"). You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0.
-//
-// See the NOTICE file distributed with this work for additional information
-// regarding copyright ownership. Unless required by applicable law or agreed
-// to in writing, software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-// or implied. See the License for the specific language governing permissions
-// and limitations under the License.
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Text.Json;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using MorganStanley.ComposeUI.Messaging.Server.WebSocket;
-using Nito.AsyncEx;
-using System.Linq;
-
-namespace ModulesPrototype;
-
-internal class Program
-{
- public static async Task Main(string[] args)
- {
- var host = new HostBuilder()
- .ConfigureAppConfiguration(
- config => config.AddJsonFile("appsettings.json"))
- .ConfigureLogging(l => l.AddConsole().SetMinimumLevel(LogLevel.Debug))
- .ConfigureServices(
- (context, services) => services
- .AddMessageRouterServer(mr => mr.UseWebSockets())
- .Configure(
- context.Configuration.GetSection("MessageRouter:WebSocket"))
- .Configure(context.Configuration.GetSection("Logging")))
- .Build();
-
- var cts = new CancellationTokenSource();
- var stopTaskSource = new TaskCompletionSource();
-
- Console.CancelKeyPress += (sender, eventArgs) =>
- {
- eventArgs.Cancel = true;
- cts.Cancel();
- stopTaskSource.SetResult();
- };
-
- await host.StartAsync(cts.Token);
-
- var logger = host.Services.GetRequiredService>();
- var manifestString = File.ReadAllText("manifest.json");
- var manifest = JsonSerializer.Deserialize>(manifestString);
-
- if (manifest == null)
- {
- throw new NullReferenceException($"{nameof(manifest)}.");
- }
-
- var catalogue = new ModuleCatalogue(manifest);
- var factory = new ModuleLoaderFactory();
- var loader = factory.Create(catalogue);
- var moduleCounter = new AsyncCountdownEvent(0);
-
- loader.LifecycleEvents.Subscribe(
- e =>
- {
- var unexpected = e.IsExpected ? string.Empty : " unexpectedly";
-
- logger.LogInformation(
- $"LifecycleEvent detected: {e.ProcessInfo.uiHint ?? "non-visual module"} {e.EventType}{unexpected}");
-
- if (e.EventType == LifecycleEventType.Started && e.ProcessInfo.uiType == UIType.Web)
- {
- var webId = StartBrowser(e.ProcessInfo.uiHint!);
- }
-
- if (e.EventType == LifecycleEventType.Stopped)
- {
- if (!e.IsExpected)
- {
- loader.RequestStartProcess(
- new LaunchRequest() { name = e.ProcessInfo.name, instanceId = e.ProcessInfo.instanceId });
- }
- else
- {
- moduleCounter.Signal();
- }
- }
- });
-
- var instances = new Dictionary();
-
- foreach (var module in manifest)
- {
- var instanceId = Guid.NewGuid();
- loader.RequestStartProcess(new LaunchRequest { name = module.Value.Name, instanceId = instanceId });
- instances.Add(instanceId, module.Value);
- moduleCounter.AddCount();
- }
-
- logger.LogInformation("ComposeUI application running, press Ctrl+C to exit");
-
- await stopTaskSource.Task;
-
- logger.LogInformation("Exiting subprocesses");
-
- instances.Reverse();
-
- foreach (var item in instances)
- {
- loader.RequestStopProcess(new StopRequest { instanceId = item.Key });
- }
-
- await moduleCounter.WaitAsync();
-
- logger.LogInformation("Bye, ComposeUI!");
- }
-
- private static int StartBrowser(string url)
- {
- var prs2 = new ProcessStartInfo
- {
- FileName = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
- };
- var pr2 = new Process
- {
- StartInfo = prs2,
- };
- pr2.StartInfo.Arguments = url;
- pr2.Start();
- return pr2.Id;
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Properties/launchSettings.json b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Properties/launchSettings.json
deleted file mode 100644
index d9d8e08f3..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/Properties/launchSettings.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "profiles": {
- "ModulesPrototype": {
- "commandName": "Project",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/appsettings.json b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/appsettings.json
deleted file mode 100644
index 27278e075..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/appsettings.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "MessageRouter": {
- "WebSocket": {
- "RootPath": "/ws",
- "Port": 5005
- }
- },
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "MorganStanley.ComposeUI.Messaging": "Debug"
- }
- }
-
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/manifest.json b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/manifest.json
deleted file mode 100644
index 63a00af30..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "dataservice": {
- "StartupType": "executable",
- "UIType": "none",
- "Name": "dataservice",
- "Path": "..\\..\\..\\..\\ComposeUI.Example.DataService\\bin\\Debug\\net6.0\\ComposeUI.Example.DataService.exe",
- "Arguments": [ "ws://localhost:5000/ws" ]
- },
- "datagrid": {
- "StartupType": "executable",
- "UIType": "window",
- "Name": "datagrid",
- "Path": "..\\..\\..\\..\\ComposeUI.Example.WPFDataGrid.TestApp\\bin\\Debug\\net6.0-windows\\WPFDataGrid.TestApp.exe",
- "Arguments": [ "ws://localhost:5000/ws" ]
- },
- "chart": {
- "StartupType": "selfhostedwebapp",
- "UIType": "web",
- "Name": "chart",
- "Path": "..\\..\\..\\..\\..\\..\\examples\\js-chart",
- "Port": 8080,
- "Url": "http://localhost:8080"
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/scripts/npm-builds.ps1 b/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/scripts/npm-builds.ps1
deleted file mode 100644
index 6c36a3bf9..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/ModulesPrototype/scripts/npm-builds.ps1
+++ /dev/null
@@ -1,3 +0,0 @@
-# Building the MessageRouter-web-client, because without it the chart couldn't be started.
-cd $PSScriptRoot\..\..\..\..\..\..
-npx lerna run build --scope '{@morgan-stanley/composeui-messaging-client,@morgan-stanley/composeui-example-chart}'
diff --git a/prototypes/multi-module-prototype/examples/multi-module-example/README.md b/prototypes/multi-module-prototype/examples/multi-module-example/README.md
deleted file mode 100644
index c6dee95ff..000000000
--- a/prototypes/multi-module-prototype/examples/multi-module-example/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-# ModulesPrototype
-
-This prototype demos starting and stopping modules based on a basic manifest file.
-
-## Using the prototype
-### Build requirements
-Aside from the base dotnet stack, the demo makes uses of node.js to compile web based projects.
-
-### Launching the application
-Start the ModulesPrototype project from Visual Studio, or directly from the build folder in order to start the protype application.
-
-In the default configuration, the console shell application will start 4 different modules:
- - MessageRouter for providing communications between "Compose-ready" applications/modules
- - DataService as an example for a background data aggregator module providing data for other compose modules
- - WPFDataGrid as a sample application with WPF UI, publishing data via a MessageRouter topic others can subscibe to
- - Chart as a sample locally hosted web application reacting on data arriving via the MessageRouter, and using the router to obtain further data
-
-The console shell will restart applications that exit without the shell requesting it (see [Exiting the application](#exiting-the-application))
-
-### Triing different configurations
-The prototype starts up all entries from the _manifet.json_ file in order. It is possible to modify the file to try other configurations.
-
-## Exiting the application
-The prototype may launch several windows, but will always have a main window that displays detected lifecycle events (module started, stopped...). Pressing the enter key in this window will signal all modules to exit. The exit requests will be sent in reverse order compared to starting order.
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/BackgroundModuleHost.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/BackgroundModuleHost.cs
deleted file mode 100644
index 40a26da5d..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/BackgroundModuleHost.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Hosts
-{
- internal class BackgroundModuleHost : ModuleHostBase
- {
- private readonly IModuleRunner _runner;
-
- public BackgroundModuleHost(string name, Guid instanceId, IModuleRunner runner) : base(name, instanceId)
- {
- _runner = runner;
- _processInfo = new ProcessInfo(base.Name, base.InstanceId, UIType.None, null, 0);
- }
-
- public override ProcessInfo ProcessInfo => _processInfo;
-
- private ProcessInfo _processInfo;
-
- public async override Task Launch()
- {
- var pid = await _runner.Launch();
- _processInfo.pid = pid;
- _lifecycleEvents.OnNext(LifecycleEvent.Started(ProcessInfo));
- }
-
- public async override Task Teardown()
- {
- await _runner.Stop();
- _lifecycleEvents.OnNext(LifecycleEvent.Stopped(ProcessInfo, true));
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/ModuleHostBase.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/ModuleHostBase.cs
deleted file mode 100644
index 784dac85c..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/ModuleHostBase.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using System.Reactive.Subjects;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Hosts;
-
-internal abstract class ModuleHostBase : IModuleHost
-{
- public ModuleHostBase(string name, Guid instanceId)
- {
- Name = name;
- InstanceId = instanceId;
- }
-
- public string Name { get; }
-
- public Guid InstanceId { get; }
- public abstract ProcessInfo ProcessInfo { get; }
-
- protected readonly Subject _lifecycleEvents = new Subject();
- public IObservable LifecycleEvents => _lifecycleEvents;
-
- public abstract Task Launch();
-
- public abstract Task Teardown();
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WebpageModuleHost.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WebpageModuleHost.cs
deleted file mode 100644
index a1518bafc..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WebpageModuleHost.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Hosts;
-
-internal class WebpageModuleHost : ModuleHostBase
-{
- private readonly string _url;
- private readonly IModuleRunner? _runner;
-
- public WebpageModuleHost(string name, Guid instanceId, string url, IModuleRunner? runner) : base(name, instanceId)
- {
- _url = url;
- _runner = runner;
- }
-
- public override ProcessInfo ProcessInfo => new ProcessInfo(
- name: Name,
- instanceId: InstanceId,
- uiType: UIType.Web,
- uiHint: _url,
- pid: 0 //doesn't exist yet
- );
-
- public async override Task Launch()
- {
- int pid = 0;
- if (_runner != null)
- {
- pid = await _runner.Launch();
- }
- _lifecycleEvents.OnNext(LifecycleEvent.Started(new ProcessInfo(Name, InstanceId, UIType.Web, _url, pid)));
- }
-
- public async override Task Teardown()
- {
- if (_runner != null)
- {
- await _runner.Stop();
- }
- _lifecycleEvents.OnNext(LifecycleEvent.Stopped(new ProcessInfo(Name, InstanceId, UIType.Web, _url, 0))); //stopped --> doesn't exists
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WindowedModuleHost.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WindowedModuleHost.cs
deleted file mode 100644
index 2921f17f3..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Hosts/WindowedModuleHost.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Hosts
-{
- internal class WindowedModuleHost : ModuleHostBase
- {
- private IWindowedModuleRunner _moduleRunner;
- private ProcessInfo _processInfo;
-
- public WindowedModuleHost(string name, Guid instanceId, IWindowedModuleRunner moduleRunner) : base(name, instanceId)
- {
- _moduleRunner = moduleRunner;
- _moduleRunner.StoppedUnexpectedly += HandleUnexpectedStop;
- _processInfo = new ProcessInfo(name: Name, instanceId: InstanceId,uiType: UIType.Window,uiHint: _moduleRunner.MainWindowHandle.ToString(), pid: 0);
- }
-
- public override ProcessInfo ProcessInfo => _processInfo;
-
- public override async Task Launch()
- {
- var pid = await _moduleRunner.Launch();
- while (_moduleRunner.MainWindowHandle.ToInt64() == 0)
- {
- await Task.Delay(TimeSpan.FromMilliseconds(100));
- }
-
- _processInfo.pid = pid;
- _lifecycleEvents.OnNext(LifecycleEvent.Started(ProcessInfo));
- }
-
- public override async Task Teardown()
- {
- await _moduleRunner.Stop();
- _lifecycleEvents.OnNext(LifecycleEvent.Stopped(ProcessInfo));
- }
-
- private void HandleUnexpectedStop(object? sender, EventArgs e)
- {
- _lifecycleEvents.OnNext(LifecycleEvent.Stopped(ProcessInfo, false));
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleHostFactory.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleHostFactory.cs
deleted file mode 100644
index 5906ae023..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleHostFactory.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Hosts;
-using MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Runners;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService;
-
-internal class ModuleHostFactory : IModuleHostFactory
-{
- public IModuleHost CreateModuleHost(ModuleManifest manifest, Guid instanceId)
- {
- IModuleRunner runner;
- switch (manifest.StartupType)
- {
- case (StartupType.Executable):
- runner = new ExecutableRunner(manifest.Path, manifest.Arguments);
- break;
- case (StartupType.DotNetCore):
- runner = new DotNetCoreRunner(manifest.Path, manifest.Arguments);
- break;
- case (StartupType.SelfHostedWebApp):
- runner = new ComposeHostedWebApp(manifest.Path, manifest.Port.Value);
- break;
- case (StartupType.None):
- runner = null;
- break;
- default:
- throw new NotSupportedException("Unsupported startup type");
-
- }
-
- switch (manifest.UIType)
- {
- case (UIType.Window):
- return new WindowedModuleHost(manifest.Name, instanceId, runner as IWindowedModuleRunner);
- case (UIType.Web):
- return new WebpageModuleHost(manifest.Name, instanceId, manifest.Url, runner);
- case (UIType.None):
- return new BackgroundModuleHost(manifest.Name, instanceId, runner);
- default:
- throw new NotSupportedException("Unsupported module type");
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoader.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoader.cs
deleted file mode 100644
index ef036c861..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoader.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// ********************************************************************************************************
-//
-// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-// Unless required by applicable law or agreed to in writing, software distributed under the License
-// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and limitations under the License.
-//
-// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using System.Collections.Concurrent;
-using System.Reactive.Subjects;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService;
-
-internal class ModuleLoader : IModuleLoader
-{
- private Subject _lifecycleEvents = new();
- public IObservable LifecycleEvents => _lifecycleEvents;
- private ConcurrentDictionary _processes = new();
- private readonly IModuleHostFactory _moduleHostFactory;
- private readonly IModuleCatalogue _moduleCatalogue;
-
- public ModuleLoader(IModuleCatalogue moduleCatalogue, IModuleHostFactory moduleHostFactory)
- {
- _moduleCatalogue = moduleCatalogue;
- _moduleHostFactory = moduleHostFactory;
- }
-
- public void RequestStartProcess(LaunchRequest request)
- {
- Task.Run(() => StartProcess(request));
- }
-
- private async void StartProcess(LaunchRequest request)
- {
- IModuleHost host = _processes.GetOrAdd(request.instanceId, _ => CreateModuleHost(request));
- await host.Launch();
- }
-
- private IModuleHost CreateModuleHost(LaunchRequest request)
- {
- var manifest = _moduleCatalogue.GetManifest(request.name);
- var h = _moduleHostFactory.CreateModuleHost(manifest, request.instanceId);
- h.LifecycleEvents.Subscribe(ForwardLifecycleEvents);
- return h;
- }
-
- public async void RequestStopProcess(StopRequest request)
- {
- if (!_processes.TryGetValue(request.instanceId, out var module))
- {
- return;
- }
- await module.Teardown();
- }
-
- private void ForwardLifecycleEvents(LifecycleEvent lifecycleEvent)
- {
- _lifecycleEvents.OnNext(lifecycleEvent);
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoaderFactory.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoaderFactory.cs
deleted file mode 100644
index 0cd7410e9..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/ModuleLoaderFactory.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService
-{
- public class ModuleLoaderFactory : IModuleLoaderFactory
- {
- public IModuleLoader Create(ModuleCatalogue catalogue)
- {
- return new ModuleLoader(catalogue, new ModuleHostFactory());
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleCatalogue.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleCatalogue.cs
deleted file mode 100644
index 7dec79502..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleCatalogue.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public interface IModuleCatalogue
- {
- ModuleManifest GetManifest(string moduleName);
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHost.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHost.cs
deleted file mode 100644
index 69780f4c3..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHost.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-internal interface IModuleHost
-{
- string Name { get; }
- Guid InstanceId { get; }
- ProcessInfo ProcessInfo { get; }
- IObservable LifecycleEvents { get; }
- Task Launch();
- Task Teardown();
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHostFactory.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHostFactory.cs
deleted file mode 100644
index 8c6888eed..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleHostFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- internal interface IModuleHostFactory
- {
- internal IModuleHost CreateModuleHost(ModuleManifest manifest, Guid instanceId);
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoader.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoader.cs
deleted file mode 100644
index 227a0ba75..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoader.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public interface IModuleLoader
-{
- void RequestStartProcess(LaunchRequest request);
- void RequestStopProcess(StopRequest name);
- IObservable LifecycleEvents { get; }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoaderFactory.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoaderFactory.cs
deleted file mode 100644
index 647616b07..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleLoaderFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public interface IModuleLoaderFactory
- {
- IModuleLoader Create(ModuleCatalogue catalogue);
- }
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleRunner.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleRunner.cs
deleted file mode 100644
index a1c240854..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IModuleRunner.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public interface IModuleRunner
- {
- Task Launch();
- Task Stop();
-
- event EventHandler StoppedUnexpectedly;
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IWindowedModuleRunner.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IWindowedModuleRunner.cs
deleted file mode 100644
index 7a77af0c0..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/IWindowedModuleRunner.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public interface IWindowedModuleRunner : IModuleRunner
- {
- IntPtr MainWindowHandle { get; }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LaunchRequest.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LaunchRequest.cs
deleted file mode 100644
index 2d32e9488..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LaunchRequest.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public struct LaunchRequest
-{
- public Guid instanceId;
- public string name;
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LifecycleEvent.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LifecycleEvent.cs
deleted file mode 100644
index c7fefcf22..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/LifecycleEvent.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public sealed class LifecycleEvent
-{
- private LifecycleEvent(ProcessInfo processInfo, string eventType, bool isExpected)
- {
- ProcessInfo = processInfo;
- EventType = eventType;
- IsExpected = isExpected;
- }
-
- public ProcessInfo ProcessInfo { get; }
- public string EventType { get; }
- public bool IsExpected { get; }
-
- public static LifecycleEvent Stopped(ProcessInfo processInfo, bool expected = true) => new LifecycleEvent(processInfo: processInfo, eventType: LifecycleEventType.Stopped, isExpected: expected);
- public static LifecycleEvent Started(ProcessInfo processInfo) => new LifecycleEvent(processInfo: processInfo, eventType: LifecycleEventType.Started, isExpected: true);
- public static LifecycleEvent StoppingCanceled(ProcessInfo processInfo, bool expected) => new LifecycleEvent(processInfo: processInfo, eventType: LifecycleEventType.StoppingCanceled, isExpected: expected);
- public static LifecycleEvent FailedToStart(ProcessInfo processInfo) => new LifecycleEvent(processInfo: processInfo, eventType: LifecycleEventType.FailedToStart, isExpected: false);
-}
-
-public static class LifecycleEventType
-{
- public const string Stopped = "stopped";
- public const string Started = "started";
- public const string StoppingCanceled = "stoppingCanceled";
- public const string FailedToStart = "failedToStart";
-}
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleCatalogue.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleCatalogue.cs
deleted file mode 100644
index d01ecc183..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleCatalogue.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-///
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public class ModuleCatalogue : IModuleCatalogue
- {
- public ModuleCatalogue(Dictionary modules)
- {
- Modules = modules;
- }
-
- Dictionary Modules { get; } = new Dictionary();
-
- public ModuleManifest GetManifest(string moduleName)
- {
- ModuleManifest? manifest;
- if (!Modules.TryGetValue(moduleName, out manifest))
- {
- throw new Exception("Unknown module name");
- }
- return manifest;
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleManifest.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleManifest.cs
deleted file mode 100644
index 13384ff7a..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleManifest.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public class ModuleManifest
-{
- public string Name { get; set; }
- public string StartupType { get; set; }
- public string UIType { get; set; }
- public string? Path { get; set; }
- public string? Url { get; set; }
- public string[]? Arguments { get; set; }
- public int? Port { get; set; }
-}
-
-
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleState.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleState.cs
deleted file mode 100644
index 3e0b1df95..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ModuleState.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public class ModuleState
-{
- public const string Started = "Started";
- public const string Running = "Running";
- public const string Stopped = "Stopped";
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ProcessInfo.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ProcessInfo.cs
deleted file mode 100644
index 70b47e689..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/ProcessInfo.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public struct ProcessInfo
-{
- public ProcessInfo(string name, Guid instanceId, string uiType, string? uiHint, int? pid)
- {
- this.name = name;
- this.instanceId = instanceId;
- this.uiType = uiType;
- this.uiHint = uiHint;
- this.pid = pid;
- }
-
- ///
- /// The name of the module
- ///
- public string name;
-
- ///
- /// The ID referencing the process instance
- ///
- public Guid instanceId;
-
- ///
- /// The UI type of the module
- ///
- public string uiType;
-
- ///
- /// Hint to displying the UI of the module.
- /// - Web: URL to navigate
- /// - Window: ProcessID of the process owning the main window
- ///
- public string? uiHint;
-
- public int? pid;
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StartupType.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StartupType.cs
deleted file mode 100644
index c88465990..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StartupType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-///
-/// Represents the type of action necessary to start hosting a module
-///
-public static class StartupType
-{
- ///
- /// No action is required. Use this value for e.g. webapps hosted on a remote server
- ///
- public const string None = "none";
- ///
- /// The module is started via a windows executable (.exe) file
- ///
- public const string Executable = "executable";
- ///
- /// The module is a web app that can be hosted via node development server
- ///
- public const string SelfHostedWebApp = "selfhostedwebapp";
-
- ///
- /// The module has to be started using dotnet cli
- ///
- public const string DotNetCore = "dotnetcore";
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StopRequest.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StopRequest.cs
deleted file mode 100644
index 7d266207a..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/StopRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-
-public struct StopRequest
-{
- public Guid instanceId;
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/UIType.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/UIType.cs
deleted file mode 100644
index 42d2c9293..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Modules/UIType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-/// Microsoft Visual Studio Solution File, Format Version 12.00
-///
-/// ********************************************************************************************************
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules
-{
- public static class UIType
- {
- public const string None = "none";
- public const string Web = "web";
- public const string Window = "window";
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/MorganStanley.ComposeUI.ModuleLoader.csproj b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/MorganStanley.ComposeUI.ModuleLoader.csproj
deleted file mode 100644
index 51af9c24c..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/MorganStanley.ComposeUI.ModuleLoader.csproj
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- net6.0
- enable
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ComposeHostedWebApp.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ComposeHostedWebApp.cs
deleted file mode 100644
index ac9d274fe..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ComposeHostedWebApp.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using System.Diagnostics;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Runners
-{
- internal class ComposeHostedWebApp : IModuleRunner
- {
- public event EventHandler? StoppedUnexpectedly;
- private Process _process;
- private readonly string _path;
- private readonly int _port;
-
- public ComposeHostedWebApp(string path, int port)
- {
- _path = path;
- _port = port;
- }
-
- public Task Launch()
- {
- var webserverPath = Path.GetFullPath("Runners\\webserver.cmd");
-
- _process = new Process();
- _process.StartInfo.UseShellExecute = true;
- _process.StartInfo.FileName = webserverPath;
- _process.StartInfo.ArgumentList.Add(_port.ToString());
- _process.StartInfo.WorkingDirectory = Path.GetFullPath(_path);
- _process.Start();
-
- return Task.Factory.StartNew( () =>
- {
- Task.Delay(TimeSpan.FromMilliseconds(500));
- return _process.Id;
- });
- }
-
- public async Task Stop()
- {
- _process.CloseMainWindow();
- var forceExit = 10;
- while (!_process.HasExited && forceExit > 0)
- {
- await Task.Delay(TimeSpan.FromMilliseconds(100));
- forceExit--;
- }
- if (forceExit == 0)
- {
- _process.Kill();
- }
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/DotNetCoreRunner.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/DotNetCoreRunner.cs
deleted file mode 100644
index ab6b072a5..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/DotNetCoreRunner.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using System.Diagnostics;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Runners
-{
- internal class DotNetCoreRunner : IWindowedModuleRunner
- {
- private Process? _mainProcess;
- private readonly string _path;
- private readonly string[] _arguments;
-
- public DotNetCoreRunner(string path, string[]? arguments)
- {
- _path = path;
- _arguments = arguments ?? Array.Empty();
- }
-
- public IntPtr MainWindowHandle => _mainProcess?.MainWindowHandle ?? IntPtr.Zero;
-
- public event EventHandler? StoppedUnexpectedly;
-
- public Task Launch()
- {
- var startScriptPath = Path.GetFullPath("Runners\\dotnetcore.cmd");
- var location = Path.GetFullPath(_path);
-
- var mainProcess = new Process();
- mainProcess.StartInfo.UseShellExecute = true;
- mainProcess.StartInfo.FileName = startScriptPath;
- mainProcess.StartInfo.ArgumentList.Add(location);
- mainProcess.StartInfo.WorkingDirectory = Path.GetDirectoryName(location);
-
- foreach (var arg in _arguments)
- {
- mainProcess.StartInfo.ArgumentList.Add(arg);
- }
-
- mainProcess.Exited -= ProcessExitedUnexpectedly;
- mainProcess.Exited += ProcessExitedUnexpectedly;
-
- mainProcess.Start();
-
- _mainProcess = mainProcess;
-
- return Task.FromResult(mainProcess.Id);
- }
-
- public async Task Stop()
- {
- if (_mainProcess == null)
- {
- return;
- }
-
- _mainProcess.Exited -= ProcessExitedUnexpectedly;
- var killNecessary = true;
-
- if (_mainProcess.CloseMainWindow())
- {
- await Task.Delay(TimeSpan.FromMilliseconds(500));
- if (_mainProcess.HasExited)
- {
- killNecessary = false;
- }
- }
-
- if (killNecessary)
- {
- _mainProcess.Kill();
- await Task.Delay(TimeSpan.FromMilliseconds(500));
- }
- }
-
- private void ProcessExitedUnexpectedly(object? sender, EventArgs e)
- {
- StoppedUnexpectedly?.Invoke(sender, e);
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ExecutableRunner.cs b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ExecutableRunner.cs
deleted file mode 100644
index b27b1e559..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/ExecutableRunner.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-/// ********************************************************************************************************
-///
-/// Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License").
-/// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
-/// See the NOTICE file distributed with this work for additional information regarding copyright ownership.
-/// Unless required by applicable law or agreed to in writing, software distributed under the License
-/// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and limitations under the License.
-///
-/// ********************************************************************************************************
-
-using MorganStanley.ComposeUI.Tryouts.Core.Abstractions.Modules;
-using System.Diagnostics;
-
-namespace MorganStanley.ComposeUI.Tryouts.Core.Services.ModulesService.Runners
-{
- internal class ExecutableRunner : IWindowedModuleRunner
- {
- private Process? _mainProcess;
- private readonly string _launchPath;
- private readonly string[] _arguments;
-
- public IntPtr MainWindowHandle => _mainProcess?.MainWindowHandle ?? IntPtr.Zero;
-
- public event EventHandler? StoppedUnexpectedly;
-
- public ExecutableRunner(string launchPath, string[]? arguments)
- {
- _launchPath = launchPath;
- _arguments = arguments ?? Array.Empty();
- }
-
- public Task Launch()
- {
- var mainProcess = new Process();
- mainProcess.StartInfo.FileName = _launchPath;
- mainProcess.EnableRaisingEvents = true;
- mainProcess.StartInfo.UseShellExecute = true;
- mainProcess.Exited -= ProcessExitedUnexpectedly;
- mainProcess.Exited += ProcessExitedUnexpectedly;
-
- foreach (var argument in _arguments)
- {
- mainProcess.StartInfo.ArgumentList.Add(argument);
- }
-
- _mainProcess = mainProcess;
-
- _mainProcess?.Start();
-
- return Task.FromResult(mainProcess.Id);
- }
-
- public async Task Stop()
- {
- if (_mainProcess == null)
- {
- return;
- }
-
- _mainProcess.Exited -= ProcessExitedUnexpectedly;
- var killNecessary = true;
-
- if (_mainProcess.CloseMainWindow())
- {
- await Task.Delay(TimeSpan.FromMilliseconds(500));
- if (_mainProcess.HasExited)
- {
- killNecessary = false;
- }
- }
-
- if (killNecessary)
- {
- _mainProcess.Kill();
- await Task.Delay(TimeSpan.FromMilliseconds(500));
- }
- }
-
- private void ProcessExitedUnexpectedly(object? sender, EventArgs e)
- {
- StoppedUnexpectedly?.Invoke(sender, e);
- }
- }
-}
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/dotnetcore.cmd b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/dotnetcore.cmd
deleted file mode 100644
index 2566d96a1..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/dotnetcore.cmd
+++ /dev/null
@@ -1 +0,0 @@
-dotnet %*
\ No newline at end of file
diff --git a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/webserver.cmd b/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/webserver.cmd
deleted file mode 100644
index ec16b1886..000000000
--- a/prototypes/multi-module-prototype/src/module-loader/dotnet/ModuleLoader/Runners/webserver.cmd
+++ /dev/null
@@ -1 +0,0 @@
-npm run serve -- --port %1
\ No newline at end of file