Skip to content

Commit fd0a904

Browse files
committed
清理和重构演示项目,移除不必要的代码和资源,增强全局使用约定
1 parent a36905d commit fd0a904

File tree

16 files changed

+311
-120
lines changed

16 files changed

+311
-120
lines changed

.github/workflows/build-demos.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
name: Build Demo Assets
22

33
'on':
4-
push:
5-
branches: [main, develop, master]
6-
tags:
7-
- "v*"
8-
paths-ignore:
9-
- 'docs/**'
10-
- 'README.md'
11-
- 'README_en.md'
12-
- 'ROADMAP.md'
13-
- 'CHANGELOG.md'
14-
- '.github/workflows/docs-pages.yml'
15-
pull_request:
16-
branches: [main, develop, master]
17-
paths-ignore:
18-
- 'docs/**'
19-
- 'README.md'
20-
- 'README_en.md'
21-
- 'ROADMAP.md'
22-
- 'CHANGELOG.md'
23-
- '.github/workflows/docs-pages.yml'
244
workflow_dispatch:
255
inputs:
266
package_version:

.github/workflows/build-native.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
name: Build Native Assets
22

33
'on':
4-
push:
5-
branches: [main, develop, master]
6-
paths-ignore:
7-
- 'docs/**'
8-
- 'README.md'
9-
- 'README_en.md'
10-
- 'ROADMAP.md'
11-
- 'CHANGELOG.md'
12-
- '.github/workflows/docs-pages.yml'
13-
pull_request:
14-
branches: [main, develop, master]
15-
paths-ignore:
16-
- 'docs/**'
17-
- 'README.md'
18-
- 'README_en.md'
19-
- 'ROADMAP.md'
20-
- 'CHANGELOG.md'
21-
- '.github/workflows/docs-pages.yml'
224
workflow_dispatch:
235
inputs:
246
note:

.github/workflows/ci-build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build All Projects
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-all:
12+
name: Build every .csproj
13+
runs-on: windows-latest
14+
permissions:
15+
contents: read
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Setup .NET SDK
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 10.0.x
27+
28+
- name: Build all managed projects
29+
shell: pwsh
30+
run: |
31+
$projects = Get-ChildItem src,tests -Recurse -Filter *.csproj | Sort-Object FullName
32+
Write-Host "Discovered $($projects.Count) projects."
33+
34+
foreach ($project in $projects) {
35+
Write-Host "=== BUILD $($project.FullName) ==="
36+
dotnet build $project.FullName `
37+
-c Release `
38+
--nologo `
39+
-p:ContinuousIntegrationBuild=true `
40+
/m:1
41+
42+
if ($LASTEXITCODE -ne 0) {
43+
throw "Build failed for $($project.FullName)"
44+
}
45+
}

src/Demos/RdpDemo/Program.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using LVGLSharp.Runtime.Remote;
2-
using LVGLSharp.Runtime.Remote.Rdp;
31
using System;
42

53
namespace RdpDemo;
@@ -8,7 +6,7 @@ internal class Program
86
{
97
static void Main(string[] args)
108
{
11-
Console.WriteLine("LVGLSharp RDP Demo 启动中...");
9+
Console.WriteLine("LVGLSharp RDP Demo is starting...");
1210
string host = "0.0.0.0";
1311
int port = 3389;
1412
string? username = null;
@@ -25,9 +23,9 @@ static void Main(string[] args)
2523
Username = username
2624
};
2725
var rdp = new RdpTransportSkeleton(options);
28-
Console.WriteLine($"RDP 服务已监听 {options.Host}:{options.Port},用户名:{(string.IsNullOrEmpty(options.Username) ? "<>" : options.Username)},请用 RDP 客户端连接测试。");
29-
Console.WriteLine("支持参数:--host=IP --port=端口 --username=用户名");
30-
Console.WriteLine(" Ctrl+C 退出。");
26+
Console.WriteLine($"RDP listener is running on {options.Host}:{options.Port}; username: {(string.IsNullOrEmpty(options.Username) ? "<none>" : options.Username)}.");
27+
Console.WriteLine("Supported arguments: --host=IP --port=PORT --username=NAME");
28+
Console.WriteLine("Press Ctrl+C to exit.");
3129
while (true) { Thread.Sleep(1000); }
3230
}
3331
}

src/Demos/RdpDemo/RdpDemo.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<InvariantGlobalization>true</InvariantGlobalization>
8-
<UseLVGLSharpForms>true</UseLVGLSharpForms>
98
</PropertyGroup>
109
<ItemGroup>
11-
<ProjectReference Include="..\..\LVGLSharp.Forms\LVGLSharp.Forms.csproj" />
1210
<ProjectReference Include="..\..\LVGLSharp.Runtime.Remote\LVGLSharp.Runtime.Remote.csproj" />
13-
<ProjectReference Include="..\..\LVGLSharp.Native\LVGLSharp.Native.csproj" />
11+
<Using Include="LVGLSharp.Runtime.Remote" />
12+
<Using Include="LVGLSharp.Runtime.Remote.Rdp" />
1413
</ItemGroup>
15-
</Project>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\LVGLSharp.Analyzers\LVGLSharp.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
17+
</ItemGroup>
18+
</Project>

src/Demos/WinFormsRdpDemo/RuntimeRegistration.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
using System.Net.NetworkInformation;
33
using System.Net.Sockets;
44
using System.Runtime.CompilerServices;
5-
using LVGLSharp.Drawing;
6-
using LVGLSharp.Forms;
7-
using LVGLSharp.Runtime.Remote;
8-
using LVGLSharp.Runtime.Remote.Rdp;
95

