Beispiel #1
0
        protected override async void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var initialVisualizerInstances = FindVisualizerInstances();

            using (var messageData = objectProvider.GetData())
            {
                if (initialVisualizerInstances.Count == 0)
                {
                    var launchedInstance = LaunchNewInstance();
                    await CommunicationHelper.SendToInstance(launchedInstance.TcpPort, messageData);
                }
                else if (initialVisualizerInstances.Count == 1)
                {
                    await CommunicationHelper.SendToInstance(initialVisualizerInstances[0].TcpPort, messageData);
                }
                else
                {
                    var selector = new VisualizerSelectorForm(initialVisualizerInstances, messageData);
                    windowService.ShowDialog(selector);
                }
            }
        }
Beispiel #2
0
 protected override async void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
 {
     var launchedInstance = LaunchNewInstance();
     await CommunicationHelper.SendToInstance(launchedInstance.TcpPort, objectProvider.GetData());
 }
Beispiel #3
0
 private async void SendToSelectedInstance(VisualizerInstanceInfo instance)
 {
     Trace.WriteLine($"Send to: {instance}");
     await CommunicationHelper.SendToInstance(instance.TcpPort, MemoryStreamToVisualize);
 }