Skip to content

Commit

Permalink
Use SDK Style Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeyrotc committed Aug 1, 2022
1 parent bdcdc7d commit 0ae5aba
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 324 deletions.
Original file line number Diff line number Diff line change
@@ -1,63 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B61996ED-4B8D-4D7F-8C51-BCB5A8C13D51}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdvancedVisualizer.DebuggeeSide</RootNamespace>
<AssemblyName>AdvancedVisualizer.DebuggeeSide</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AdvancedVisualizerObjectSource.cs" />
<Compile Include="Commands.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VerySlowObject\VerySlowObject.csproj">
<Project>{082f5028-3a8a-4d88-b428-008c435f7d15}</Project>
<Name>VerySlowObject</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<Version>17.0.2042701</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net4.7.2</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.DebuggerVisualizers" Version="17.0.2042701" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\VerySlowObject\VerySlowObject.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,37 @@ public override void TransferData(object obj, Stream fromVisualizer, Stream toVi
// Start the timer so that we can stop processing the request if it is are taking too long.
long startTime = Environment.TickCount;

var slowObject = obj as VerySlowObject;

bool isComplete = true;
if (obj is VerySlowObject slowObject)
{
bool isComplete = true;

// Read the supplied command
fromVisualizer.Seek(0, SeekOrigin.Begin);
IDeserializableObject deserializableObject = GetDeserializableObject(fromVisualizer);
GetVeryLongListCommand command = deserializableObject.ToObject<GetVeryLongListCommand>();
// Read the supplied command
fromVisualizer.Seek(0, SeekOrigin.Begin);
IDeserializableObject deserializableObject = GetDeserializableObject(fromVisualizer);
GetVeryLongListCommand command = deserializableObject.ToObject<GetVeryLongListCommand>();

List<string> returnValues = new List<string>();
List<string> returnValues = new List<string>();

for (int i = (int)command.StartOffset; i < slowObject.VeryLongList.Count; i++)
{
// If the call takes more than 3 seconds, just return what we have received so far and fetch the remaining data on a posterior call.
if ((Environment.TickCount - startTime) > 3_000)
for (int i = (int)command.StartOffset; i < slowObject.VeryLongList?.Count; i++)
{
isComplete = false;
break;
// If the call takes more than 3 seconds, just return what we have received so far and fetch the remaining data on a posterior call.
if ((Environment.TickCount - startTime) > 3_000)
{
isComplete = false;
break;
}

// This call takes a considerable amount of time...
returnValues.Add(slowObject.VeryLongList[i].ToString());
}

// This call takes a considerable amount of time...
returnValues.Add(slowObject.VeryLongList[i].ToString());
GetVeryLongListResponse response = new GetVeryLongListResponse(returnValues.ToArray(), isComplete);
Serialize(toVisualizer, response);
}
else
{
// Handle failure case...
}

GetVeryLongListResponse response = new GetVeryLongListResponse(returnValues.ToArray(), isComplete);
Serialize(toVisualizer, response);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,80 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3758C2A2-6794-4161-9FFA-FE0A5A10E6AE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdvancedVisualizer.DebuggerSide</RootNamespace>
<AssemblyName>AdvancedVisualizer.DebuggerSide</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="AdvancedVisualizer.cs" />
<Compile Include="AdvancedVisualizerViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VisualizerDialog.xaml.cs">
<DependentUpon>VisualizerDialog.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Include="VisualizerDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<Version>17.0.2042701</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdvancedVisualizer.DebuggeeSide\AdvancedVisualizer.DebuggeeSide.csproj">
<Project>{b61996ed-4b8d-4d7f-8c51-bcb5a8c13d51}</Project>
<Name>AdvancedVisualizer.DebuggeeSide</Name>
</ProjectReference>
<ProjectReference Include="..\VerySlowObject\VerySlowObject.csproj">
<Project>{082f5028-3a8a-4d88-b428-008c435f7d15}</Project>
<Name>VerySlowObject</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net4.7.2</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.DebuggerVisualizers" Version="17.0.2042701" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\VerySlowObject\VerySlowObject.csproj" />
<ProjectReference Include="..\AdvancedVisualizer.DebuggeeSide\AdvancedVisualizer.DebuggeeSide.csproj" />
</ItemGroup>

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class VerySlowObject
// More properties...

// One of the properties we want to visualize.
public List<SomeRandomObject> VeryLongList { get; set; }
public List<SomeRandomObject>? VeryLongList { get; set; }

// More properties...
}
Expand Down
Loading

0 comments on commit 0ae5aba

Please sign in to comment.