Move WorkProgress dialog into CommonWPF library

This commit is contained in:
Andy McFadden 2019-07-19 16:37:51 -07:00
parent be0e6bead1
commit b6132b029a
5 changed files with 21 additions and 11 deletions

View File

@ -65,6 +65,9 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="WindowPlacement.cs" />
<Compile Include="WorkProgress.xaml.cs">
<DependentUpon>WorkProgress.xaml</DependentUpon>
</Compile>
<Compile Include="WPFExtensions.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@ -75,5 +78,11 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="WorkProgress.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -14,17 +14,23 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<Window x:Class="SourceGenWPF.WpfGui.WorkProgress"
<Window x:Class="CommonWPF.WorkProgress"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SourceGenWPF.AsmGen.WpfGui"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:CommonWPF"
mc:Ignorable="d"
Title="Progress"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
Loaded="Window_Loaded" Closing="Window_Closing">
<Window.Resources>
<system:String x:Key="str_OperationFailedCaption">Failed</system:String>
</Window.Resources>
<StackPanel Margin="8">
<TextBlock Name="messageText" HorizontalAlignment="Left" Text="Preparing..."/>
<ProgressBar Name="progressBar" Width="600" Height="23" Margin="0,8,0,0"/>

View File

@ -18,7 +18,7 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
namespace SourceGenWPF.WpfGui {
namespace CommonWPF {
/// <summary>
/// Cancelable progress dialog.
/// </summary>
@ -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 {

View File

@ -23,6 +23,7 @@ using System.Windows;
using System.Windows.Controls;
using CommonUtil;
using CommonWPF;
using SourceGenWPF.WpfGui;
namespace SourceGenWPF.AsmGen.WpfGui {

View File

@ -130,9 +130,6 @@
<Compile Include="Tools\WpfGui\HexDumpViewer.xaml.cs">
<DependentUpon>HexDumpViewer.xaml</DependentUpon>
</Compile>
<Compile Include="WpfGui\WorkProgress.xaml.cs">
<DependentUpon>WorkProgress.xaml</DependentUpon>
</Compile>
<Compile Include="AsmGen\WpfGui\GenAndAsm.xaml.cs">
<DependentUpon>GenAndAsm.xaml</DependentUpon>
</Compile>
@ -293,10 +290,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WpfGui\WorkProgress.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="AsmGen\WpfGui\GenAndAsm.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>