Ejemplo n.º 1
0
        private void TreeViewBrowse_Click(object sender, RoutedEventArgs e)
        {
            var item = TV.GetSelectedTag <TreeItem>();

            if (item != null)
            {
                WpfExtensions.Browse(item.Url);
                return;
            }
        }
Ejemplo n.º 2
0
        private void FolderButton_Click(object sender, RoutedEventArgs e)
        {
            var browser = new FolderBrowser();
            var r       = browser.ShowDialog(WpfExtensions.GetWin32Window(this));

            if (r != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            Folder.Text           = browser.DirectoryPath;
            StartButton.IsEnabled = true;
        }
Ejemplo n.º 3
0
        public ErrorBox(Exception error, string errorDetails)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }

            _error = error;
            InitializeComponent();
            ErrorDetails.Visibility = Visibility.Collapsed;
            ErrorDetails.Text       = error.GetErrorText(null);
            if (!string.IsNullOrWhiteSpace(errorDetails))
            {
                ErrorDetails.Text += Environment.NewLine + Environment.NewLine + "-- Details -- " + Environment.NewLine + Environment.NewLine + errorDetails;
            }
            ErrorDetails.Text += Environment.NewLine + Environment.NewLine + "-- Diagnostics -- " + Environment.NewLine + Environment.NewLine + GetDebugInformation();
            Image.Source       = WpfExtensions.GetStockIcon(WindowsUtilities.StockIconId.ERROR, WindowsUtilities.SHGSI.SHGSI_LARGEICON);
            Error.Text         = CodeFluentRuntimeException.GetInterestingExceptionMessage(error);
        }
Ejemplo n.º 4
0
        private void Details_Click(object sender, RoutedEventArgs e)
        {
            if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
            {
                WpfExtensions.MailTo(null, "SSB Error: " + Error.Text, GetDebugInformation() + Environment.NewLine + ErrorDetails.Text);
                return;
            }
            const string CopyName = "Copy";

            if (CopyName.Equals(Details.Content))
            {
                Clipboard.SetText(ErrorDetails.Text);
                return;
            }

            Details.Content         = CopyName;
            ErrorDetails.Visibility = Visibility.Visible;
            Dispatcher.BeginInvoke(() =>
            {
                WindowsUtilities.CenterWindow(new WindowInteropHelper(this).Handle);
            }, DispatcherPriority.Background);
        }