-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
100 lines (96 loc) · 5.82 KB
/
MainWindow.xaml
File metadata and controls
100 lines (96 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<Window x:Class="BulkQuery.MainWindow"
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:BulkQuery"
xmlns:properties="clr-namespace:BulkQuery.Properties"
mc:Ignorable="d"
Title="Bulk Query" Height="500" Width="800" Loaded="Window_Loaded" Closing="Window_Closing" KeyDown="Window_KeyDown">
<Window.Resources>
<ResourceDictionary>
<Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
<Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
<EventSetter Event="PreviewMouseRightButtonDown" Handler="DatabasesTreeView_PreviewMouseButton" />
</Style>
<HierarchicalDataTemplate x:Key="CheckBoxItemTemplate" ItemsSource="{Binding Children, Mode=OneTime}">
<StackPanel Orientation="Horizontal">
<CheckBox Focusable="False" IsChecked="{Binding IsChecked}" VerticalAlignment="Center" />
<ContentPresenter x:Name="Content" Content="{Binding Name, Mode=OneTime}" Margin="2,0" />
</StackPanel>
</HierarchicalDataTemplate>
</ResourceDictionary>
</Window.Resources>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_Add Server..." Click="MenuItem_AddServer_OnClick" />
<MenuItem Header="_Hide System Databases" Name="MenuItemHideSystemDatabases" IsCheckable="True" IsChecked="{Binding Path=Settings.HideSystemDatabases, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
<MenuItem Focusable="False">
<MenuItem.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<Label Content="Sql Command Timeout (seconds):" Margin="0,3,6,0" Padding="0" />
<TextBox Margin="0,3,0,3" Grid.Column="1" PreviewTextInput="ValidateTextboxEntryIsInteger" Text="{Binding Path=Settings.SqlTimeout, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
</Grid>
</MenuItem.Header>
</MenuItem>
<MenuItem Header="_Exit" />
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="_Open User Settings" Click="MenuItem_OpenUserSettings_Click" Name="OpenUserSettingsMenuItem" />
<MenuItem Header="_View On Github" Click="MenuItem_Github_Click" Name="ViewOnGithubMenuItem" />
</MenuItem>
</Menu>
<Grid Name="MainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TreeView Grid.Column="0" x:Name="DatabasesTreeView"
ItemContainerStyle="{StaticResource TreeViewItemStyle}"
ItemTemplate="{StaticResource CheckBoxItemTemplate}" />
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" DragDelta="MainGrid_OnDragDelta" />
<Grid Grid.Column="2" Name="RightHandGrid">
<Grid.RowDefinitions>
<RowDefinition Height="250" />
<RowDefinition Height="5" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<DockPanel Grid.Row="0">
<StackPanel Margin="5" Orientation="Horizontal" DockPanel.Dock="Bottom">
<Button Name="RunQueryButton" Click="ButtonQuery_OnClick" Padding="10 2">Run Query (F5)</Button>
</StackPanel>
<avalonEdit:TextEditor
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
Name="QueryTextBox"
SyntaxHighlighting="TSQL"
FontFamily="Courier New"
FontSize="10pt"
ShowLineNumbers="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
LineNumbersForeground="#FF2B91AF"/>
</DockPanel>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" DragDelta="RightHandGrid_OnDragDelta" />
<DockPanel Grid.Row="2">
<Grid Grid.Column="2" Name="ResultsGrid">
<Grid.RowDefinitions>
<RowDefinition Height="0" Name="TextBoxMessagesRow" />
<RowDefinition Height="5" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox x:Name="TextBoxMessages" IsReadOnly="True" VerticalScrollBarVisibility="Auto" Foreground="Red" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" />
<DataGrid x:Name="ResultDataGrid" IsReadOnly="True" SelectionUnit="CellOrRowHeader" AreRowDetailsFrozen="True" Grid.Row="2" />
</Grid>
</DockPanel>
</Grid>
</Grid>
</DockPanel>
</Window>