2021-09-20 18:20:01 +02:00

149 lines
8.9 KiB
XML

<!--
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
-->
<winlocal:WindowBase x:Class="dnSpy.AsmEditor.Compiler.EditCodeDlg"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:winlocal="clr-namespace:dnSpy.Contracts.Controls;assembly=dnSpy.Contracts.DnSpy"
xmlns:img="clr-namespace:dnSpy.Contracts.Images;assembly=dnSpy.Contracts.DnSpy"
xmlns:mvvm="clr-namespace:dnSpy.Contracts.MVVM;assembly=dnSpy.Contracts.DnSpy"
xmlns:p="clr-namespace:dnSpy.AsmEditor.Properties"
Height="730" Width="1300"
Title="{x:Static p:dnSpy_AsmEditor_Resources.EditCodeTitle}"
Style="{StaticResource DialogWindowStyle}" WindowStartupLocation="CenterOwner"
MinHeight="300" MinWidth="500">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="6*" />
<RowDefinition Height="6" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" Content="{Binding SelectedDocument.TextViewHost.HostControl}" />
<Border Grid.Row="0"
Name="decompilingControl"
Background="{DynamicResource DecompilerTextViewWaitAdornerBackground}"
TextBlock.Foreground="{DynamicResource DecompilerTextViewWaitAdornerForeground}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Name="decompilingControl_textBlock" Text="{x:Static p:dnSpy_AsmEditor_Resources.Decompiling}" FontSize="14pt" HorizontalAlignment="Center" />
<ProgressBar Name="progressBar" IsIndeterminate="True" Height="16" MinWidth="200" Margin="0 4" HorizontalAlignment="Center" />
</StackPanel>
</Border>
<GridSplitter Grid.Row="1" Panel.ZIndex="1" Margin="0 -5" BorderThickness="0 5" HorizontalAlignment="Stretch" VerticalAlignment="Center" Focusable="False" BorderBrush="Transparent" />
<ListView Grid.Row="2"
MouseDoubleClick="diagnosticsListView_MouseDoubleClick"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling"
mvvm:AutomationPeerMemoryLeakWorkaround.Initialize="True"
BorderThickness="0"
img:DsImage.BackgroundColor="{x:Null}"
img:DsImage.BackgroundBrush="{x:Null}"
IsEnabled="{Binding CanCompile}"
Name="diagnosticsListView"
SelectionMode="Extended"
ItemsSource="{Binding Diagnostics}"
SelectedItem="{Binding SelectedCompilerDiagnosticVM}">
<ListView.Resources>
<Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" BasedOn="{StaticResource CilGridViewScrollViewerStyle}" TargetType="{x:Type ScrollViewer}" />
</ListView.Resources>
<ListView.View>
<GridView AllowsColumnReorder="True">
<GridViewColumn Header="" Width="16">
<GridViewColumn.CellTemplate>
<DataTemplate>
<!-- Fix hard coded 6,0,6,0 margin -->
<img:DsImage Margin="-6 0" ImageReference="{Binding ImageReference}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="{x:Static p:dnSpy_AsmEditor_Resources.CompileDiagnostics_Header_Code}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock>
<Hyperlink Command="{Binding ShowHelpCommand}">
<Run Text="{Binding Code, Mode=OneWay}" />
</Hyperlink>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="{x:Static p:dnSpy_AsmEditor_Resources.CompileDiagnostics_Header_Description}" Width="1000">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="{x:Static p:dnSpy_AsmEditor_Resources.CompileDiagnostics_Header_File}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding File}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="{x:Static p:dnSpy_AsmEditor_Resources.CompileDiagnostics_Header_Line}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Line}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>
<Grid Grid.Row="1" Margin="5 0 5 5" img:DsImage.BackgroundBrush="{DynamicResource DialogWindowBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ComboBox Grid.Row="0" Margin="0 0 5 0" HorizontalAlignment="Stretch" DisplayMemberPath="Name" ItemsSource="{Binding Documents}" SelectedItem="{Binding SelectedDocument}" VerticalContentAlignment="Center" Width="100" IsEnabled="{Binding CanCompile}" />
<Button Grid.Column="1" Margin="0 0 5 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding AddAssemblyReferenceCommand}" ToolTip="{Binding AddAssemblyReferenceToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.OpenFolder}"/>
</Button>
<Button Grid.Column="2" Margin="0 0 5 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding AddGacReferenceCommand}" ToolTip="{Binding AddGacReferenceToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.Library}"/>
</Button>
<Button Grid.Column="3" Margin="0 0 5 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding AddDocumentsCommand}" ToolTip="{Binding AddDocumentsToolTip}">
<img:DsImage ImageReference="{Binding AddDocumentsImage}"/>
</Button>
<Button Grid.Column="5" Content="{x:Static p:dnSpy_AsmEditor_Resources.Button_Compile}" IsDefault="True" Command="{Binding CompileCommand}" Style="{StaticResource DialogButton}" Margin="0 0 5 0" />
<Button Grid.Column="6" Content="{x:Static p:dnSpy_AsmEditor_Resources.Button_Cancel2}" Style="{StaticResource DialogButton}" Margin="0 0 0 0" Click="cancelButton_Click" />
</Grid>
</Grid>
</winlocal:WindowBase>