├── .gitignore ├── ExpressionTreeVisualizer.dll ├── ExpressionTreeVisualizer.sln ├── ExpressionTreeVisualizer ├── AttributeNode.cs ├── ExpressionTreeContainer.cs ├── ExpressionTreeForm.cs ├── ExpressionTreeNode.cs ├── ExpressionTreeVisualizer.csproj ├── ExpressionTreeVisualizerForVisualStudio2010.cs ├── ExpressionTreeVisualizerObjectSource.cs ├── Properties │ └── AssemblyInfo.cs ├── TreeBrowser.cs ├── TreeNode.cs └── VisualizerSigning.snk ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML -------------------------------------------------------------------------------- /ExpressionTreeVisualizer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Feddas/ExpressionTreeVisualizer/50f53105191f6f73b01c647039c75f27d0598eb1/ExpressionTreeVisualizer.dll -------------------------------------------------------------------------------- /ExpressionTreeVisualizer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExpressionTreeVisualizer", "ExpressionTreeVisualizer\ExpressionTreeVisualizer.csproj", "{C4E5FCAA-D478-4AC6-89C3-4738A168AE2D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C4E5FCAA-D478-4AC6-89C3-4738A168AE2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {C4E5FCAA-D478-4AC6-89C3-4738A168AE2D}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {C4E5FCAA-D478-4AC6-89C3-4738A168AE2D}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {C4E5FCAA-D478-4AC6-89C3-4738A168AE2D}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/AttributeNode.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer { 2 | using System; 3 | using System.Collections; 4 | using System.Collections.ObjectModel; 5 | using System.Globalization; 6 | using System.Linq.Expressions; 7 | using System.Reflection; 8 | using System.Runtime.Serialization; 9 | using System.Windows.Forms; 10 | 11 | [Serializable] 12 | public class AttributeNode : TreeNode { 13 | protected AttributeNode(SerializationInfo info, StreamingContext context) 14 | : base(info, context) { 15 | } 16 | 17 | public AttributeNode(Object attribute, PropertyInfo propertyInfo) { 18 | Text = propertyInfo.Name + " : " + propertyInfo.PropertyType.ObtainOriginalName(); 19 | ImageIndex = 3; 20 | SelectedImageIndex = 3; 21 | 22 | Object value = propertyInfo.GetValue(attribute, null); 23 | if (value != null) { 24 | if (value.GetType().IsGenericType && value.GetType().GetGenericTypeDefinition() == typeof(ReadOnlyCollection<>)) { 25 | if ((Int32)value.GetType().InvokeMember("get_Count", BindingFlags.InvokeMethod, null, value, null, CultureInfo.InvariantCulture) == 0) { 26 | Text += " : Empty"; 27 | } else { 28 | foreach (Object tree in (IEnumerable)value) { 29 | if (tree is Expression) { 30 | Nodes.Add(new ExpressionTreeNode(tree)); 31 | } else if (tree is MemberAssignment) { 32 | Nodes.Add(new ExpressionTreeNode(((MemberAssignment)tree).Expression)); 33 | } 34 | } 35 | } 36 | } else if (value is Expression) { 37 | Text += ((Expression)value).NodeType; 38 | Nodes.Add(new ExpressionTreeNode(value)); 39 | } else if (value is MethodInfo) { 40 | var minfo = value as MethodInfo; 41 | Text += " : \"" + minfo.ObtainOriginalMethodName() + "\""; 42 | } else if (value is Type) { 43 | var type = value as Type; 44 | Text += " : \"" + type.ObtainOriginalName() + "\""; 45 | } else { 46 | Text += " : \"" + value + "\""; 47 | } 48 | } else { 49 | Text += " : null"; 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeContainer.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer { 2 | using System; 3 | 4 | [Serializable] 5 | public class ExpressionTreeContainer { 6 | public String Expression { get; set; } 7 | 8 | public ExpressionTreeNode TreeNode { get; set; } 9 | 10 | public ExpressionTreeContainer(ExpressionTreeNode treeNode, String expression) { 11 | this.TreeNode = treeNode; 12 | this.Expression = expression; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeForm.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer { 2 | using System; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | 6 | public class TreeWindow : Form { 7 | readonly TreeBrowser _browser; 8 | readonly string _errors; 9 | TextBox _errorMessageBox; 10 | 11 | public TreeWindow(TreeBrowser browser, String expression) { 12 | this._browser = browser; 13 | this._errors = expression; 14 | InitializeComponent(); 15 | } 16 | 17 | void InitializeComponent() { 18 | this._errorMessageBox = new TextBox(); 19 | 20 | this.SuspendLayout(); 21 | 22 | // 23 | // errorMessageBox 24 | // 25 | this._errorMessageBox.Anchor = ((AnchorStyles.Top | AnchorStyles.Left) 26 | | AnchorStyles.Right); 27 | this._errorMessageBox.Location = new Point(8, 8); 28 | this._errorMessageBox.Multiline = true; 29 | this._errorMessageBox.Name = "_errorMessageBox"; 30 | this._errorMessageBox.ReadOnly = true; 31 | this._errorMessageBox.ScrollBars = ScrollBars.Both; 32 | this._errorMessageBox.Size = new Size(280, 56); 33 | this._errorMessageBox.TabIndex = 1; 34 | this._errorMessageBox.TabStop = false; 35 | this._errorMessageBox.Text = this._errors; 36 | 37 | // 38 | // browser 39 | // 40 | this._browser.Anchor = (((AnchorStyles.Top | AnchorStyles.Bottom) 41 | | AnchorStyles.Left) 42 | | AnchorStyles.Right); 43 | this._browser.Location = new Point(8, 72); 44 | this._browser.Size = new Size(280, 192); 45 | this._browser.TabIndex = 2; 46 | this._browser.ExpandAll(); 47 | 48 | // 49 | // TreeWindow 50 | // 51 | this.AutoScaleBaseSize = new Size(5, 13); 52 | this.ClientSize = new Size(292, 266); 53 | this.Controls.AddRange( 54 | new Control[] { 55 | this._browser, 56 | this._errorMessageBox 57 | }); 58 | this.Name = "TreeWindow"; 59 | this.Text = "Expression Tree Viewer"; 60 | this.ResumeLayout(false); 61 | 62 | this.Size = new Size(600, 800); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeNode.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer { 2 | using System; 3 | using System.Linq.Expressions; 4 | using System.Reflection; 5 | using System.Runtime.Serialization; 6 | using System.Windows.Forms; 7 | 8 | [Serializable] 9 | public class ExpressionTreeNode : TreeNode { 10 | protected ExpressionTreeNode(SerializationInfo info, StreamingContext context) 11 | : base(info, context) { 12 | } 13 | 14 | public ExpressionTreeNode(Object value) { 15 | Type type = value.GetType(); 16 | Text = type.ObtainOriginalName(); 17 | 18 | if (value is Expression) { 19 | ImageIndex = 2; 20 | SelectedImageIndex = 2; 21 | 22 | PropertyInfo[] propertyInfos = null; 23 | if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Expression<>)) { 24 | if (type.BaseType != null) { 25 | propertyInfos = type.BaseType.GetProperties(BindingFlags.Public | BindingFlags.Instance); 26 | } 27 | } else { 28 | propertyInfos = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); 29 | } 30 | 31 | if (propertyInfos != null) { 32 | foreach (PropertyInfo propertyInfo in propertyInfos) { 33 | if ((propertyInfo.Name != "nodeType")) { 34 | Nodes.Add(new AttributeNode(value, propertyInfo)); 35 | } 36 | } 37 | } 38 | } else { 39 | ImageIndex = 4; 40 | SelectedImageIndex = 4; 41 | Text = "\"" + value + "\""; 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeVisualizer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {C4E5FCAA-D478-4AC6-89C3-4738A168AE2D} 9 | Library 10 | Properties 11 | ExpressionTreeVisualizer 12 | ExpressionTreeVisualizer 13 | v4.5.1 14 | 512 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | false 36 | 37 | 38 | true 39 | 40 | 41 | VisualizerSigning.snk 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Form 60 | 61 | 62 | 63 | 64 | 65 | 66 | Component 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 81 | -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeVisualizerForVisualStudio2010.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Linq.Expressions; 3 | using ExpressionTreeVisualizer; 4 | 5 | //attributes added by: http://sachabarbs.wordpress.com/2012/04/18/expression-tree-visualizer/ 6 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 7 | Target = typeof(Expression), Description = "Expression Tree Visualizer")] 8 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 9 | Target = typeof(BinaryExpression), Description = "Expression Tree Visualizer")] 10 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 11 | Target = typeof(BlockExpression), Description = "Expression Tree Visualizer")] 12 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 13 | Target = typeof(ConditionalExpression), Description = "Expression Tree Visualizer")] 14 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 15 | Target = typeof(ConstantExpression), Description = "Expression Tree Visualizer")] 16 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 17 | Target = typeof(DebugInfoExpression), Description = "Expression Tree Visualizer")] 18 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 19 | Target = typeof(DefaultExpression), Description = "Expression Tree Visualizer")] 20 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 21 | Target = typeof(DynamicExpression), Description = "Expression Tree Visualizer")] 22 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 23 | Target = typeof(GotoExpression), Description = "Expression Tree Visualizer")] 24 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 25 | Target = typeof(IndexExpression), Description = "Expression Tree Visualizer")] 26 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 27 | Target = typeof(InvocationExpression), Description = "Expression Tree Visualizer")] 28 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 29 | Target = typeof(LabelExpression), Description = "Expression Tree Visualizer")] 30 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 31 | Target = typeof(LambdaExpression), Description = "Expression Tree Visualizer")] 32 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 33 | Target = typeof(ListInitExpression), Description = "Expression Tree Visualizer")] 34 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 35 | Target = typeof(LoopExpression), Description = "Expression Tree Visualizer")] 36 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 37 | Target = typeof(MemberExpression), Description = "Expression Tree Visualizer")] 38 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 39 | Target = typeof(MemberInitExpression), Description = "Expression Tree Visualizer")] 40 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 41 | Target = typeof(MethodCallExpression), Description = "Expression Tree Visualizer")] 42 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 43 | Target = typeof(NewArrayExpression), Description = "Expression Tree Visualizer")] 44 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 45 | Target = typeof(NewExpression), Description = "Expression Tree Visualizer")] 46 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 47 | Target = typeof(ParameterExpression), Description = "Expression Tree Visualizer")] 48 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 49 | Target = typeof(RuntimeVariablesExpression), Description = "Expression Tree Visualizer")] 50 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 51 | Target = typeof(SwitchExpression), Description = "Expression Tree Visualizer")] 52 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 53 | Target = typeof(TryExpression), Description = "Expression Tree Visualizer")] 54 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 55 | Target = typeof(TypeBinaryExpression), Description = "Expression Tree Visualizer")] 56 | [assembly: DebuggerVisualizer(typeof(ExpressionTreeVisualizerForVisualStudio2010), typeof(ExpressionTreeVisualizerObjectSource), 57 | Target = typeof(UnaryExpression), Description = "Expression Tree Visualizer")] 58 | 59 | namespace ExpressionTreeVisualizer { 60 | using System; 61 | using Microsoft.VisualStudio.DebuggerVisualizers; 62 | 63 | public class ExpressionTreeVisualizerForVisualStudio2010 : DialogDebuggerVisualizer { 64 | IDialogVisualizerService modalService; 65 | 66 | protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { 67 | modalService = windowService; 68 | if (modalService == null) { 69 | throw new NotSupportedException("This debugger does not support modal visualizers"); 70 | } 71 | 72 | var container = (ExpressionTreeContainer)objectProvider.GetObject(); 73 | var browser = new TreeBrowser(); 74 | browser.Add(container.TreeNode); 75 | var treeForm = new TreeWindow(browser, container.Expression); 76 | modalService.ShowDialog(treeForm); 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/ExpressionTreeVisualizerObjectSource.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer 2 | { 3 | using System; 4 | using System.IO; 5 | using System.Linq.Expressions; 6 | using Microsoft.VisualStudio.DebuggerVisualizers; 7 | 8 | public class ExpressionTreeVisualizerObjectSource : VisualizerObjectSource 9 | { 10 | public override void GetData(Object target, Stream outgoingData) 11 | { 12 | var expr = (Expression)target; 13 | var browser = new ExpressionTreeNode(expr); 14 | var container = new ExpressionTreeContainer(browser, expr.ToString()); 15 | 16 | Serialize(outgoingData, container); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | using System.Reflection; 4 | using System.Runtime.CompilerServices; 5 | using System.Runtime.InteropServices; 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("ExpressionTreeVisualizerForVisualStudio2010")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("ExpressionTreeVisualizerForVisualStudio2010")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2007")] 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 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | [assembly: Guid("a006a3cb-9dd6-4bd7-8e21-ae260dd4c5ac")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Revision and Build Numbers 35 | // by using the '*' as shown below: 36 | [assembly: AssemblyVersion("1.0.0.0")] 37 | [assembly: AssemblyFileVersion("1.0.0.0")] 38 | 39 | //Code Analysis Suppressions 40 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Visualizer", Scope = "type", Target = "ExpressionVisualizer.ExpressionTreeVisualizerObjectSource")] 41 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Visualizer", Scope = "type", Target = "ExpressionVisualizer.ExpressionTreeVisualizerForVisualStudio2010")] 42 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "ExpressionVisualizer.AttributeNode.#.ctor(System.Object,System.Reflection.PropertyInfo)")] 43 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Visualizer")] 44 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] 45 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2209:AssembliesShouldDeclareMinimumSecurity")] 46 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Visualizer", Scope = "namespace", Target = "ExpressionVisualizer")] 47 | -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/TreeBrowser.cs: -------------------------------------------------------------------------------- 1 | namespace ExpressionTreeVisualizer { 2 | using System.Windows.Forms; 3 | 4 | public class TreeBrowser : TreeView { 5 | public TreeBrowser() { 6 | } 7 | 8 | public void Add(TreeNode root) { 9 | Nodes.Add(root); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/TreeNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [assembly: CLSCompliant(true)] 4 | 5 | namespace ExpressionTreeVisualizer { 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Reflection; 9 | using System.Text; 10 | 11 | internal static class ExpressionTreeExtention { 12 | public static String ObtainOriginalMethodName(this MethodInfo method) { 13 | if (!method.IsGenericMethod) { 14 | return method.Name; 15 | } 16 | return ExtractName(method.Name) + ExtractGenericArguments(method.GetGenericArguments()); 17 | } 18 | 19 | public static String ObtainOriginalName(this Type type) { 20 | if (!type.IsGenericType) { 21 | return type.Name; 22 | } 23 | return ExtractName(type.Name) + ExtractGenericArguments(type.GetGenericArguments()); 24 | } 25 | 26 | static String ExtractGenericArguments(IEnumerable names) { 27 | var builder = new StringBuilder("<"); 28 | foreach (Type genericArgument in names) { 29 | if (builder.Length != 1) { 30 | builder.Append(", "); 31 | } 32 | builder.Append(ObtainOriginalName(genericArgument)); 33 | } 34 | builder.Append(">"); 35 | return builder.ToString(); 36 | } 37 | 38 | static String ExtractName(String name) { 39 | Int32 i = name.LastIndexOf("`", StringComparison.Ordinal); 40 | if (i > 0) { 41 | name = name.Substring(0, i); 42 | } 43 | return name; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /ExpressionTreeVisualizer/VisualizerSigning.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Feddas/ExpressionTreeVisualizer/50f53105191f6f73b01c647039c75f27d0598eb1/ExpressionTreeVisualizer/VisualizerSigning.snk -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Shawn Featherly 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ExpressionTreeVisualizer 2 | ======================== 3 | 4 | Expression Tree Visualizer for debugging visual studio 2013 expression datatypes. 5 | 6 | Usage 7 | ----- 8 | Copy [release build of ExpressionTreeVisualizer.dll](https://github.com/Feddas/ExpressionTreeVisualizer/blob/master/ExpressionTreeVisualizer.dll) into C:\Users\[CurrentUser]\Documents\Visual Studio 2013\Visualizers 9 | 10 | Notes 11 | ----- 12 | Incorporates most comments off of http://stackoverflow.com/questions/10187567/is-there-an-expression-tree-visualizer-for-vs-2012 13 | 14 | Based off http://sachabarbs.wordpress.com/2012/04/18/expression-tree-visualizer/ 15 | Who based their solution off of exprtreevisualizer.codeplex.com --------------------------------------------------------------------------------