Skip to content

Commit

Permalink
MetadataReferenceService.BlazorWasm - WebcilConverterUtil (#9)
Browse files Browse the repository at this point in the history
* WebcilConverter

* _protobufAsByteArray

* .

* .

* .

* .

* ?

* .

* .

* .

* .

* xxx

* ...

* .

* .

* ok

* copy

* x

* !

* ----------

* DownloadFileAsync

* il

* okeee

* move

* epoch

* StreamExtensions

* WebcilWasmWrapperHelper

* ,,,,,,,,,,,,,,

* <Version>0.0.1-preview-01</Version>

* MetadataReferenceService.Abstractions

* MetadataReferenceService.BlazorWasm

* AssemblyDetails

* .

* key

* p

* CreateFromImageMetadataReferenceService

* internal

* .

* .

* v

* GetHashCode

* <Version>0.0.1-preview-03</Version>

* <Version>0.2.0-preview-03</Version>

* AssemblyDetailsTests

* .
  • Loading branch information
StefH authored Jan 31, 2024
1 parent e5d3655 commit 7e68567
Show file tree
Hide file tree
Showing 64 changed files with 1,591 additions and 1,378 deletions.
2 changes: 1 addition & 1 deletion PackageReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,5 @@ For a full example, see [examples/ProtoBufJsonConverter.Blazor](https://github.c
---

## Examples
- [Blazor WASM](https://wonderful-beach-0d16cee03.4.azurestaticapps.net/)
- [Blazor WASM](https://protobuf.heyenrath.nl)
- [Blazor Static Web App](https://zealous-desert-029b2f003.4.azurestaticapps.net/)
55 changes: 42 additions & 13 deletions ProtoBufJsonConverter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{94D1D405-E9C2-4FB3-A220-1E5C4AB2C2B4}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoBufJsonConverter", "src\ProtoBufJsonConverter\ProtoBufJsonConverter.csproj", "{9A0C2368-CBD5-4500-9BDA-4AAD32280761}"
EndProject
Expand All @@ -13,7 +16,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "examples\Cons
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6A9880FB-CAF7-4373-8877-3EFA092736C0}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Generate-ReleaseNotes.bat = Generate-ReleaseNotes.bat
PackageReadme.md = PackageReadme.md
PackageReleaseNotes.template = PackageReleaseNotes.template
Expand All @@ -38,9 +40,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoBufJsonConverter.Blazo
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "example - Blazor", "example - Blazor", "{F83CE41A-E6D0-4F4B-B827-BC7DFC2FE003}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.WebAssembly.Webcil", "examples\Microsoft.NET.WebAssembly.Webcil\Microsoft.NET.WebAssembly.Webcil.csproj", "{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src-webcil", "src-webcil", "{B8BEB781-C0D7-4FC5-AE6A-9BC038176304}"
ProjectSection(SolutionItems) = preProject
src-webcil\Directory.Build.props = src-webcil\Directory.Build.props
src-webcil\Readme.md = src-webcil\Readme.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.WebAssembly.Webcil", "src-webcil\Microsoft.NET.WebAssembly.Webcil\Microsoft.NET.WebAssembly.Webcil.csproj", "{A0E3D469-BB99-4CE8-8679-54C0F7278072}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataReferenceService.Abstractions", "src-webcil\MetadataReferenceService.Abstractions\MetadataReferenceService.Abstractions.csproj", "{6B034AE5-81D0-4F4B-91E1-1A448F162833}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataReferenceService.BlazorWasm", "src-webcil\MetadataReferenceService.BlazorWasm\MetadataReferenceService.BlazorWasm.csproj", "{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataReferenceService.Default", "src-webcil\MetadataReferenceService.Default\MetadataReferenceService.Default.csproj", "{877551BE-B1E5-4B9C-B64D-36923C8B7A5D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.WebAssembly.Webcil.ConsoleApp", "examples\Microsoft.NET.WebAssembly.Webcil.ConsoleApp\Microsoft.NET.WebAssembly.Webcil.ConsoleApp.csproj", "{963988DD-21B7-49F6-B91F-224840886887}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataReferenceServiceTests", "test\MetadataReferenceServiceTests\MetadataReferenceServiceTests.csproj", "{F873B159-D977-45BA-9CE4-882FB0B806CC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -76,14 +90,26 @@ Global
{A58F54FD-3E70-465B-9CD5-2565D7CDE069}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A58F54FD-3E70-465B-9CD5-2565D7CDE069}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A58F54FD-3E70-465B-9CD5-2565D7CDE069}.Release|Any CPU.Build.0 = Release|Any CPU
{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74}.Release|Any CPU.Build.0 = Release|Any CPU
{963988DD-21B7-49F6-B91F-224840886887}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{963988DD-21B7-49F6-B91F-224840886887}.Debug|Any CPU.Build.0 = Debug|Any CPU
{963988DD-21B7-49F6-B91F-224840886887}.Release|Any CPU.ActiveCfg = Release|Any CPU
{963988DD-21B7-49F6-B91F-224840886887}.Release|Any CPU.Build.0 = Release|Any CPU
{A0E3D469-BB99-4CE8-8679-54C0F7278072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0E3D469-BB99-4CE8-8679-54C0F7278072}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0E3D469-BB99-4CE8-8679-54C0F7278072}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0E3D469-BB99-4CE8-8679-54C0F7278072}.Release|Any CPU.Build.0 = Release|Any CPU
{6B034AE5-81D0-4F4B-91E1-1A448F162833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B034AE5-81D0-4F4B-91E1-1A448F162833}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B034AE5-81D0-4F4B-91E1-1A448F162833}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B034AE5-81D0-4F4B-91E1-1A448F162833}.Release|Any CPU.Build.0 = Release|Any CPU
{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9}.Release|Any CPU.Build.0 = Release|Any CPU
{877551BE-B1E5-4B9C-B64D-36923C8B7A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{877551BE-B1E5-4B9C-B64D-36923C8B7A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{877551BE-B1E5-4B9C-B64D-36923C8B7A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{877551BE-B1E5-4B9C-B64D-36923C8B7A5D}.Release|Any CPU.Build.0 = Release|Any CPU
{F873B159-D977-45BA-9CE4-882FB0B806CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F873B159-D977-45BA-9CE4-882FB0B806CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F873B159-D977-45BA-9CE4-882FB0B806CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F873B159-D977-45BA-9CE4-882FB0B806CC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -96,8 +122,11 @@ Global
{50505706-A8C1-47DC-82F5-E8B96C80E767} = {80477701-191F-4E7D-8D84-01276E9F4FB0}
{AACB5936-C6C8-4A53-A58A-9F7A05097BAE} = {80477701-191F-4E7D-8D84-01276E9F4FB0}
{A58F54FD-3E70-465B-9CD5-2565D7CDE069} = {F83CE41A-E6D0-4F4B-B827-BC7DFC2FE003}
{4500FF72-60C9-40D6-9ABB-4F5A5BD6CE74} = {F83CE41A-E6D0-4F4B-B827-BC7DFC2FE003}
{963988DD-21B7-49F6-B91F-224840886887} = {F83CE41A-E6D0-4F4B-B827-BC7DFC2FE003}
{A0E3D469-BB99-4CE8-8679-54C0F7278072} = {B8BEB781-C0D7-4FC5-AE6A-9BC038176304}
{6B034AE5-81D0-4F4B-91E1-1A448F162833} = {B8BEB781-C0D7-4FC5-AE6A-9BC038176304}
{0F7B1AEF-1C1C-441F-B8AF-5B94685E9DE9} = {B8BEB781-C0D7-4FC5-AE6A-9BC038176304}
{877551BE-B1E5-4B9C-B64D-36923C8B7A5D} = {B8BEB781-C0D7-4FC5-AE6A-9BC038176304}
{F873B159-D977-45BA-9CE4-882FB0B806CC} = {CEFF40B4-4435-408E-B0B9-F93903A8B470}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {45F31459-D6F5-441C-890A-F02A1328053D}
Expand Down
14 changes: 13 additions & 1 deletion ProtoBufJsonConverter.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BE/@EntryIndexedValue">BE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DOS/@EntryIndexedValue">DOS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MSDOS/@EntryIndexedValue">MSDOS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NT/@EntryIndexedValue">NT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PE/@EntryIndexedValue">PE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ULEB/@EntryIndexedValue">ULEB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WASM/@EntryIndexedValue">WASM</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=endian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Grpc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=protobuf/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=heyenrath/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MSDOS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=protobuf/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=reloc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=rsrc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ULEB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unwrapper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Webcil/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
17 changes: 16 additions & 1 deletion examples/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ public static async Task Main()
.WithGrpcHeader(true);
var protobuf4WithGrpcHeader = await converter.ConvertAsync(convertToProtoBufRequestWithGrpcHeader);

int x = 9;
var person = new
{
Name = "stef heyenrath",
Id = 42,
Email = "[email protected]"
};

var convertToProtoBufRequestPerson = new ConvertToProtoBufRequest(protoDefinition, "greet.Person", person);
var protobuf3PersonBytes = await converter.ConvertAsync(convertToProtoBufRequestPerson);
var personAsString = ByteArrayToString(protobuf3PersonBytes);
int x = 0;
}

public static string ByteArrayToString(byte[] byteArray)
{
return string.Join(", ", byteArray.Select(b => $"0x{b:X2}"));
}
}
6 changes: 6 additions & 0 deletions examples/ConsoleApp/greet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ message Other {
// The response message containing the greetings
message HelloReply {
string message = 1;
}

message Person {
string name = 1;
int32 id = 2;
string email = 3;
}

This file was deleted.

117 changes: 0 additions & 117 deletions examples/Microsoft.NET.WebAssembly.Webcil.ConsoleApp/Program.cs

This file was deleted.

Loading

0 comments on commit 7e68567

Please sign in to comment.