From 7f313f30c7b343f9caac42b8e04d88d2f01ff585 Mon Sep 17 00:00:00 2001 From: yt3trees Date: Sun, 12 Nov 2023 22:48:07 +0900 Subject: [PATCH] Improved functionality of the execution result display window & xaml format --- msbuild-gui/Console.xaml | 119 +++++--- msbuild-gui/Console.xaml.cs | 59 +++- msbuild-gui/MainWindow.xaml | 413 ++++++++++++++-------------- msbuild-gui/MainWindow.xaml.cs | 16 +- msbuild-gui/Messagebox.xaml | 47 ++++ msbuild-gui/Messagebox.xaml.cs | 62 +++++ msbuild-gui/msbuild-gui.csproj.user | 6 + 7 files changed, 475 insertions(+), 247 deletions(-) create mode 100644 msbuild-gui/Messagebox.xaml create mode 100644 msbuild-gui/Messagebox.xaml.cs diff --git a/msbuild-gui/Console.xaml b/msbuild-gui/Console.xaml index e94ae8d..7343201 100644 --- a/msbuild-gui/Console.xaml +++ b/msbuild-gui/Console.xaml @@ -1,22 +1,23 @@ - - - - + + + + + + + + + + + + + diff --git a/msbuild-gui/Console.xaml.cs b/msbuild-gui/Console.xaml.cs index 713ab04..65682db 100644 --- a/msbuild-gui/Console.xaml.cs +++ b/msbuild-gui/Console.xaml.cs @@ -1,6 +1,7 @@ using ModernWpf; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Reflection; using System.Windows; using System.Windows.Controls; @@ -17,7 +18,8 @@ public partial class Console : Window { private int searchIndex { get; set; } private int searchIndexMAX { get; set; } - public Console(string result , int maxCount, string[,] list, string errorLog) + private string command; + public Console(string result, int maxCount, string[,] list, string errorLog) { InitializeComponent(); this.WindowStartupLocation = WindowStartupLocation.CenterOwner; @@ -34,12 +36,25 @@ public Console(string result , int maxCount, string[,] list, string errorLog) { ResultTabControl.Items.Remove(ErrorTab); } - + Brush black = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF111111")); Brush gray = new SolidColorBrush((Color)ColorConverter.ConvertFromString("LightGray")); Brush white = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFF")); + Brush black80 = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#CC111111")); + Brush white80 = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#CCFFFFFF")); ErrorResult.Text = errorLog; + if (ThemeManager.Current.ApplicationTheme == ApplicationTheme.Dark + || ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Dark) + { + ButtonBorder.Background = black80; + } + else if (ThemeManager.Current.ApplicationTheme == ApplicationTheme.Light + || ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Light) + { + ButtonBorder.Background = white80; + } + for (int count = 0; count < searchIndexMAX; count++) { TabItem item = new TabItem(); @@ -80,9 +95,10 @@ public Console(string result , int maxCount, string[,] list, string errorLog) item.Content = text; ResultTabControl.Items.Add(item); + command += list[count, 2].ToString() + "\r\n\r\n"; } - if (ThemeManager.Current.ApplicationTheme == ApplicationTheme.Dark + if (ThemeManager.Current.ApplicationTheme == ApplicationTheme.Dark || ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Dark) { ErrorResult.Background = black; @@ -155,5 +171,42 @@ private void ErrorResult_KeyDown(object sender, KeyEventArgs e) } } } + private void CommandButton_Click(object sender, RoutedEventArgs e) + { + var window = new Messagebox("Execution command", command); + window.Owner = this; + window.ShowDialog(); + } + private void ShowTabList(object sender, RoutedEventArgs e) + { + TabList.Items.Clear(); + foreach (TabItem tabItem in ResultTabControl.Items) + { + if (tabItem.Header is TextBlock textBlock) + { + string text = textBlock.Text; + TreeViewItem item = new TreeViewItem(); + item.Header = text; + TabList.Items.Add(item); + } + else + { + string text = tabItem.Header.ToString(); + TreeViewItem item = new TreeViewItem(); + item.Header = text; + TabList.Items.Add(item); + } + } + TabList.Visibility = Visibility.Visible; + } + private void TabList_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + int selectedIndex = TabList.SelectedIndex; + if (selectedIndex != -1) + { + ResultTabControl.SelectedIndex = selectedIndex; + TabList.Visibility = Visibility.Collapsed; + } + } } } diff --git a/msbuild-gui/MainWindow.xaml b/msbuild-gui/MainWindow.xaml index b6d822c..e6845fd 100644 --- a/msbuild-gui/MainWindow.xaml +++ b/msbuild-gui/MainWindow.xaml @@ -1,23 +1,24 @@ - + @@ -30,101 +31,107 @@ - - - -