Skip to content

Commit bc31857

Browse files
committed
Milestone 1
1 parent d819b7c commit bc31857

47 files changed

Lines changed: 2399 additions & 74 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/>
5+
</startup>
6+
</configuration>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{DC958167-6E60-4DD9-BEA5-A98208A812DE}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>DebuggerVisualizer.TestHarness</RootNamespace>
10+
<AssemblyName>DebuggerVisualizer.TestHarness</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
37+
<SpecificVersion>False</SpecificVersion>
38+
<Private>True</Private>
39+
</Reference>
40+
<Reference Include="PresentationFramework" />
41+
<Reference Include="System" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="Microsoft.CSharp" />
46+
<Reference Include="System.Data" />
47+
<Reference Include="System.Net.Http" />
48+
<Reference Include="System.Xml" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<Compile Include="Program.cs" />
52+
<Compile Include="Properties\AssemblyInfo.cs" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<None Include="App.config" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<ProjectReference Include="..\SimpleExample\SimpleExample.csproj">
59+
<Project>{3d775e5c-ffc8-4a40-80af-7ef55d5d59f5}</Project>
60+
<Name>SimpleExample</Name>
61+
</ProjectReference>
62+
<ProjectReference Include="..\VisualizerExamples\VisualizerExamples.csproj">
63+
<Project>{4ae7de76-697d-4d7f-9bcd-78aad1844bac}</Project>
64+
<Name>VisualizerExamples</Name>
65+
</ProjectReference>
66+
</ItemGroup>
67+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68+
</Project>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
using Microsoft.VisualStudio.DebuggerVisualizers;
2+
using System;
3+
using System.Diagnostics;
4+
using System.Net;
5+
using SimpleExample;
6+
using SimpleExample.DebuggerVisualizer;
7+
using ReadOnly =SimpleExample.DebuggerVisualizer.ReadOnly;
8+
using ReadWrite = SimpleExample.DebuggerVisualizer.ReadWrite;
9+
using VisualizerExamples.DebuggerVisualizer.Exception;
10+
using VisualizerExamples.DebuggerVisualizer.WebException.Simple;
11+
using VisualizerExamples.DebuggerVisualizer.WebException.WPF;
12+
13+
14+
namespace DebuggerVisualizer.TestHarness
15+
{
16+
17+
class Program
18+
{
19+
[STAThread]
20+
static void Main(string[] args)
21+
{
22+
23+
//Web();
24+
25+
TestShowObjectVisualizer(new SomeType() { Foo = "Foo bar" });
26+
27+
TestShowEditableObjectVisualizer(new SomeType() { Foo = "Foo bar" });
28+
29+
TestShowExceptionVisualizer(new WebException("this broke"));
30+
31+
TestShowWpfExceptionVisualizer(new WebException("this broke"));
32+
33+
SomeTypeVisualizerWriteBackTest(new SomeType() {Foo = "Foo bar"});
34+
}
35+
36+
private static void SomeTypeVisualizerWriteBackTest(SomeType someType)
37+
{
38+
while (someType.Foo != "done")
39+
{
40+
Debugger.Break();
41+
System.Windows.MessageBox.Show(someType.Foo);
42+
}
43+
}
44+
45+
private static void Web()
46+
{
47+
48+
try
49+
{
50+
using (var client = new WebClient())
51+
{
52+
var jsonUrl = "https://jsonplaceholder.typicode.com/posts";
53+
54+
var xmlUrl = "http://api.wordnik.com/v4/words.xml/randomWords?hasDictionaryDef=false&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=5&maxLength=-1&limit=10&api_key=a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5";
55+
56+
var error404Url = "http://wrightfully.com/notreal";
57+
58+
var response = client.DownloadString(xmlUrl);
59+
Debugger.Break();
60+
}
61+
}
62+
catch (WebException ex)
63+
{
64+
Debugger.Break();
65+
66+
VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(ex, typeof(SimpleWebExceptionVisualizer), typeof(WebExceptionVisualObjectSource));
67+
visualizerHost.ShowVisualizer();
68+
69+
}
70+
catch (Exception ex)
71+
{
72+
Debugger.Break();
73+
Console.WriteLine(ex.ToString());
74+
}
75+
76+
}
77+
78+
public static void TestShowObjectVisualizer(object objectToVisualize)
79+
{
80+
VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(ReadOnly.SomeTypeVisualizer));
81+
visualizerHost.ShowVisualizer();
82+
}
83+
84+
public static void TestShowEditableObjectVisualizer(object objectToVisualize)
85+
{
86+
VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(ReadWrite.SomeTypeVisualizer), typeof(ReadWrite.SomeTypeVisualizerObjectSource));
87+
visualizerHost.ShowVisualizer();
88+
}
89+
90+
public static void TestShowExceptionVisualizer(object objectToVisualize)
91+
{
92+
VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(SimpleExceptionVisualizer));
93+
visualizerHost.ShowVisualizer();
94+
}
95+
96+
97+
public static void TestShowWpfExceptionVisualizer(object objectToVisualize)
98+
{
99+
VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(WpfWebExceptionVisualizer), typeof(WebExceptionVisualObjectSource));
100+
visualizerHost.ShowVisualizer();
101+
}
102+
}
103+
}
104+
105+
106+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("DebuggerVisualizer.TestHarness")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("DebuggerVisualizer.TestHarness")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("dc958167-6e60-4dd9-bea5-a98208a812de")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎DebuggerVisualizer.sln‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.14
4+
VisualStudioVersion = 15.0.27004.2010
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebuggerVisualizer", "DebuggerVisualizer\DebuggerVisualizer.csproj", "{5551C526-518B-4B50-84B4-AEE4CA8066F9}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebuggerVisualizer.TestHarness", "DebuggerVisualizer.TestHarness\DebuggerVisualizer.TestHarness.csproj", "{DC958167-6E60-4DD9-BEA5-A98208A812DE}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualizerExamples", "VisualizerExamples\VisualizerExamples.csproj", "{4AE7DE76-697D-4D7F-9BCD-78AAD1844BAC}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleExample", "SimpleExample\SimpleExample.csproj", "{3D775E5C-FFC8-4A40-80AF-7EF55D5D59F5}"
711
EndProject
812
Global
913
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1014
Debug|Any CPU = Debug|Any CPU
1115
Release|Any CPU = Release|Any CPU
1216
EndGlobalSection
1317
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{5551C526-518B-4B50-84B4-AEE4CA8066F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{5551C526-518B-4B50-84B4-AEE4CA8066F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{5551C526-518B-4B50-84B4-AEE4CA8066F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{5551C526-518B-4B50-84B4-AEE4CA8066F9}.Release|Any CPU.Build.0 = Release|Any CPU
18+
{DC958167-6E60-4DD9-BEA5-A98208A812DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{DC958167-6E60-4DD9-BEA5-A98208A812DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{DC958167-6E60-4DD9-BEA5-A98208A812DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{DC958167-6E60-4DD9-BEA5-A98208A812DE}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{4AE7DE76-697D-4D7F-9BCD-78AAD1844BAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{4AE7DE76-697D-4D7F-9BCD-78AAD1844BAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{4AE7DE76-697D-4D7F-9BCD-78AAD1844BAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{4AE7DE76-697D-4D7F-9BCD-78AAD1844BAC}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{3D775E5C-FFC8-4A40-80AF-7EF55D5D59F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{3D775E5C-FFC8-4A40-80AF-7EF55D5D59F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{3D775E5C-FFC8-4A40-80AF-7EF55D5D59F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{3D775E5C-FFC8-4A40-80AF-7EF55D5D59F5}.Release|Any CPU.Build.0 = Release|Any CPU
1830
EndGlobalSection
1931
GlobalSection(SolutionProperties) = preSolution
2032
HideSolutionNode = FALSE
2133
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {6E58467D-91E7-4BB8-87AE-C6F4270094E6}
36+
EndGlobalSection
2237
EndGlobal

‎DebuggerVisualizer/Class1.cs‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎DebuggerVisualizer/DebuggerVisualizer.csproj‎

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using Microsoft.VisualStudio.DebuggerVisualizers;
3+
4+
namespace SimpleExample.DebuggerVisualizer.ReadOnly
5+
{
6+
7+
/// <summary>
8+
/// A Visualizer for SomeType.
9+
/// </summary>
10+
public class SomeTypeVisualizer : DialogDebuggerVisualizer
11+
{
12+
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
13+
{
14+
if (windowService == null)
15+
throw new ArgumentNullException(nameof(windowService));
16+
17+
if (objectProvider == null)
18+
throw new ArgumentNullException(nameof(objectProvider));
19+
20+
// Get the object to display a visualizer for.
21+
// Cast the result of objectProvider.GetObject()
22+
// to the type of the object being visualized.
23+
var data = objectProvider.GetObject() as SimpleExample.SomeType;
24+
25+
26+
// Display your view of the object.
27+
using (var displayForm = new SomeTypeVisualizerForm())
28+
{
29+
displayForm.Load += (sender, args) => displayForm.txtFoo.Text = data.Foo;
30+
displayForm.txtFoo.Text = data.Foo;
31+
windowService.ShowDialog(displayForm);
32+
}
33+
}
34+
35+
}
36+
}

0 commit comments

Comments
 (0)