Skip to content

Commit

Permalink
差分表示用のボタンを追加(無意味化もしれないが)
Browse files Browse the repository at this point in the history
  • Loading branch information
whistyun committed Jul 20, 2018
1 parent 578ac25 commit 8923bc4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
9 changes: 8 additions & 1 deletion MultiRept/Gui/ResultWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="185*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>

<Label
Expand All @@ -28,6 +29,7 @@

<Label x:Name="FolderLabel"
Grid.Row="0" Grid.Column="1"
Grid.ColumnSpan="2"
Content="Label"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
/>
Expand All @@ -44,9 +46,14 @@
HorizontalAlignment="Stretch" VerticalAlignment="Top"
/>

<Button
Grid.Row="1" Grid.Column="2"
Content="差分表示" Click="Button_Click"
/>

<DataGrid x:Name="dataGrid"
Grid.Row="2" Grid.Column="0"
Grid.ColumnSpan="2"
Grid.ColumnSpan="3"
AutoGenerateColumns="False"
ScrollViewer.CanContentScroll="True"
IsReadOnly ="True"
Expand Down
30 changes: 23 additions & 7 deletions MultiRept/Gui/ResultWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,32 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
{
DataGridRow row = sender as DataGridRow;
ResultData data = row.Item as ResultData;
ShowDiff(row.Item as ResultData);
}

private void Button_Click(object sender, RoutedEventArgs e)
{
var row = dataGrid.SelectedItem as ResultData;
if (row != null)
{
ShowDiff(row);
}

if (detailDic.ContainsKey(data.FilePath))
}

private void ShowDiff(ResultData data)
{
if (data != null)
{
//存在する場合は、Diff用のウィンドウを開く
var fileSet = detailDic[data.FilePath];
if (detailDic.ContainsKey(data.FilePath))
{
//存在する場合は、Diff用のウィンドウを開く
var fileSet = detailDic[data.FilePath];

var window = new DupleViewWindow();
window.Load(data.FilePath, fileSet.Item1, fileSet.Item2);
window.Show();
var window = new DupleViewWindow();
window.Load(data.FilePath, fileSet.Item1, fileSet.Item2);
window.Show();
}
}
}

Expand Down

0 comments on commit 8923bc4

Please sign in to comment.