From b6132b029af826d947b7f2eba3027054ece5d2d7 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Fri, 19 Jul 2019 16:37:51 -0700 Subject: [PATCH] Move WorkProgress dialog into CommonWPF library --- CommonWPF/CommonWPF.csproj | 9 +++++++++ {SourceGenWPF/WpfGui => CommonWPF}/WorkProgress.xaml | 10 ++++++++-- .../WpfGui => CommonWPF}/WorkProgress.xaml.cs | 5 +++-- SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs | 1 + SourceGenWPF/SourceGenWPF.csproj | 7 ------- 5 files changed, 21 insertions(+), 11 deletions(-) rename {SourceGenWPF/WpfGui => CommonWPF}/WorkProgress.xaml (83%) rename {SourceGenWPF/WpfGui => CommonWPF}/WorkProgress.xaml.cs (96%) diff --git a/CommonWPF/CommonWPF.csproj b/CommonWPF/CommonWPF.csproj index ddf43d3..101b77e 100644 --- a/CommonWPF/CommonWPF.csproj +++ b/CommonWPF/CommonWPF.csproj @@ -65,6 +65,9 @@ True + + WorkProgress.xaml + ResXFileCodeGenerator @@ -75,5 +78,11 @@ Settings.Designer.cs + + + MSBuild:Compile + Designer + + \ No newline at end of file diff --git a/SourceGenWPF/WpfGui/WorkProgress.xaml b/CommonWPF/WorkProgress.xaml similarity index 83% rename from SourceGenWPF/WpfGui/WorkProgress.xaml rename to CommonWPF/WorkProgress.xaml index 5b20b4c..b4d6363 100644 --- a/SourceGenWPF/WpfGui/WorkProgress.xaml +++ b/CommonWPF/WorkProgress.xaml @@ -14,17 +14,23 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + + Failed + + diff --git a/SourceGenWPF/WpfGui/WorkProgress.xaml.cs b/CommonWPF/WorkProgress.xaml.cs similarity index 96% rename from SourceGenWPF/WpfGui/WorkProgress.xaml.cs rename to CommonWPF/WorkProgress.xaml.cs index bbe91fa..5dd4fbd 100644 --- a/SourceGenWPF/WpfGui/WorkProgress.xaml.cs +++ b/CommonWPF/WorkProgress.xaml.cs @@ -18,7 +18,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Windows; -namespace SourceGenWPF.WpfGui { +namespace CommonWPF { /// /// Cancelable progress dialog. /// @@ -127,7 +127,8 @@ namespace SourceGenWPF.WpfGui { } } else if (e.Error != null) { // Unexpected; success/failure should be passed through e.Result. - MessageBox.Show(e.Error.ToString(), Res.Strings.OPERATION_FAILED, + string failMsg = (string)FindResource("str_OperationFailedCaption"); + MessageBox.Show(e.Error.ToString(), failMsg, MessageBoxButton.OK, MessageBoxImage.Error); DialogResult = false; } else { diff --git a/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs b/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs index 2723eb5..2adfbf7 100644 --- a/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs +++ b/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs @@ -23,6 +23,7 @@ using System.Windows; using System.Windows.Controls; using CommonUtil; +using CommonWPF; using SourceGenWPF.WpfGui; namespace SourceGenWPF.AsmGen.WpfGui { diff --git a/SourceGenWPF/SourceGenWPF.csproj b/SourceGenWPF/SourceGenWPF.csproj index 0af819b..0b47d59 100644 --- a/SourceGenWPF/SourceGenWPF.csproj +++ b/SourceGenWPF/SourceGenWPF.csproj @@ -130,9 +130,6 @@ HexDumpViewer.xaml - - WorkProgress.xaml - GenAndAsm.xaml @@ -293,10 +290,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile