-
Notifications
You must be signed in to change notification settings - Fork 1
/
XPathStudio.ps1
2460 lines (2273 loc) · 145 KB
/
XPathStudio.ps1
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
################################################################################################
# XPathStudio.ps1
#
# AUTHOR: Robin Granberg ([email protected])
#
# THIS CODE-SAMPLE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
# FITNESS FOR A PARTICULAR PURPOSE.
#
################################################################################################
<#-------------------------------------------------------------------------------
!! Version 1.0
10 Feb 2019
-------------------------------------------------------------------------------#>
Param
(
)
begin
{
$CurrentFSPath = split-path -parent $MyInvocation.MyCommand.Path
#JSON Input file wiht XML based XPath queries
$JSONFile = $CurrentFSPath + "\xpathfilter.json"
#Load Presentation Framework
Add-Type -Assembly PresentationFramework
$picCritical = @"
iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAKTSURBVDhPrZPdS5NxFMd9p/0BDQopvCiopnghglfe+AdYN6suYkiUF2uRXTmLVDaYMnEDSaKsLVqaS6ZLZuY2dLam1nLzZUvbLs
JtKkhYOGfefDvniWdNNy+CHvjA73fO95znvDxPHoD/Qk4jMzI8AqPBCHWzWoDPbDusE8ky2Efs6OzUw2S2YGzcjZnZgACf2cY+1hyOO3CxvLCgt/cxPA4nlvtf44tWh9CNRgQVDfDfuYs5Qw/c9jFBw9rM2PSB38KCgNWGmPIWfnR1IXz6FKI1NQhXV+PTyRP4eluFlWsKzFgGBW1mZelEXPIUVZJQtyAVjbIA6+3t+CCRYFpyDKGm
JiTIFltZwfLNRriGHUKb9PxNxEPk/hfML5FQqbBpMrFAeCJKJfwKBdaSKWzTPdDdjY6qKnh1f+YoLkBIxBvhYS6q72P2uBRBEq739eEXObf39hCJxRHf38e8Xo97+fnoKSjApPyqEMOx6US8Xt7MZ/llzFVWYpzEjuJirBoM+Lazg43dXSwZjWgheR9hp0TOigohhmOzEs3VX8RoYSEGyeyuq8MiVZWgiuLJJCIDA+iVSvGKfEOUyF
Venp1IbM3XcB1WFpWVYclqxSY5gy4X5onVVAprDgeelJbiHWk89ZeyWxOH7dXo4KmtRYiSbJEj7POhmSQPicjCAn6S7Tsl05WUwNemzR42w6vkldrlVxBobcXGxISQ5BnxhjAXFWErHMZHrRbmM2fhso1mr58RP0j30+cYOi+DlQbOg7URb4kp4hG11H/uAvykOfKDZMRfxElve/9Ag2maw6RMBg/hpfNMm0aohDVH/iIi/BYumfvn
YfJmGD6zjX2ZlYgcuGTCQ+SN8HoZPouDzUVO47+DvN9nk5bsfrodywAAAABJRU5ErkJggg==
"@
$picError = @"
iVBORw0KGgoAAAANSUhEUgAAABIAAAATCAYAAACdkl3yAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAIkSURBVDhPrVNLTxNRGOX3yMMIPnioUQGr1MRHUsWVqNGkmFilLmxdkuiuUPesoAkLNQ4B9pi2c8d2mqYPysbEX0BqwkrF4z1fue
MMUxYab3KSb86c79zvMdMD4L+gK0lYHy1kF7NIp9ICxuQO6wxCxJq1hmz2Ld69/4BPW1twy2UBY3J8R83hvMBDbiWH5eUVOJubaOgKtlMptJIvBIxrmQWojQ3RUOvP9QLeQkF1dRVNnbiTTGLn+Rx+7u0Jvi4sopV4hqbm3FznQn9lnhFLZiXNuSRaTxPYjs+i8egxhXK+zM+jfm8GjQcPUZt9ArW+Lm3q88eIQ2T/tUwGzXgc9Zn7
qN6ZRuX6DQrlkC9NXoZ7dUr4yus3kmMW0KlGz4PDrCcSYuBGo/h84SLUyChFcqqxGIqDQ7BPnRa+NH1XcpirT8eI6+VmKrHbKF0ahzozjOKJQRT6B/Brf59CuFNR5Pv6BeSLwyOSw1x6BIyciUnYQydRGDiOfG8f8sd6gQOj0viEPHvQupCRac25eUvfpm89MCHaSuGb68I5dz5gZEevhVszw3bSrwImhBodgzN2ttOWj3d0JaFhE1
xl0bJgRyKBBHPKkSseZ+u4oLWh9RPmg1RLSwGz77u7+NFuezOiCTVHfpCE+UV4m3qZkjnk9coJxmyH76g58hcx4C0smf1zmNwMwZgc3/krMQg8+MEhciNcL8HYDLYbupL/gq7k3wM9vwHRp84v4jR7bgAAAABJRU5ErkJggg==
"@
$picWarning = @"
iVBORw0KGgoAAAANSUhEUgAAABIAAAARCAYAAADQWvz5AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAGsSURBVDhPrY9LLwNhGIX7DyTUtEJIG627CBIL102jSAhbf8CWv2DrhyjCykK6cKkWrRJEhUaIltC4zHRmWtrFMe836UfbQYLFM/
PN+d73nDMmAP+CofiZgxUniEK9EEMxx/FqF07XbLgMNIPOhfefMRRzBOfNkG5dUB9HEPKUa5LxHGEoEtQg4q1FVp1g/NTKUCSCHjPkezc3Sj1938pQpOTzdSeyqUltwsTQW7V82apIIChZSQwhq4xzo0xyDKmE+8tWRQIlRrcakJXHkJFGP4xehhlXgSbDVnkfRGhB0JIHkRFH8PY8xI3eEi6GejsAmincy/ugJEp8vetHOt6HdKwX
01NVjPRNt06sB9c7jUWt+CF2NIvwkgVKtBPqeRvUsxYokWaGetaqa0S0HfJFB2tFO0VGlBAPOCEfOZEM25AM1SAZrOa/Joft7E45roNyUo+Y35HXij2uQjM4XLZqBnZIu5WQ/FZI2wJEn8CNpEAFuyNzQtq3IbwogHa5ETk/7DnYsLhVDnGzDOJGqf7mmPU7HyFoQRbEfTbeihlFvG545kp+Be1yo78D0zvkR2LiNXzWCAAAAABJRU
5ErkJggg==
"@
$picInformation = @"
iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAJUSURBVDhPrVNLaxNRGO3alZtuKooLXbh3IXThi7oQF4LgXqE/wP6DCnajC2mqxLYgVAehi6qBCDWQYGNM82gek6R5TWgeNkNMs6g
lJJLHcc5XJiaduBC8cODOne8793znzEwA+C8Ye0gobxUsPFnA3KM5Afc8O1lnwnKgKArm5x/j1fIynE4ngsGggHue8R1rTvaNPNjtdiwu2pDNZtFsNtHr9dDv99HtdtFqtVCv16GqqtSwdrh3sOEtLKjVatLM5fDs4cyNNZy9uYajo59oNBrQqzoy6bRRuzSibEBEyVRiknBtuDScurwiODBIqtUqiqUi8rkc/H6/jGmsP0Q0kfNzHC
5znGazhVLlANqeDl3XUSwWjctySCQSiER2pMcMQIiYCM0c9uRXu42Nzxlcf/ABM7MOFAoFpFIpgyAiajwej/Swd0DEeJkMSTqdjhh7eHgIxaHi9PQbTF59h2QyKSSBQABerxcul0t62GshopK2oYQkNH11PYzJa+uYmnkvaUWiUanz+Xxwu91WInM0UwlJyuUyXirbmLr1EedufxJfiHg8jqihbNsYzzKaafYP4zsxSTQtj+evv+L8n
U1cuOtGOpNBzkgrn89LuiS0mE0wSsovl0pSvJtK4tnqFi7e+4JL97+J2Uyt8r0iF4XDYWv8BD8um+2FkcyujBCLxfB0ZQtXHgYwPbsjzVS7X92Xi1g79oMkjn+RJYk3FAqJmWpChWY0Ho+riRKS/PUXMcFbKJnz00ySEdzzjO+GlZgYeRgGTWQijJfg3jR2HMYe/jsw8RuiSe+Il8ZhiAAAAABJRU5ErkJggg==
"@
Function WriteToImageFile
{
param($base64string, [string]$filepath)
if(!(Test-Path $filepath))
{
$bytes = [convert]::FromBase64String($base64string)
[IO.File]::WriteAllBytes($filepath,$bytes)
}
}
WriteToImageFile $picCritical $env:TEMP\Critical.png
WriteToImageFile $picError $env:TEMP\Error.png
WriteToImageFile $picWarning $env:TEMP\Warning.png
WriteToImageFile $picInformation $env:TEMP\Information.png
#==========================================================================
# Function : PingHost
# Arguments : host, timeout
# Returns : boolean
# Description : Ping a host and returns results in form of boolean
#
#==========================================================================
Function PingHost {
param([Array]$hostlist,[Array]$ports,[Int]$timeout = "1")
$ErrorActionPreference = "SilentlyContinue"
$ping = new-object System.Net.NetworkInformation.Ping
foreach ($ip in $hostlist)
{
$rslt = $ping.send($ip,$timeout)
if (! $?)
{
return $false
}
else
{
return $true
}
}
}
#==========================================================================
# Function : PortPing
# Arguments : host, port timeout
# Returns : boolean
# Description : Ping a port number and returns results in form of boolean
#
#==========================================================================
Function PortPing
{
Param([string]$srv,$port=135,$timeout=3000,[switch]$verbose)
# Test-Port.ps1
# Does a TCP connection on specified port (135 by default)
$ErrorActionPreference = "SilentlyContinue"
# Create TCP Client
$tcpclient = new-Object system.Net.Sockets.TcpClient
# Tell TCP Client to connect to machine on Port
$iar = $tcpclient.BeginConnect($srv,$port,$null,$null)
# Set the wait time
$wait = $iar.AsyncWaitHandle.WaitOne($timeout,$false)
# Check to see if the connection is done
if(!$wait)
{
# Close the connection and report timeout
$tcpclient.Close()
if($verbose){Write-Host "Connection Timeout"}
Return $false
}
else
{
# Close the connection and report the error if there is one
$error.Clear()
$tcpclient.EndConnect($iar) | out-Null
if(!$?){if($verbose){write-host $error[0]};$failed = $true}
$tcpclient.Close()
}
# Return $true if connection Establish else $False
if($failed){return $false}else{return $true}
}
#==========================================================================
# Function : LogMessage
# Arguments : Type of message, message, date stamping
# Returns : Custom psObject with two properties, type and message
# Description : This function creates a custom object that is used as input to an ListBox for logging purposes
#
#==========================================================================
function LogMessage
{
param (
[Parameter(
Mandatory = $true
)][String[]] $strType ,
[Parameter(
Mandatory = $true
)][String[]] $strMessage ,
[Parameter(
Mandatory = $false
)][switch]$DateStamp
)
process {
if ($DateStamp)
{
$newMessageObject = New-Object PSObject -Property @{Type="$strType";Message="[$(get-date -uformat %H:%M:%S)] $strMessage"}
}
else
{
$newMessageObject = New-Object PSObject -Property @{Type="$strType";Message="$strMessage"}
}
return $newMessageObject
}
}
$xamlBase =@"
<Window x:Class="WpfApplication1.PCRVS"
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:WpfApplication1"
Title="XPathStudio" WindowStartupLocation="CenterScreen" Height="500" Width="1023" ResizeMode="CanResizeWithGrip" WindowState="Maximized" >
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid Background="white">
<StackPanel Orientation="Vertical" >
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblXPath" Margin="0,0,0,0" Content="XPath Filter:" FontWeight="Bold" FontSize="14" HorizontalAlignment="Left" Foreground="#000000"/>
<Label x:Name="lblAuthor" Content="Author:Robin Granberg" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="#000000"/>
</StackPanel>
<TextBox x:Name="txtBoxXML" Margin="0,0,0,0" Text="" FontWeight="Normal" Width="900" Height="150" FontSize="14" HorizontalAlignment="LEft" Foreground="#00FF00" Background="Black" TextWrapping="WrapWithOverflow" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" />
<StackPanel Orientation="Horizontal" >
<GroupBox x:Name="gBoxHost" Header="Host" Height="152">
<StackPanel Orientation="Vertical" >
<TextBox x:Name="txtBoxHosts" Margin="0,5,0,0" Text="LocalHost" FontWeight="Normal" Width="230" Height="70" FontSize="14" VerticalAlignment="Top" Foreground="#000000" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" />
<CheckBox x:Name="chkBpxDC" Content="Domain Controllers" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="190" IsChecked="False"/>
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblMaxEvent" Margin="0,0,5,0" Content="Max Returned Events:" FontWeight="Normal" FontSize="12" VerticalAlignment="Center" Foreground="#000000"/>
<TextBox x:Name="txtMaxEvent" Margin="0,5,0,0" Text="100" FontWeight="Normal" Width="45" Height="20" FontSize="12" VerticalAlignment="Top" Foreground="#000000" />
</StackPanel>
</StackPanel>
</GroupBox>
<TabControl x:Name="tabFilter" HorizontalAlignment="Left" Height="152" Margin="10,0,0,0" VerticalAlignment="Top" Width="580">
<TabItem x:Name="tabNJSON" Header="xample Queries from xpathfilter.json" Height="22" VerticalAlignment="Top" >
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="160">
<StackPanel Orientation="Vertical">
<DataGrid x:Name="dgJSONInput" HorizontalAlignment="Left" Margin="0,0,0,0" Width="570" Height="120" GridLinesVisibility="All" AlternatingRowBackground="Lightblue" AlternationCount="2" IsReadOnly="True" FontSize="12" VerticalScrollBarVisibility="Visible" >
<DataGrid.Columns>
<DataGridTextColumn Header='Filter' Binding='{Binding Filter}' Width='410' />
<DataGridTextColumn Header='Category' Binding='{Binding Category}' Width='100' />
<DataGridTextColumn Header='XPath' Binding='{Binding XPath}' Width='80' Visibility="Collapsed" />
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabSyntax" Header="Syntax Support" Height="22" VerticalAlignment="Top">
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="160">
<StackPanel Orientation="Vertical">
<DataGrid x:Name="dgSyntax" HorizontalAlignment="Left" Margin="0,0,0,0" Height="120" Width="580" GridLinesVisibility="All" AlternatingRowBackground="Lightblue" AlternationCount="2" IsReadOnly="True" FontSize="12" VerticalScrollBarVisibility="Visible" >
<DataGrid.Resources>
<Style TargetType='DataGridCell'>
<Style.Triggers>
<Trigger Property='DataGridCell.IsSelected' Value="True">
<Setter Property="Background" Value='{x:Null}' />
<Setter Property="BorderBrush" Value='{x:Null}' />
<Setter Property="Foreground" Value='Black' />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header='Data' Binding='{Binding Data}' Width='230' />
<DataGridTemplateColumn Header='Example' Width='325'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Example}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
<GroupBox x:Name="gBoxStatus" Header="Log:" Height="150" Margin="0,0,0,0" VerticalAlignment="Top">
<ListBox x:Name="TextBoxStatusMessage" DisplayMemberPath="Message" SelectionMode="Extended" HorizontalAlignment="Left" Height="130" Margin="0,0,0,0" VerticalAlignment="Top" Width="360" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Type}" Value="Error">
<Setter Property="ListBoxItem.Foreground" Value="Red" />
<Setter Property="ListBoxItem.Background" Value="LightGray" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Type}" Value="Warning">
<Setter Property="ListBoxItem.Foreground" Value="Yellow" />
<Setter Property="ListBoxItem.Background" Value="Gray" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Type}" Value="Info">
<Setter Property="ListBoxItem.Foreground" Value="Black" />
<Setter Property="ListBoxItem.Background" Value="White" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</GroupBox>
<GroupBox x:Name="gBoxDisplayfilter" Header="Display filter" Height="150" Margin="0,0,0,0" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" >
<CheckBox x:Name="chkBoxDisplayFilter" Content="Use Display filter" HorizontalAlignment="Left" Height="18" Margin="0,5,0,0" VerticalAlignment="Top" Width="190" IsChecked="False"/>
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblProp" Margin="0,0,0,0" Content="Property:" FontSize="12" HorizontalAlignment="LEft" Foreground="#000000" Width="80"/>
<TextBox x:Name="txtProp" Margin="0,0,0,0" Text="" FontWeight="Normal" Width="200" Height="20" FontSize="12" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblOperator" Margin="0,0,0,0" Content="Operator:" FontSize="12" HorizontalAlignment="LEft" Foreground="#000000" Width="80"/>
<ComboBox x:Name="lbOperator" Margin="0,0,0,0" VerticalAlignment="Top" Width="90" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblString" Margin="0,0,0,0" Content="Value:" FontSize="12" HorizontalAlignment="LEft" Width="80"/>
<TextBox x:Name="txtString" Margin="0,0,0,0" Text="" FontWeight="Normal" Width="200" Height="20" FontSize="12" Foreground="#000000" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Button x:Name="btnApplyDisplayfilter" Content="Apply" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" IsEnabled="False"/>
<Button x:Name="btnClearDisplayfilter" Content="Clear" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" IsEnabled="False"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel >
<StackPanel Orientation="Horizontal" >
<Button x:Name="btnExit" Content="Exit" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnRun" Content="Run" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnReload" Content="Reload JSON file" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="100"/>
</StackPanel>
<TabControl x:Name="tabViews" HorizontalAlignment="Left" Height="600" Margin="10,10,0,0" VerticalAlignment="Top" Width="755">
<TabItem x:Name="tabNormal" Header="Standard" Height="22" VerticalAlignment="Top" >
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="570">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label x:Name="lblEventID" Margin="0,0,0,0" Content="Event IDs:" FontWeight="Bold" FontSize="14" HorizontalAlignment="LEft" Foreground="#000000"/>
<Button x:Name="btnExportStandard" Content="Export CSV" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnExportStandardExcel" Content="Export Excel" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
</StackPanel>
<DataGrid x:Name="dgEventIDs" HorizontalAlignment="Left" Margin="0,0,0,10" Width="750" MaxHeight="500" GridLinesVisibility="None" AlternationCount="2" IsReadOnly="True" FontSize="12">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding hidden}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header='Computer' Binding='{Binding MachineName}' Width='80' />
<DataGridTemplateColumn Header='Level' SortMemberPath='Level'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate >
<StackPanel Orientation='Horizontal' >
<Image Name='IsReadImage' Source='file:///$($env:TEMP)\Information.png' VerticalAlignment='Top' />
<TextBlock Text='{Binding LevelDisplayName}' />
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding='{Binding Level}' Value='1' >
<Setter TargetName='IsReadImage' Property='Source' Value='file:///$($env:TEMP)\Critical.png' />
</DataTrigger>
<DataTrigger Binding='{Binding Level}' Value='2' >
<Setter TargetName='IsReadImage' Property='Source' Value='file:///$($env:TEMP)\Error.png' />
</DataTrigger>
<DataTrigger Binding='{Binding Level}' Value='3' >
<Setter TargetName='IsReadImage' Property='Source' Value='file:///$($env:TEMP)\Warning.png' />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header='Date and Time' Binding='{Binding TimeCreated, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}' Width='SizeToCells' />
<DataGridTextColumn Header='Event ID' Binding='{Binding Id}' Width='65' />
<DataGridTextColumn Header='Source' Binding='{Binding ProviderName}' Width='120' />
<DataGridTemplateColumn Header='Message' Width='*' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Message}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabFW" Header="Firewall View" Height="22" VerticalAlignment="Top" >
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="570">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label x:Name="lblfw" Margin="0,0,0,0" Content="FW Event IDs:" FontWeight="Bold" FontSize="14" HorizontalAlignment="LEft" Foreground="#000000"/>
<Button x:Name="btnExportFW" Content="Export CSV" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnExportFWExcel" Content="Export Excel" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
</StackPanel>
<DataGrid x:Name="dgFWEventIDs" HorizontalAlignment="Left" Margin="0,0,0,10" Width="750" MaxHeight="500" GridLinesVisibility="None" AlternationCount="2" IsReadOnly="True" FontSize="12">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding hidden}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style TargetType='DataGridCell'>
<Style.Triggers>
<Trigger Property='DataGridCell.IsSelected' Value="True">
<Setter Property="Background" Value='{x:Null}' />
<Setter Property="BorderBrush" Value='{x:Null}' />
<Setter Property="Foreground" Value='Black' />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTemplateColumn Header='MachineName' Width='80' SortMemberPath='MachineName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding MachineName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TimeCreated' Width='SizeToCells' SortMemberPath='TimeCreated' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TimeCreated, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header='Action' Binding='{Binding Id}' Width='65' >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Id}" Value="5152">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Blocked" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="5157">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Blocked" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="5156">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Accepted" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Header='Direction' Binding='{Binding Direction}' Width='65' SortMemberPath='Direction' >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Direction}" Value="%%14592">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Inbound" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Direction}" Value="%%14593">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="OutBound" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Header='SourceAddress' Width='70' SortMemberPath='SourceAddress' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SourceAddress}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SourcePort' Width='65' SortMemberPath='SourcePort' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SourcePort}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='DestAddress' Width='70' SortMemberPath='DestAddress' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding DestAddress}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='DestPort' Width='70' SortMemberPath='DestPort' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding DestPort}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header='Protocol' Binding='{Binding Protocol}' Width='65' SortMemberPath='Protocol' >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Protocol}" Value="6">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="TCP" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Protocol}" Value="17">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="UDP" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Header='Application' Width='400' SortMemberPath='Application'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Application}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabLogon" Header="Logon View" Height="22" VerticalAlignment="Top" >
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="570">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label x:Name="lbllogon" Margin="0,0,0,0" Content="Logon Event IDs:" FontWeight="Bold" FontSize="14" HorizontalAlignment="LEft" Foreground="#000000"/>
<Button x:Name="btnExportLogon" Content="Export CSV" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnExportLogonExcel" Content="Export Excel" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
</StackPanel>
<DataGrid x:Name="dgLogonIDs" HorizontalAlignment="Left" Margin="0,0,0,10" Width="750" MaxHeight="500" GridLinesVisibility="None" AlternationCount="2" IsReadOnly="True" FontSize="12">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding hidden}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTemplateColumn Header='MachineName' Width='100' SortMemberPath='MachineName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding MachineName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TimeCreated' Width='SizeToCells' SortMemberPath='TimeCreated' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TimeCreated, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header='Action' Binding='{Binding Id}' Width='SizeToCells' >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Id}" Value="4672">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Special Logon" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4624">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Logon" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4648">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Logon" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4634">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Logoff" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4647">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Logoff" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4964">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Special Logon" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Header='LogonType' Width='SizeToCells' SortMemberPath='LogonType' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding LogonType}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TargetUserSid' Width='SizeToCells' SortMemberPath='TargetUserSid' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TargetUserSid}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TargetUserName' Width='SizeToCells' SortMemberPath='TargetUserName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TargetUserName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TargetDomainName' Width='SizeToCells' SortMemberPath='TargetDomainName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TargetDomainName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='ProcessID' Width='SizeToCells' SortMemberPath='ProcessID' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding ProcessID}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='ProcessName' Width='SizeToCells' SortMemberPath='ProcessName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding ProcessName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SubjectUserSid' Width='SizeToCells' SortMemberPath='SubjectUserSid' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SubjectUserSid}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SubjectUserName' Width='SizeToCells' SortMemberPath='SubjectUserName'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SubjectUserName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SubjectDomainName' Width='SizeToCells' SortMemberPath='SubjectDomainName'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SubjectDomainName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SubjectLogonID' Width='SizeToCells' SortMemberPath='SubjectLogonID'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SubjectLogonID}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='IpAddress' Width='SizeToCells' SortMemberPath='IpAddress'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding IpAddress}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='IpPort' Width='SizeToCells' SortMemberPath='IpPort'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding IpPort}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='SidList' Width='SizeToCells' SortMemberPath='SidList'>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding SidList}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabSysmon" Header="Sysmon View" Height="22" VerticalAlignment="Top" >
<Grid Background="AliceBlue" HorizontalAlignment="Left" VerticalAlignment="Top" Height="570">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label x:Name="lblSysmon" Margin="0,0,0,0" Content="Sysmon Event IDs:" FontWeight="Bold" FontSize="14" HorizontalAlignment="LEft" Foreground="#000000"/>
<Button x:Name="btnExportSysmon" Content="Export CSV" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnExportSysmonExcel" Content="Export Excel" HorizontalAlignment="Center" Margin="50,0,0,0" VerticalAlignment="Top" Width="75"/>
</StackPanel>
<DataGrid x:Name="dgSysmonIDs" HorizontalAlignment="Left" Margin="0,0,0,10" Width="750" MaxHeight="500" GridLinesVisibility="None" AlternationCount="2" IsReadOnly="True" FontSize="12">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding hidden}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTemplateColumn Header='MachineName' Width='100' SortMemberPath='MachineName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding MachineName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TimeCreated' Width='SizeToCells' SortMemberPath='TimeCreated' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding TimeCreated, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='Event Id' Width='SizeToCells' SortMemberPath='Id' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Id}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header='Category' Binding='{Binding Id}' Width='SizeToCells' >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Id}" Value="1">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Process Create" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="2">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="File creation time changed" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="3">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Network connection detected" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="4">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Sysmon service state changed" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="5">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="File creation time changed" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="6">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Driver loaded" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="7">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Image loaded" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="11">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="File created" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="17">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Pipe Created" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Id}" Value="18">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBox Text="Pipe Connected" BorderBrush='{x:Null}' Background='{x:Null}'/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Header='RuleName' Width='SizeToCells' SortMemberPath='RuleName' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding RuleName}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='UtcTime' Width='SizeToCells' SortMemberPath='UtcTime' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding UtcTime}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='ProcessGuid' Width='SizeToCells' SortMemberPath='ProcessGuid' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding ProcessGuid}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='ProcessId' Width='SizeToCells' SortMemberPath='ProcessId' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding ProcessId}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='Image' Width='SizeToCells' SortMemberPath='Image' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Image}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='FileVersion' Width='SizeToCells' SortMemberPath='FileVersion' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding FileVersion}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='Description' Width='SizeToCells' SortMemberPath='Description' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Description}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='Product' Width='SizeToCells' SortMemberPath='Product' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Product}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='Company' Width='SizeToCells' SortMemberPath='Company' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding Company}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='CommandLine' Width='SizeToCells' SortMemberPath='CommandLine' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding CommandLine}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='CurrentDirectory' Width='SizeToCells' SortMemberPath='CurrentDirectory' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding CurrentDirectory}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='User' Width='SizeToCells' SortMemberPath='User' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding User}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='LogonGuid' Width='SizeToCells' SortMemberPath='LogonGuid' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding LogonGuid}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='LogonId' Width='SizeToCells' SortMemberPath='LogonId' >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text='{Binding LogonId}' BorderBrush='{x:Null}' Background='{x:Null}' />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header='TerminalSessionId' Width='SizeToCells' SortMemberPath='TerminalSessionId' >
<DataGridTemplateColumn.CellTemplate>