Fix the compile error

This commit is contained in:
FlowerRealm 2025-10-18 19:06:55 +08:00
parent b1828ffb12
commit c516f9b393
3 changed files with 45 additions and 9 deletions

5
.gitignore vendored
View file

@ -17,6 +17,8 @@
mono_crash.*
# Build results
build-area/
debian/
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
@ -399,6 +401,3 @@ FodyWeavers.xsd
# JetBrains Rider
.idea/
*.sln.iml
# AI Tools
AGENTS.md

43
AGENTS.md Normal file
View file

@ -0,0 +1,43 @@
# Repository Guidelines
## Project Structure & Modules
- Solution: `v2rayN/v2rayN.sln` (C#/.NET 8)
- Apps: `v2rayN/v2rayN` (Windows WPF), `v2rayN/v2rayN.Desktop` (Avalonia crossplatform)
- Core library: `v2rayN/ServiceLib` (models, services, `Resx` resources)
- Hotkeys: `v2rayN/GlobalHotKeys` (library + examples); tests in `GlobalHotKeys.Test`
- Artifacts: `v2rayN/Release/`, `v2rayN/publish/`, `build-output/`
- Packaging scripts (root): `package-*.sh`
## Build, Test, and Development
- Build all: `dotnet build v2rayN/v2rayN.sln -c Release`
- Run (Linux/macOS): `dotnet run --project v2rayN/v2rayN.Desktop -c Debug`
- Run (Windows): `dotnet run --project v2rayN/v2rayN -c Debug`
- Publish (examples):
- Linux x64: `dotnet publish v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained true -o v2rayN/Release/linux-64`
- Windows x64: `dotnet publish v2rayN/v2rayN/v2rayN.csproj -c Release -r win-x64 -p:EnableWindowsTargeting=true -o v2rayN/Release/windows-64`
- Tests (NUnit): `dotnet test v2rayN/GlobalHotKeys/src/GlobalHotKeys.Test -c Release --collect:"XPlat Code Coverage"`
## Coding Style & Naming
- Formatting from `.editorconfig`: UTF-8, CRLF, spaces=4.
- C#: filescoped namespaces; System usings first; braces required; prefer `var` when type is apparent; PascalCase for types/members; fields/private locals use camelCase.
- Lint/format: `dotnet format` before pushing.
- XAML/Avalonia: keep views thin; move logic to ViewModels in `ServiceLib`/`*ViewModels`.
## Testing Guidelines
- Framework: NUnit with `GlobalHotKeys.Test`.
- Conventions: classes `*Tests`, methods `[Test]` with Arrange/Act/Assert; keep tests isolated and deterministic.
- Run locally with `dotnet test` and ensure coverage for hotkey registration/ID reuse.
## Commit & Pull Requests
- Commits: short imperative subject (e.g., "Fix…", "Update…"), optional scope, reference issues/PRs (e.g., `(#8123)`).
- PRs must include: problem summary, rationale, user impact, steps to verify, screenshots for UI, target OS/runtime.
- CI parity: changes must pass `dotnet build` and `dotnet test` locally; do not commit artifacts under `Release/` or `publish/`.
## Security & Configuration
- Do not commit secrets or downloaded core binaries; rely on packaging scripts/CI.
- Submodules: clone/update with `--recursive` when needed.
- Keep platformspecific code isolated (Windows WPF vs Avalonia) to avoid regressions.
## Agent Notes
- Follow this files scope for style and layout; keep patches minimal and targeted.
- Prefer simplifying data flow over adding conditionals; avoid deep nesting.

View file

@ -54,9 +54,6 @@ public class ProfilesViewModel : MyReactiveObject
[Reactive]
public bool SubUsageIndeterminate { get; set; }
[Reactive]
public bool SubUsageIndeterminate { get; set; }
[Reactive]
public int SubExpirePercent { get; set; }
@ -70,9 +67,6 @@ public class ProfilesViewModel : MyReactiveObject
[Reactive]
public bool SubExpireIndeterminate { get; set; }
[Reactive]
public bool SubExpireIndeterminate { get; set; }
[Reactive]
public SubItem SelectedMoveToGroup { get; set; }