/// <summary>
        /// Command handler which shows the data type of the selected terminal
        /// </summary>
        public static void OnShowTerminalType(ICommandParameter parameter, ICompositionHost host, DocumentEditSite site)
        {
            var viewModel = parameter.QueryService <NodeTerminalViewModel>().FirstOrDefault();

            if (viewModel != null)
            {
                NIMessageBox.Show("The terminal type is: " + viewModel.DataType.ToString());
            }
        }
Example #2
0
        /// <summary>
        /// Show an error message to the user.
        ///
        /// The message box needs to invoked on the UI thread. The button code was invoked in a background activity,
        /// so we queue a UIActivity that runs on the UI thread.
        /// </summary>
        /// <returns>Return the task so that calling code can wait for the user to dismiss the message box before continuing.</returns>
        private static Task ShowErrorMessageBoxAsync(ICompositionHost host, string messageBoxText)
        {
            var scheduledActivityManager = host.GetSharedExportedValue <IScheduledActivityManager>();

            return(scheduledActivityManager.RunUIActivityAsync("Show an error message box", () =>
            {
                NIMessageBox.Show(messageBoxText, "DFIR Generation Error");
            }));
        }
        private void OnOK(object sender, RoutedEventArgs e)
        {
            CommitChanges();
            var result = NIMessageBox.Show("Restart server to apply changes?", "Restart Server", NIMessageBoxButton.YesNo);

            Close();
            if (result == NIMessageBoxResult.Yes)
            {
                WebServiceRunner.RestartServerOnClose = true;
                Application.Current.Shutdown();
            }
        }
 private static void OnFoxCommand(ICommandParameter parameter, ICompositionHost host, DocumentEditSite site)
 {
     NIMessageBox.Show("What does the fox say?");
 }