Esempio n. 1
0
        private void OnMigrationAssistantRequested(object sender, EventArgs e)
        {
            var routedEventArgs = e as RoutedEventArgs;

            if (routedEventArgs == null)
            {
                throw new NullReferenceException(nameof(e));
            }

            var btn          = routedEventArgs.OriginalSource as System.Windows.Controls.Button;
            var parentWindow = Window.GetWindow(btn);

            var node            = sender as PythonNode;
            var viewModel       = new PythonMigrationAssistantViewModel(node, LoadedParams.CurrentWorkspaceModel as WorkspaceModel, LoadedParams.StartupParams.PathManager);
            var assistantWindow = new VisualDifferenceViewer(viewModel)
            {
                Owner = parentWindow
            };

            // show modal window so user cant interact with dynamo while migration assistant is open
            // if running in test mode, show modeless window show the test dosent hang when opening the assistant window.
            if (Models.DynamoModel.IsTestMode)
            {
                assistantWindow.Show();
                return;
            }

            assistantWindow.ShowDialog();
        }
Esempio n. 2
0
        private void OnMigrationAssistantRequested(object sender, EventArgs e)
        {
            var routedEventArgs = e as RoutedEventArgs;

            if (routedEventArgs == null)
            {
                throw new NullReferenceException(nameof(e));
            }

            var btn          = routedEventArgs.OriginalSource as System.Windows.Controls.Button;
            var parentWindow = Window.GetWindow(btn);

            var node            = sender as PythonNode;
            var viewModel       = new PythonMigrationAssistantViewModel(node);
            var assistantWindow = new VisualDifferenceViewer(viewModel)
            {
                Owner = parentWindow
            };

            // show modal window so user cant interact with dynamo while migration assistant is open
            assistantWindow.ShowDialog();
        }