-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfilerWindow.xaml
More file actions
257 lines (216 loc) · 12.6 KB
/
ProfilerWindow.xaml
File metadata and controls
257 lines (216 loc) · 12.6 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<Window x:Class="SkyLineSQL.ProfilerWindow"
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:SkyLineSQL"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"
Title="SQL Profiler" Height="500" Width="800"
WindowStartupLocation="Manual"
WindowStyle="SingleBorderWindow"
ResizeMode="CanResizeWithGrip"
ShowActivated="True"
ShowInTaskbar="True"
AllowsTransparency="False"
Background="Transparent"
FontFamily="Segoe UI">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="#FFF" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="BorderBrush" Value="#FFAE00"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style x:Key="myDataGridCell" TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0.2" />
<Setter Property="BorderBrush" Value="#FFAE00"/>
<Setter Property="BorderThickness" Value="1"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFAE00" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#2D2D30"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Padding" Value="4,2"/>
<Setter Property="BorderBrush" Value="#FFAE00"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style TargetType="DataGrid">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="RowHeight" Value="25" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="RowBackground" Value="Transparent" />
<Setter Property="GridLinesVisibility" Value="None" />
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="EnableRowVirtualization" Value="True" />
<Setter Property="EnableColumnVirtualization" Value="False" />
<Setter Property="AllowDrop" Value="False" />
<Setter Property="CanUserAddRows" Value="False" />
<Setter Property="CanUserDeleteRows" Value="False" />
<Setter Property="CanUserResizeRows" Value="False" />
<Setter Property="CanUserResizeColumns" Value="False" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="IsSynchronizedWithCurrentItem" Value="True" />
<Setter Property="HeadersVisibility" Value="Column" />
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontFamily" Value="JetBrainsMono" />
<Setter Property="BorderBrush" Value="#FFAE00"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CellStyle" Value="{StaticResource myDataGridCell}"/>
</Style>
<Style TargetType="Label">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
</Style>
<Style TargetType="Button">
<Setter Property="Background" Value="#FF333333" />
<!-- Dark Background -->
<Setter Property="Foreground" Value="#eee" />
<!-- Border Thickness -->
<Setter Property="Padding" Value="5,5,5,5" />
<!-- Button Padding -->
<Setter Property="BorderBrush" Value="#FFAE00"/>
<Setter Property="BorderThickness" Value="1"/>
<!-- MouseOver State -->
<Style.Triggers>
<!-- Pressed State -->
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FF666666" />
<Setter Property="Foreground" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#FF666666" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border CornerRadius="5" BorderThickness="2" Background="#26282A" Padding="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5"/>
<RowDefinition Height="25"/>
<RowDefinition />
<RowDefinition Height="120"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Row="1" Grid.Column="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="3" Orientation="Horizontal">
<Button Padding="0" Margin="5 0" Width="30" Command="{Binding Path=StopProfilerCommand}" CommandParameter="{Binding ElementName=main_Window}">
<iconPacks:BootstrapIcons Kind="Eraser" />
</Button>
<TextBox HorizontalAlignment="Center" Width="200"></TextBox>
<Button Padding="5 0">
<iconPacks:BootstrapIcons Kind="Search" />
</Button>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button Padding="0" Margin="1 0" Width="30" Command="{Binding Path=StartProfilerCommand}" CommandParameter="{Binding ElementName=main_Window}">
<iconPacks:BootstrapIcons Kind="Play" />
</Button>
<Separator Width="100" Visibility="Hidden"></Separator>
<Button Padding="0" Margin="5 0" Width="30" Command="{Binding Path=PauseProfilerCommand}" CommandParameter="{Binding ElementName=main_Window}">
<iconPacks:BootstrapIcons Kind="Pause" />
</Button>
<Button Padding="0" Margin="5 0" Width="30" Command="{Binding Path=StopProfilerCommand}" CommandParameter="{Binding ElementName=main_Window}">
<iconPacks:BootstrapIcons Kind="Stop" />
</Button>
</StackPanel>
</Grid>
<DataGrid Grid.Row="2" Margin="0 5" BorderBrush="#FFAE00" BorderThickness="1"
AutoGenerateColumns="False" CanUserAddRows="False"
ItemsSource="{Binding Events}" SelectedItem="{Binding SelectedEvent}" VerticalScrollBarVisibility="Auto">
<DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="Text Data">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding TextData}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="100" Header="Login name">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LoginName}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="50" Header="CPU">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding CPU}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="50" Header="Reads">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Reads}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="50" Header="Writes">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Writes}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="60" Header="Duration">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Duration}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="50" Header="SPID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding SPID}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTemplateColumn Width="130" Header="Start time">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding StartTime}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="130" Header="End time">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding EndTime}" Margin="0" Padding="5 0" TextAlignment="Left" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<Border Grid.Row="3" BorderBrush="#FF999999" BorderThickness="1">
<TextBox Foreground="White" IsReadOnly="True" FontWeight="Medium" TextWrapping="Wrap"
Text="{Binding SelectedEvent.TextData, UpdateSourceTrigger=PropertyChanged}"></TextBox>
</Border>
</Grid>
</Border>
</Window>