mirror of
https://github.com/tribufu/tribufu-dotnet
synced 2025-06-15 01:44:19 +00:00
Create C# projects
This commit is contained in:
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
.vs/
|
||||
bin/
|
||||
obj/
|
||||
|
||||
*.filters
|
||||
*.user
|
||||
.DS_Store
|
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
22
README.md
22
README.md
@ -1,2 +1,20 @@
|
||||
# TribufuNet
|
||||
Tribufu .NET SDK
|
||||
# Tribufu .NET
|
||||
|
||||
.NET SDK to access Tribufu APIs and services.
|
||||
|
||||
[![MIT License][mit-badge]][mit-url]
|
||||
[![Discord Chat][discord-badge]][discord-url]
|
||||
|
||||
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
||||
[mit-url]: https://github.com/Tribufu/TribufuNet/blob/main/LICENSE.txt
|
||||
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
|
||||
[discord-url]: https://www.tribufu.com/discord
|
||||
|
||||
[Website](https://www.tribufu.com) |
|
||||
[Discord](https://www.tribufu.com/discord)
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT License].
|
||||
|
||||
[MIT License]: https://github.com/Tribufu/TribufuNet/blob/main/LICENSE.txt
|
||||
|
32
Tribufu.sln
Normal file
32
Tribufu.sln
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Sdk", "src\Tribufu.Sdk\Tribufu.Sdk.csproj", "{C66D6B57-324D-EAF2-3B65-75C9A7C35054}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization", "src\Tribufu.Serialization\Tribufu.Serialization.csproj", "{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization.Newtonsoft", "src\Tribufu.Serialization.Newtonsoft\Tribufu.Serialization.Newtonsoft.csproj", "{B7019B7B-A352-86BD-CCB6-747FB8661927}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
1
src/Tribufu.Sdk/README.md
Normal file
1
src/Tribufu.Sdk/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Tribufu
|
23
src/Tribufu.Sdk/Tribufu.Sdk.csproj
Normal file
23
src/Tribufu.Sdk/Tribufu.Sdk.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<PackageId>Tribufu</PackageId>
|
||||
<Version>0.1.0</Version>
|
||||
<Description>Tribufu .NET SDK</Description>
|
||||
<Authors>Tribufu</Authors>
|
||||
<Company>Tribufu</Company>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,21 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Tribufu.Serialization.Newtonsoft
|
||||
{
|
||||
public class DecimalStringConverter : JsonConverter<decimal>
|
||||
{
|
||||
public override decimal ReadJson(JsonReader reader, Type objectType, decimal existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return decimal.Parse(reader.ToString());
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, decimal value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
21
src/Tribufu.Serialization.Newtonsoft/LongStringConverter.cs
Normal file
21
src/Tribufu.Serialization.Newtonsoft/LongStringConverter.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Tribufu.Serialization.Newtonsoft
|
||||
{
|
||||
public class LongStringConverter : JsonConverter<ulong>
|
||||
{
|
||||
public override ulong ReadJson(JsonReader reader, Type objectType, ulong existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return ulong.Parse(reader.ToString());
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, ulong value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
1
src/Tribufu.Serialization.Newtonsoft/README.md
Normal file
1
src/Tribufu.Serialization.Newtonsoft/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Tribufu
|
@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<PackageId>Tribufu.Serialization.Newtonsoft</PackageId>
|
||||
<Version>0.1.0</Version>
|
||||
<Description>Tribufu Serialization Helpers for Newtonsoft.Json</Description>
|
||||
<Authors>Tribufu</Authors>
|
||||
<Company>Tribufu</Company>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
22
src/Tribufu.Serialization/DecimalStringConverter.cs
Normal file
22
src/Tribufu.Serialization/DecimalStringConverter.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Tribufu.Serialization
|
||||
{
|
||||
public class DecimalStringConverter : JsonConverter<decimal>
|
||||
{
|
||||
public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
return Convert.ToUInt64(reader.GetString());
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
22
src/Tribufu.Serialization/LongStringConverter.cs
Normal file
22
src/Tribufu.Serialization/LongStringConverter.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Tribufu.Serialization
|
||||
{
|
||||
public class LongStringConverter : JsonConverter<ulong>
|
||||
{
|
||||
public override ulong Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
return Convert.ToUInt64(reader.GetString());
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, ulong value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
1
src/Tribufu.Serialization/README.md
Normal file
1
src/Tribufu.Serialization/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Tribufu
|
23
src/Tribufu.Serialization/Tribufu.Serialization.csproj
Normal file
23
src/Tribufu.Serialization/Tribufu.Serialization.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<PackageId>Tribufu.Serialization</PackageId>
|
||||
<Version>0.1.0</Version>
|
||||
<Description>Tribufu Serialization Helpers</Description>
|
||||
<Authors>Tribufu</Authors>
|
||||
<Company>Tribufu</Company>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user