├── .gitignore ├── LICENSE ├── README.md ├── release ├── ScriptDomVisualizer.1.0.zip ├── ScriptDomVisualizer.2.0.zip ├── ScriptDomVisualizer.2.1.zip └── ScriptDomVisualizer.2.2.zip └── src ├── ScriptDomVisualizer.sln └── ScriptDomVisualizer ├── App.config ├── App.xaml ├── App.xaml.cs ├── EnumeratorVisitor.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── ScriptDomVisualizer.csproj ├── s.ico └── s.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studo 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | *_i.c 42 | *_p.c 43 | *_i.h 44 | *.ilk 45 | *.meta 46 | *.obj 47 | *.pch 48 | *.pdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | # The packages folder can be ignored because of Package Restore 140 | **/packages/* 141 | # except build/, which is used as an MSBuild target. 142 | !**/packages/build/ 143 | # Uncomment if necessary however generally it will be regenerated when needed 144 | #!**/packages/repositories.config 145 | 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | 150 | # Windows Store app package directory 151 | AppPackages/ 152 | 153 | # Others 154 | *.[Cc]ache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | bower_components/ 165 | 166 | # RIA/Silverlight projects 167 | Generated_Code/ 168 | 169 | # Backup & report files from converting an old project file 170 | # to a newer Visual Studio version. Backup files are not needed, 171 | # because we have git ;-) 172 | _UpgradeReport_Files/ 173 | Backup*/ 174 | UpgradeLog*.XML 175 | UpgradeLog*.htm 176 | 177 | # SQL Server files 178 | *.mdf 179 | *.ldf 180 | 181 | # Business Intelligence projects 182 | *.rdl.data 183 | *.bim.layout 184 | *.bim_*.settings 185 | 186 | # Microsoft Fakes 187 | FakesAssemblies/ 188 | 189 | # Node.js Tools for Visual Studio 190 | .ntvs_analysis.dat 191 | 192 | # Visual Studio 6 build log 193 | *.plg 194 | 195 | # Visual Studio 6 workspace options file 196 | *.opt 197 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Ed Elliott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ScriptDomVisualizer 2 | 3 | Using the Microsoft TSql Script Dom to generate code is quite hard as you need to know what types of objects you need to put into the AST at the right place and I usually end up nose deep in a debugger trying to remember property names and types. 4 | 5 | This is a simple tool that lets you put in some t-sql and see what types / properties are needed to use the Script Dom to create the object you would like. 6 | 7 | Nothing earth shattering but saves me time :) 8 | -------------------------------------------------------------------------------- /release/ScriptDomVisualizer.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/release/ScriptDomVisualizer.1.0.zip -------------------------------------------------------------------------------- /release/ScriptDomVisualizer.2.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/release/ScriptDomVisualizer.2.0.zip -------------------------------------------------------------------------------- /release/ScriptDomVisualizer.2.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/release/ScriptDomVisualizer.2.1.zip -------------------------------------------------------------------------------- /release/ScriptDomVisualizer.2.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/release/ScriptDomVisualizer.2.2.zip -------------------------------------------------------------------------------- /src/ScriptDomVisualizer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptDomVisualizer", "ScriptDomVisualizer\ScriptDomVisualizer.csproj", "{598C2FD0-4048-4764-9F28-0CA9BB687F1B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {598C2FD0-4048-4764-9F28-0CA9BB687F1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {598C2FD0-4048-4764-9F28-0CA9BB687F1B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {598C2FD0-4048-4764-9F28-0CA9BB687F1B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {598C2FD0-4048-4764-9F28-0CA9BB687F1B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace ScriptDomVisualizer 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/EnumeratorVisitor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.SqlServer.TransactSql.ScriptDom; 7 | 8 | namespace ScriptDomVisualizer 9 | { 10 | public class EnumeratorVisitor : TSqlFragmentVisitor 11 | { 12 | public List Nodes = new List(); 13 | 14 | public override void Visit(TSqlStatement node) 15 | { 16 | base.Visit(node); 17 | 18 | if(!Nodes.Any(p=>p.StartOffset <= node.StartOffset && p.StartOffset + p.FragmentLength >= node.StartOffset + node.FragmentLength)) 19 | Nodes.Add(node); 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ed@agilesql.co.uk 21 | 22 | 23 | 7 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows; 11 | using System.Windows.Controls; 12 | using System.Windows.Data; 13 | using System.Windows.Documents; 14 | using System.Windows.Input; 15 | using System.Windows.Media; 16 | using System.Windows.Media.Imaging; 17 | using System.Windows.Navigation; 18 | using System.Windows.Shapes; 19 | using Microsoft.SqlServer.TransactSql.ScriptDom; 20 | 21 | namespace ScriptDomVisualizer 22 | { 23 | /// 24 | /// Interaction logic for MainWindow.xaml 25 | /// 26 | public partial class MainWindow : Window 27 | { 28 | private static Assembly ScriptDom; 29 | 30 | static MainWindow() 31 | { 32 | ScriptDom = Assembly.Load("Microsoft.SqlServer.TransactSql.ScriptDom"); 33 | } 34 | 35 | public MainWindow() 36 | { 37 | InitializeComponent(); 38 | 39 | Results.SelectedItemChanged += Results_SelectedItemChanged; 40 | Tokens.SelectedItemChanged += Tokens_SelectedItemChanged; 41 | } 42 | 43 | private void Tokens_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) 44 | { 45 | var item = (e.NewValue as TreeViewItem); 46 | if (item == null) 47 | return; 48 | 49 | var token = item.Tag as TSqlParserToken; 50 | 51 | if (null == token) 52 | return; 53 | 54 | _userChanges = false; 55 | var currentRange = InputBox.Selection; 56 | currentRange.Select(currentRange.Start.DocumentStart, currentRange.Start.DocumentEnd); 57 | currentRange.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Black)); 58 | 59 | //if (token.of== -1 || fragment.FragmentLength == -1) 60 | // return; 61 | 62 | try 63 | { 64 | 65 | currentRange = InputBox.Selection; 66 | 67 | 68 | var start = GetPoint(InputBox.Document.ContentStart, token.Offset); 69 | var end = GetPoint(InputBox.Document.ContentStart, token.Offset + token.Text.Length); 70 | currentRange.Select(start, end); 71 | 72 | var t = currentRange.Text; 73 | 74 | currentRange.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Blue)); 75 | } 76 | catch (Exception esss) { Console.WriteLine(esss); } 77 | _userChanges = true; 78 | 79 | 80 | } 81 | 82 | private void Results_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) 83 | { 84 | var item = (e.NewValue as TreeViewItem); 85 | if (item == null) 86 | return; 87 | 88 | 89 | var fragment = TryGetTag(item); 90 | 91 | if (null == fragment) 92 | return; 93 | 94 | _userChanges = false; 95 | var currentRange = InputBox.Selection; 96 | currentRange.Select(currentRange.Start.DocumentStart, currentRange.Start.DocumentEnd); 97 | currentRange.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Black)); 98 | 99 | if (fragment.StartOffset == -1 || fragment.FragmentLength == -1) 100 | return; 101 | 102 | try 103 | { 104 | 105 | currentRange = InputBox.Selection; 106 | 107 | 108 | var start = GetPoint(InputBox.Document.ContentStart, fragment.StartOffset); 109 | var end = GetPoint(InputBox.Document.ContentStart, fragment.FragmentLength + fragment.StartOffset); 110 | currentRange.Select(start, end); 111 | 112 | var t = currentRange.Text; 113 | 114 | currentRange.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Blue)); 115 | }catch(Exception esss) { Console.WriteLine(esss); } 116 | _userChanges = true; 117 | } 118 | 119 | private static TextPointer GetPoint(TextPointer start, int x) 120 | { 121 | var ret = start; 122 | var i = 0; 123 | while (ret != null) 124 | { 125 | string stringSoFar = new TextRange(ret, ret.GetPositionAtOffset(i, LogicalDirection.Forward)).Text; 126 | if (stringSoFar.Length == x) 127 | break; 128 | i++; 129 | if (ret.GetPositionAtOffset(i, LogicalDirection.Forward) == null) 130 | return ret.GetPositionAtOffset(i - 1, LogicalDirection.Forward); 131 | 132 | } 133 | ret = ret.GetPositionAtOffset(i, LogicalDirection.Forward); 134 | return ret; 135 | } 136 | 137 | public TreeViewItem GetSelectedTreeViewItemParent(TreeViewItem item) 138 | { 139 | DependencyObject parent = VisualTreeHelper.GetParent(item); 140 | while (!(parent is TreeViewItem || parent is TreeView)) 141 | { 142 | parent = VisualTreeHelper.GetParent(parent); 143 | } 144 | 145 | return parent as TreeViewItem; 146 | } 147 | 148 | private TSqlFragment TryGetTag(TreeViewItem item) 149 | { 150 | if (item.Tag is TSqlFragment) 151 | { 152 | return item.Tag as TSqlFragment; 153 | } 154 | 155 | 156 | var node = item; 157 | while (node.Parent != null) 158 | { 159 | if (node.Tag is TSqlFragment) 160 | return node.Tag as TSqlFragment; 161 | 162 | node = GetSelectedTreeViewItemParent(node); 163 | } 164 | 165 | return null; 166 | } 167 | 168 | bool _userChanges = true; 169 | 170 | 171 | private void Parse() 172 | { 173 | Errors.Text = ""; 174 | MaxDepth = Int32.Parse(DepthText.Text); 175 | 176 | var parser = new TSql120Parser(true); 177 | 178 | IList errors; 179 | var script = parser.Parse(new StringReader(GetText()), out errors); 180 | 181 | if (errors.Count > 0) 182 | { 183 | 184 | Errors.Text = ""; 185 | foreach (var e in errors) 186 | { 187 | Errors.Text += "Error: " + e.Message + " at: " + e.Offset + "\r\n"; 188 | } 189 | 190 | 191 | return; 192 | } 193 | var enumerator = new EnumeratorVisitor(); 194 | script.Accept(enumerator); 195 | Results.Items.Clear(); 196 | 197 | foreach (var node in enumerator.Nodes) 198 | { 199 | 200 | foreach (var i in GetChildren(node)) 201 | { 202 | Results.Items.Add(i); 203 | } 204 | } 205 | 206 | Tokens.Items.Clear(); 207 | var newItem = new TreeViewItem(); 208 | newItem.Header = "Tokens"; 209 | newItem.IsExpanded = true; 210 | 211 | foreach (var t in script.ScriptTokenStream) 212 | { 213 | var newChild = new TreeViewItem(); 214 | newChild.Header = string.Format("{0} : {1} : {2} : {3}", t.TokenType, t.Text, t.Offset, t.Column); 215 | newItem.Items.Add(newChild); 216 | newChild.Tag = t; 217 | } 218 | 219 | Tokens.Items.Add(newItem); 220 | 221 | } 222 | 223 | private string GetText() 224 | { 225 | return new TextRange(InputBox.Document.ContentStart, InputBox.Document.ContentEnd).Text; 226 | } 227 | 228 | private int MaxDepth = 10; 229 | 230 | private List GetChildren(object node, int depth = 0) 231 | { 232 | var items = new List(); 233 | 234 | if (depth++ > MaxDepth || IgnoreType(node)) 235 | return items; 236 | 237 | if (node is IEnumerable) 238 | { 239 | var collectionNode = new TreeViewItem(); 240 | collectionNode.Header = TidyTypeName(node.GetType().FullName) + " + COLLECTION"; 241 | collectionNode.Tag = GetTag(node as TSqlFragment); 242 | foreach (var child in node as IEnumerable) 243 | { 244 | var children = GetChildren(child, depth); 245 | foreach (var c in children) 246 | { 247 | collectionNode.Items.Add(c); 248 | } 249 | } 250 | items.Add(collectionNode); 251 | return items; 252 | } 253 | 254 | var nodeType = node.ToString().Split(' ')[0]; 255 | var t = ScriptDom.GetType(nodeType, false, true); 256 | 257 | if (t == null) 258 | { 259 | var item = new TreeViewItem(); 260 | item.Header = TidyTypeName(node.GetType().FullName) + " : " + node.ToString(); 261 | items.Add(item); 262 | return items; 263 | } 264 | var newItem = new TreeViewItem(); 265 | newItem.Header = TidyTypeName(node.GetType().FullName); 266 | newItem.Tag = GetTag(node as TSqlFragment); 267 | 268 | foreach (var p in t.GetProperties()) 269 | { 270 | //ret += p.Name + " : " + p.GetValue(node) + " : " + p.GetType(); 271 | 272 | var item = new TreeViewItem(); 273 | item.Header = TidyTypeName(p.Name) + " : " + TidyTypeName(p.GetType().FullName) + " = " + TryGetValue(p, node); 274 | item.Tag = GetTag(TryGetValue(p, node) as TSqlFragment); 275 | newItem.Items.Add(item); 276 | switch (p.Name) 277 | { 278 | case "ScriptTokenStream": 279 | break; 280 | 281 | default: 282 | //ret += "\t\t" + GetChildren(p, depth) + "\r\n"; 283 | foreach (var i in GetChildren( TryGetValue(p, node), depth)) 284 | { 285 | item.Items.Add(i); 286 | } 287 | 288 | break; 289 | } 290 | 291 | 292 | } 293 | 294 | 295 | items.Add(newItem); 296 | return items; 297 | 298 | } 299 | 300 | private TSqlFragment GetTag(TSqlFragment sqlFragment) 301 | { 302 | return sqlFragment; 303 | } 304 | 305 | private object TryGetValue(PropertyInfo propertyInfo, object node) 306 | { 307 | try 308 | { 309 | return propertyInfo.GetValue(node); 310 | } 311 | catch (Exception) 312 | { 313 | return ""; 314 | } 315 | } 316 | 317 | private string TidyTypeName(string fullName) 318 | { 319 | return 320 | fullName.Replace("Microsoft.SqlServer.TransactSql.ScriptDom.", "") 321 | .Replace("System.Collections.Generic.List`1[[", "List<") 322 | .Replace("System.Reflection.RuntimePropertyInfo", ""); 323 | } 324 | 325 | private bool IgnoreType(object node) 326 | { 327 | if (node == null) 328 | return true; 329 | 330 | 331 | var type = node.GetType(); 332 | Console.WriteLine(type); 333 | 334 | if (node.ToString().Contains("Microsoft.SqlServer.TransactSql.ScriptDom")) 335 | { 336 | return false; 337 | } 338 | 339 | return !type.FullName.Contains("Microsoft.SqlServer.TransactSql.ScriptDom"); 340 | } 341 | 342 | private void UIElement_OnKeyUp(object sender, KeyEventArgs e) 343 | { 344 | if (e.Key == Key.Enter && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))) 345 | Parse(); 346 | } 347 | 348 | private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 349 | { 350 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); 351 | e.Handled = true; 352 | } 353 | } 354 | } 355 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("ScriptDomVisualizer")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("ScriptDomVisualizer")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("2.2.0.0")] 55 | [assembly: AssemblyFileVersion("2.2.0.0")] 56 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ScriptDomVisualizer.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScriptDomVisualizer.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ScriptDomVisualizer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/ScriptDomVisualizer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {598C2FD0-4048-4764-9F28-0CA9BB687F1B} 8 | WinExe 9 | Properties 10 | ScriptDomVisualizer 11 | ScriptDomVisualizer 12 | v4.5.2 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | s.ico 39 | 40 | 41 | 42 | False 43 | ..\..\..\..\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.TransactSql.ScriptDom.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 4.0 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | MSBuild:Compile 63 | Designer 64 | 65 | 66 | MSBuild:Compile 67 | Designer 68 | 69 | 70 | App.xaml 71 | Code 72 | 73 | 74 | 75 | MainWindow.xaml 76 | Code 77 | 78 | 79 | 80 | 81 | Code 82 | 83 | 84 | True 85 | True 86 | Resources.resx 87 | 88 | 89 | True 90 | Settings.settings 91 | True 92 | 93 | 94 | ResXFileCodeGenerator 95 | Resources.Designer.cs 96 | 97 | 98 | SettingsSingleFileGenerator 99 | Settings.Designer.cs 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 120 | -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/s.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/src/ScriptDomVisualizer/s.ico -------------------------------------------------------------------------------- /src/ScriptDomVisualizer/s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEddie/ScriptDomVisualizerPrivate/dcf398de5afbf65d757002127e1e743a210dfa41/src/ScriptDomVisualizer/s.jpg --------------------------------------------------------------------------------