From 3a73f8f60318ceb950d7b84fc8ab81420185aab0 Mon Sep 17 00:00:00 2001 From: marque Date: Sat, 15 Jun 2024 13:25:59 +0200 Subject: [PATCH] updated pkgs and alleviated app crash on windows when creating mcx gate --- QuIDE/QuIDE.csproj | 16 ++++++++-------- QuIDE/Views/Controls/CircuitGrid.axaml.cs | 13 ++++++++++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/QuIDE/QuIDE.csproj b/QuIDE/QuIDE.csproj index 39e0c9e..9f36886 100644 --- a/QuIDE/QuIDE.csproj +++ b/QuIDE/QuIDE.csproj @@ -32,20 +32,20 @@ - + - - + + - - + + - - - + + + diff --git a/QuIDE/Views/Controls/CircuitGrid.axaml.cs b/QuIDE/Views/Controls/CircuitGrid.axaml.cs index 4f77e72..c83e537 100644 --- a/QuIDE/Views/Controls/CircuitGrid.axaml.cs +++ b/QuIDE/Views/Controls/CircuitGrid.axaml.cs @@ -1,11 +1,13 @@ #region using System; +using System.Runtime.InteropServices; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Shapes; using Avalonia.Input; using Avalonia.Media; +using QuIDE.CodeHelpers; using QuIDE.QuantumModel; using QuIDE.ViewModels; using QuIDE.ViewModels.Controls; @@ -93,7 +95,16 @@ private void GateButton_MouseDown(object sender, PointerPressedEventArgs e) var dragData = new DataObject(); dragData.Set(typeof(Tuple).ToString(), data); - DragDrop.DoDragDrop(e, dragData, DragDropEffects.Link); + try + { + DragDrop.DoDragDrop(e, dragData,DragDropEffects.Link); + } + catch (COMException exception) + { + var msg = exception.Message; + Console.WriteLine(exception); + // SimpleDialogHandler.ShowSimpleMessage(msg); + } } private void ctrlPoint_Drop(object sender, PointerEventArgs pointerEventArgs)