Browse Source

Support copy entries from resource string table

pull/226/head
Ronny Klier 15 years ago
parent
commit
e63cbb6175
  1. 5
      ILSpy/Controls/ResourceStringTable.xaml
  2. 10
      ILSpy/Controls/ResourceStringTable.xaml.cs

5
ILSpy/Controls/ResourceStringTable.xaml

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<UserControl <UserControl
x:Class="ICSharpCode.ILSpy.Controls.ResourceStringTable" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls"> x:Class="ICSharpCode.ILSpy.Controls.ResourceStringTable" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UserControl.CommandBindings> <UserControl.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy" <CommandBinding Command="ApplicationCommands.Copy"
Executed="ExecuteCopy" Executed="ExecuteCopy"
CanExecute="CanExecuteCopy"/> CanExecute="CanExecuteCopy"/>
</UserControl.CommandBindings> </UserControl.CommandBindings>
<ListView <ListView
Name="resourceListView"> Name="resourceListView"
SelectionMode="Extended">
<ListView.View> <ListView.View>
<GridView <GridView
AllowsColumnReorder="False"> AllowsColumnReorder="False">

10
ILSpy/Controls/ResourceStringTable.xaml.cs

@ -35,10 +35,12 @@ namespace ICSharpCode.ILSpy.Controls
void ExecuteCopy(object sender, ExecutedRoutedEventArgs args) void ExecuteCopy(object sender, ExecutedRoutedEventArgs args)
{ {
if (resourceListView.SelectionMode == SelectionMode.Single) StringBuilder sb = new StringBuilder();
return; foreach (var item in resourceListView.SelectedItems)
else if (resourceListView.SelectionMode == SelectionMode.Multiple) {
return; sb.AppendLine(item.ToString());
}
Clipboard.SetText(sb.ToString());
} }
void CanExecuteCopy(object sender, CanExecuteRoutedEventArgs args) void CanExecuteCopy(object sender, CanExecuteRoutedEventArgs args)

Loading…
Cancel
Save