Skip to content

Commit

Permalink
Added HttpMessage renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
frankhaugen committed Aug 4, 2024
1 parent 77ec52f commit e9d7ee5
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Net.Http;
using System.Windows.Controls;

namespace Frank.Wpf.Controls.HttpMessageRenderer;

public class HttpRequestMessageControl : ContentControl
{
private HttpRequestMessage _httpRequestMessage;

public HttpRequestMessageControl(HttpRequestMessage httpRequestMessage)
{
_httpRequestMessage = httpRequestMessage;
Render();
}

public void Update(HttpRequestMessage httpRequestMessage)
{
_httpRequestMessage = httpRequestMessage;
Render();
}

public void Render()
{
Content = new TextBlock
{
Text = _httpRequestMessage.ToString()
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Net.Http;
using System.Windows.Controls;

namespace Frank.Wpf.Controls.HttpMessageRenderer;

public class HttpResponseMessageControl : ContentControl
{
private HttpResponseMessage _httpResponseMessage;

public HttpResponseMessageControl(HttpResponseMessage httpResponseMessage)
{
_httpResponseMessage = httpResponseMessage;
Render();
}

public void Update(HttpResponseMessage httpResponseMessage)
{
_httpResponseMessage = httpResponseMessage;
Render();
}

public void Render()
{
Content = new TextBlock
{
Text = _httpResponseMessage.ToString()
};
}
}
6 changes: 6 additions & 0 deletions Frank.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frank.Wpf.Windows.SqlRunner
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frank.Wpf.Controls.Console", "Frank.Wpf.Controls.Console\Frank.Wpf.Controls.Console.csproj", "{2ACEECC6-D78A-43FE-B0B1-6058C9CB0B7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frank.Wpf.Controls.HttpMessageRenderer", "Frank.Wpf.Controls.HttpMessageRenderer\Frank.Wpf.Controls.HttpMessageRenderer.csproj", "{4F4A407A-193B-4B10-A3EE-545D0F9F787E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -132,5 +134,9 @@ Global
{2ACEECC6-D78A-43FE-B0B1-6058C9CB0B7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ACEECC6-D78A-43FE-B0B1-6058C9CB0B7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ACEECC6-D78A-43FE-B0B1-6058C9CB0B7E}.Release|Any CPU.Build.0 = Release|Any CPU
{4F4A407A-193B-4B10-A3EE-545D0F9F787E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F4A407A-193B-4B10-A3EE-545D0F9F787E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F4A407A-193B-4B10-A3EE-545D0F9F787E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F4A407A-193B-4B10-A3EE-545D0F9F787E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

0 comments on commit e9d7ee5

Please sign in to comment.