106
namespace WinFormsRdpDemo;
117

src/Demos/WinFormsRdpDemo/WinFormsRdpDemo.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@
1313
<PublishSingleFile>true</PublishSingleFile>
1414
<StripSymbols>true</StripSymbols>
1515
</PropertyGroup>
16-
<ItemGroup>
16+
<ItemGroup Condition="'$(UseLVGLSharpForms)' == 'true'">
1717
<ProjectReference Include="..\..\LVGLSharp.WinForms\LVGLSharp.Forms.csproj" />
18+
<ProjectReference Include="..\..\LVGLSharp.Runtime.Windows\LVGLSharp.Runtime.Windows.csproj" />
19+
<ProjectReference Include="..\..\LVGLSharp.Runtime.Linux\LVGLSharp.Runtime.Linux.csproj" />
1820
<ProjectReference Include="..\..\LVGLSharp.Runtime.Remote\LVGLSharp.Runtime.Remote.csproj" />
1921
<ProjectReference Include="..\..\LVGLSharp.Native\LVGLSharp.Native.csproj" />
20-
</ItemGroup>
21-
<ItemGroup>
2222
<Using Include="LVGLSharp.Forms" />
2323
<Using Include="LVGLSharp.Drawing" />
24+
<Using Include="LVGLSharp.Runtime.Remote" />
25+
<Using Include="LVGLSharp.Runtime.Remote.Rdp" />
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<ProjectReference Include="..\..\LVGLSharp.Analyzers\LVGLSharp.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
2430
</ItemGroup>
2531

2632
<Import Project="..\..\LVGLSharp.Native\buildTransitive\LVGLSharp.Native.targets"

src/Demos/WinFormsRdpDemo/frmMain.Designer.cs

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Demos/WinFormsRdpDemo/frmMain.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using LVGLSharp.Drawing;
2-
31
namespace WinFormsRdpDemo;
42

53
public partial class frmMain : Form
@@ -30,7 +28,7 @@ private void BuildDemoSurface()
3028

3129
var introLabel = new Label
3230
{
33-
Text = "这个窗口正在通过 RdpView 运行时托管,为后续 RDP 协议实现预留 Demo 入口。",
31+
Text = "This window currently runs through RdpView so the RDP path has a dedicated demo entry point.",
3432
Location = new Point(18, 18),
3533
Size = new Size(580, 42),
3634
ForeColor = new Color(255, 255, 255),
@@ -39,30 +37,30 @@ private void BuildDemoSurface()
3937
_messageInput = new TextBox
4038
{
4139
Text = "hello from WinForms over RDP",
42-
PlaceholderText = "输入一些文字,然后点右侧按钮",
40+
PlaceholderText = "Type some text and then click the button on the right.",
4341
Location = new Point(18, 72),
4442
Size = new Size(420, 36),
4543
};
4644

4745
var echoButton = new Button
4846
{
49-
Text = "更新状态",
47+
Text = "Update status",
5048
Location = new Point(456, 72),
5149
Size = new Size(140, 36),
5250
};
5351
echoButton.Click += EchoButton_Click;
5452

5553
_statusLabel = new Label
5654
{
57-
Text = "状态:RDP transport 已接入生命周期,协议协商仍在实现中",
55+
Text = "Status: the RDP transport is wired into the lifecycle and the protocol handshake is still in progress.",
5856
Location = new Point(18, 128),
5957
Size = new Size(578, 42),
6058
ForeColor = new Color(255, 255, 255),
6159
};
6260

6361
var hintLabel = new Label
6462
{
65-
Text = "提示:这个 Demo 现在先用于验证 RdpView 注册、窗口承载和后续远程宿主接线点。",
63+
Text = "Tip: this demo currently validates RdpView registration, window hosting, and the later remote-host integration path.",
6664
Location = new Point(18, 178),
6765
Size = new Size(578, 52),
6866
ForeColor = new Color(220, 220, 220),
@@ -85,6 +83,6 @@ private void EchoButton_Click(object? sender, EventArgs e)
8583
var value = string.IsNullOrWhiteSpace(_messageInput.Text)
8684
? "<empty>"
8785
: _messageInput.Text;
88-
_statusLabel.Text = $"状态:最近一次本地交互 -> {value}";
86+
_statusLabel.Text = $"Status: latest local interaction -> {value}";
8987
}
9088
}

src/Demos/WinFormsVncDemo/RuntimeRegistration.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
using System.Net.NetworkInformation;
33
using System.Net.Sockets;
44
using System.Runtime.CompilerServices;
5-
using LVGLSharp.Drawing;
6-
using LVGLSharp.Forms;
7-
using LVGLSharp.Runtime.Remote;
8-
using LVGLSharp.Runtime.Remote.Vnc;
95

106
namespace WinFormsVncDemo;
117

@@ -31,7 +27,7 @@ private static void RegisterRuntime()
3127
Width = options.Width,
3228
Height = options.Height,
3329
}));
34-
Image.RegisterFactory(static _ => throw new NotSupportedException("WinFormsVncDemo 尚未配置图片加载运行时。"));
30+
Image.RegisterFactory(static _ => throw new NotSupportedException("WinFormsVncDemo has not configured an image loading runtime yet."));
3531
WriteVncConsoleBanner();
3632
}
3733

0 commit comments

Comments
 (0)