Skip to content

Commit 94a5297

Browse files
committed
Add Help button
1 parent 13d3cff commit 94a5297

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/StructuredLogViewer/Controls/GraphHostControl.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Input;
@@ -49,7 +50,12 @@ public Digraph Graph
4950
private void UpdateVisibility()
5051
{
5152
var textVisibility = DisplayText != null ? Visibility.Visible : Visibility.Collapsed;
52-
var searchVisibility = GoToSearch != null ? Visibility.Visible : Visibility.Collapsed;
53+
var searchVisibility =
54+
GoToSearch != null &&
55+
graphControl != null &&
56+
graphControl.SelectedVertex != null
57+
? Visibility.Visible
58+
: Visibility.Collapsed;
5359
showTextButton.Visibility = textVisibility;
5460
searchButton.Visibility = searchVisibility;
5561
}
@@ -124,6 +130,19 @@ private void Initialize()
124130
Margin = new Thickness(0, 0, 8, 0)
125131
};
126132

133+
var helpButton = new Button
134+
{
135+
Content = "Help",
136+
VerticalAlignment = VerticalAlignment.Center,
137+
Margin = new Thickness(0, 0, 8, 0),
138+
BorderThickness = new Thickness()
139+
};
140+
141+
helpButton.Click += (s, e) =>
142+
{
143+
Process.Start(new ProcessStartInfo("https://github.com/KirillOsenkov/MSBuildStructuredLog/wiki/Graph") { UseShellExecute = true });
144+
};
145+
127146
showTextButton.Click += (s, e) =>
128147
{
129148
var text = graph.GetDotText(transitiveReduceCheck.IsChecked == true);
@@ -134,6 +153,7 @@ private void Initialize()
134153
toolbar.Children.Add(transitiveReduceCheck);
135154
toolbar.Children.Add(searchTextBox);
136155
toolbar.Children.Add(locateButton);
156+
toolbar.Children.Add(helpButton);
137157

138158
topToolbar.Children.Add(searchButton);
139159
topToolbar.Children.Add(projectNameTextBlock);

0 commit comments

Comments
 (0)