forked from BeyondDimension/SteamTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,323 additions
and
931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.56 KB
(590%)
src/BD.WTTS.Client.Avalonia/UI/Assets/Logos/avaloniaui-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...WTTS.Client.Tools.OpenSourceLibraryList/BD.WTTS.Client.Tools.OpenSourceLibraryList.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>pub</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<ApplicationIcon>..\..\res\icons\app\v2\Icon.ico</ApplicationIcon> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<DefineConstants>TOOL_OSL;$(DefineConstants)</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<AllowedReferenceRelatedFileExtensions> | ||
<!-- Prevent default XML and PDB files copied to output in RELEASE. | ||
Only *.allowedextension files will be included, which doesn't exist in my case. | ||
--> | ||
.allowedextension | ||
</AllowedReferenceRelatedFileExtensions> | ||
<DebugType>none</DebugType> | ||
<DebugSymbols>false</DebugSymbols> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\AssemblyInfo.Constants.cs"> | ||
<LinkBase>Properties</LinkBase> | ||
</Compile> | ||
<Compile Remove="..\ImplicitUsings.Common.cs" /> | ||
<Compile Include="..\Utils.cs" /> | ||
<Compile Include="..\ImplicitUsings.MessagePack.cs"> | ||
<LinkBase>Properties</LinkBase> | ||
</Compile> | ||
<Compile Include="..\BD.WTTS.Client\Models\HyperlinkModel.cs"> | ||
<LinkBase>Models</LinkBase> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- PackageReference --> | ||
<PackageReference Include="BD.Common" /> | ||
</ItemGroup> | ||
|
||
<Import Project="..\TFM_NETX.props" /> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using BD.WTTS.Models; | ||
|
||
const string OpenSourceLibraryListEmoji = "📄"; | ||
|
||
var path = Path.Combine(ProjectUtils.ProjPath, "doc", "open-source-library.md"); | ||
|
||
using var fs = IOPath.OpenRead(path, false); | ||
using var sr = new StreamReader(fs!, Encoding.UTF8); | ||
|
||
var list = new List<HyperlinkModel>(); | ||
var isOpenSourceLibraryList = false; | ||
string? line; | ||
do | ||
{ | ||
line = sr.ReadLine(); | ||
if (line == null) break; | ||
if (line.StartsWith("#")) | ||
{ | ||
if (isOpenSourceLibraryList) | ||
{ | ||
break; | ||
} | ||
if (line.Contains(OpenSourceLibraryListEmoji) && (line.Contains("开源") || (line.Contains("Open") && line.Contains("Source")))) | ||
{ | ||
isOpenSourceLibraryList = true; | ||
} | ||
} | ||
if (isOpenSourceLibraryList) | ||
{ | ||
if (!string.IsNullOrWhiteSpace(line)) | ||
{ | ||
if (line.StartsWith("* ")) | ||
{ | ||
var name = line.Substring("[", "]"); | ||
if (string.IsNullOrWhiteSpace(line)) continue; | ||
var index = line.IndexOf("]"); | ||
if (index < 0) continue; | ||
var url = line[index..].Substring("(", ")"); | ||
if (string.IsNullOrWhiteSpace(url)) continue; | ||
var item = new HyperlinkModel(name, url); | ||
list.Add(item); | ||
} | ||
} | ||
} | ||
} | ||
while (true); | ||
|
||
var bytes = Serializable.SMP2(list.OrderBy(x => x.Text).ToArray()); | ||
File.WriteAllBytes(path.TrimEnd(".md") + ".mpo", bytes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
namespace BD.WTTS.Models; | ||
|
||
public sealed class HyperlinkModel | ||
[MP2Obj(SerializeLayout.Explicit)] | ||
public sealed partial class HyperlinkModel | ||
{ | ||
[MP2Constructor] | ||
public HyperlinkModel(string text, string url) | ||
{ | ||
Text = text; | ||
Url = url; | ||
#if !TOOL_OSL | ||
Command = ReactiveCommand.CreateFromTask(async () => | ||
{ | ||
await Browser2.OpenAsync(url); | ||
}); | ||
#endif | ||
} | ||
|
||
#if !TOOL_OSL | ||
public HyperlinkModel(string text, ICommand command) | ||
{ | ||
Text = text; | ||
Command = command; | ||
} | ||
#endif | ||
|
||
[MP2Key(0)] | ||
public string? Text { get; } | ||
|
||
[MP2Key(1)] | ||
public string? Url { get; } | ||
|
||
public ICommand Command { get; } | ||
#if !TOOL_OSL | ||
[MP2Ignore] | ||
public ICommand? Command { get; } | ||
#endif | ||
} |
Oops, something went wrong.