Skip to content

Commit 7e28cc8

Browse files
committed
- Removed SOM example
+ Added Use File Protocol Example
1 parent 187b891 commit 7e28cc8

File tree

6 files changed

+74
-53
lines changed

6 files changed

+74
-53
lines changed

Examples/SomMapping/SomMappingExample/Program.cs

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

Examples/SomMapping/SomMappingExample/SomMappingExample.csproj

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+

2+
using EmptyFlow.SciterAPI;
3+
using System.Text;
4+
5+
var host = new SciterAPIHost ( Environment.CurrentDirectory );
6+
host.CreateMainWindow ( 500, 500, enableDebug: true, enableFeature: true );
7+
host.Callbacks.AddProtocolHandler (
8+
"http://", // we will be capture http protocol
9+
(
10+
path => {
11+
if ( path != "http://data.json" ) return new byte[0]; // we handle only one address, others will be handled as usual
12+
13+
return Encoding.UTF8.GetBytes (
14+
""""
15+
{
16+
"items": [
17+
{"id": 20},
18+
{"id": 30}
19+
]
20+
}
21+
""""
22+
);
23+
}
24+
) );
25+
host.LoadFile ( "home://eventProtocol.htm" );
26+
host.Process ();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="EmptyFlow.SciterAPI" Version="1.1.0.0" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<None Update="eventProtocol.htm">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
</ItemGroup>
19+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<body>
3+
<div>
4+
Result from protocol is:
5+
<div id="result">
6+
</div>
7+
</div>
8+
<script>
9+
async function loadData() {
10+
const response = await fetch('http://data.json');
11+
const data = await response.json();
12+
const element = document.getElementById('result');
13+
element.innerText = JSON.stringify(data);
14+
}
15+
16+
loadData();
17+
</script>
18+
</body>
19+
</html>

src/SciterAPI.sln

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VueHelloWorld", "..\Example
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SomMappingExample", "..\Examples\SomMapping\SomMappingExample\SomMappingExample.csproj", "{0D377827-6B0D-494C-931A-0175406EAEEA}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UseFileProtocol", "..\Examples\UseEventProtocol\UseFileProtocol.csproj", "{DEBFFD08-66D1-42E5-A2C8-563457B43614}"
1717
EndProject
1818
Global
1919
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -55,21 +55,21 @@ Global
5555
{BFAE0151-970A-45BE-8943-52B82D4C1F38}.Release|Any CPU.Build.0 = Release|Any CPU
5656
{BFAE0151-970A-45BE-8943-52B82D4C1F38}.Release|x64.ActiveCfg = Release|Any CPU
5757
{BFAE0151-970A-45BE-8943-52B82D4C1F38}.Release|x64.Build.0 = Release|Any CPU
58-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
60-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Debug|x64.ActiveCfg = Debug|Any CPU
61-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Debug|x64.Build.0 = Debug|Any CPU
62-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
63-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Release|Any CPU.Build.0 = Release|Any CPU
64-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Release|x64.ActiveCfg = Release|Any CPU
65-
{0D377827-6B0D-494C-931A-0175406EAEEA}.Release|x64.Build.0 = Release|Any CPU
58+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Debug|Any CPU.Build.0 = Debug|Any CPU
60+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Debug|x64.ActiveCfg = Debug|Any CPU
61+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Debug|x64.Build.0 = Debug|Any CPU
62+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Release|Any CPU.ActiveCfg = Release|Any CPU
63+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Release|Any CPU.Build.0 = Release|Any CPU
64+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Release|x64.ActiveCfg = Release|Any CPU
65+
{DEBFFD08-66D1-42E5-A2C8-563457B43614}.Release|x64.Build.0 = Release|Any CPU
6666
EndGlobalSection
6767
GlobalSection(SolutionProperties) = preSolution
6868
HideSolutionNode = FALSE
6969
EndGlobalSection
7070
GlobalSection(NestedProjects) = preSolution
7171
{BFAE0151-970A-45BE-8943-52B82D4C1F38} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
72-
{0D377827-6B0D-494C-931A-0175406EAEEA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
72+
{DEBFFD08-66D1-42E5-A2C8-563457B43614} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
7373
EndGlobalSection
7474
GlobalSection(ExtensibilityGlobals) = postSolution
7575
SolutionGuid = {3264AD46-2365-4471-9339-5C196445FDFC}

0 commit comments

Comments
 (0)