- Improved logging

This commit is contained in:
Stone-Red-Code
2021-10-08 12:50:30 +02:00
parent 0236038f2a
commit 8d99bc9fa5
92 changed files with 9468 additions and 571 deletions
Binary file not shown.
+73 -6
View File
@@ -1,16 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Stone_Red_Utilities.CollectionExtentions;
using Stone_Red_Utilities.BoolExtentions;
using Stone_Red_Utilities.ConsoleExtentions;
using Stone_Red_Utilities.FluentMath;
using Stone_Red_Utilities.Logging;
using System;
using System.Diagnostics;
namespace Stone_Red_C_Sharp_Utilities_Test
{
internal class Program
{
private static readonly Logger logger = new Logger()
{
Config = new LogConfig()
{
FatalConfig = new OutputConfig()
{
Color = ConsoleColor.DarkRed,
LogTarget = LogTarget.Console | LogTarget.DebugConsole | LogTarget.File
},
ErrorConfig = new OutputConfig()
{
Color = ConsoleColor.Red,
LogTarget = LogTarget.Console | LogTarget.DebugConsole | LogTarget.File
},
WarnConfig = new OutputConfig()
{
Color = ConsoleColor.Yellow,
LogTarget = LogTarget.Console | LogTarget.DebugConsole | LogTarget.File
},
InfoConfig = new OutputConfig()
{
Color = ConsoleColor.White,
LogTarget = LogTarget.Console | LogTarget.DebugConsole | LogTarget.File
},
DebugConfig = new OutputConfig()
{
Color = ConsoleColor.Gray,
LogTarget = LogTarget.Console | LogTarget.DebugConsole
},
FormatConfig = new FormatConfig()
{
ConsoleFormat = $"{{{LogFormatType.DateTime}:hh:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Message}}}"
}
}
};
private static void Main()
{
string[] arr = { "aa", "bb", "cc" };
arr.Print();
Trace.WriteLine("kek1");
Debug.WriteLine("kek2");
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
while (true)
{
ConsoleExt.Write("Enter the first number: ", ConsoleColor.Green);
bool success = int.TryParse(Console.ReadLine(), out int num1);
ConsoleExt.Write("Enter the second number: ", ConsoleColor.Green);
success.OneWayFalse(int.TryParse(Console.ReadLine(), out int num2));
logger.LogIf(success, "Valid input!", LogSeverity.Debug);
if (success)
{
Console.WriteLine($"{num1}/{num2} = {num1.Divide(num2)}");
}
else
{
logger.Log("Invalid input!", "Calculator", LogSeverity.Warn);
}
}
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Exception exception = (Exception)e.ExceptionObject;
logger.Log(exception + (e.IsTerminating ? "\t Process terminating!" : ""), exception.Source, LogSeverity.Fatal);
}
}
}
@@ -8,13 +8,13 @@
".NETCoreApp,Version=v5.0": {
"Stone_Red-C-Sharp-Utilities-Test/1.0.0": {
"dependencies": {
"Stone_Red-C-Sharp-Utilities": "1.0.2"
"Stone_Red-C-Sharp-Utilities": "1.0.3"
},
"runtime": {
"Stone_Red-C-Sharp-Utilities-Test.dll": {}
}
},
"Stone_Red-C-Sharp-Utilities/1.0.2": {
"Stone_Red-C-Sharp-Utilities/1.0.3": {
"runtime": {
"Stone_Red-C-Sharp-Utilities.dll": {}
}
@@ -27,7 +27,7 @@
"serviceable": false,
"sha512": ""
},
"Stone_Red-C-Sharp-Utilities/1.0.2": {
"Stone_Red-C-Sharp-Utilities/1.0.3": {
"type": "project",
"serviceable": false,
"sha512": ""
@@ -3,8 +3,7 @@
"additionalProbingPaths": [
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\David\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
]
}
}
File diff suppressed because it is too large Load Diff
@@ -8,13 +8,13 @@
".NETCoreApp,Version=v5.0": {
"Stone_Red-C-Sharp-Utilities-Test/1.0.0": {
"dependencies": {
"Stone_Red-C-Sharp-Utilities": "1.0.2.1"
"Stone_Red-C-Sharp-Utilities": "1.0.3.1"
},
"runtime": {
"Stone_Red-C-Sharp-Utilities-Test.dll": {}
}
},
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"runtime": {
"Stone_Red-C-Sharp-Utilities.dll": {}
}
@@ -27,7 +27,7 @@
"serviceable": false,
"sha512": ""
},
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"type": "project",
"serviceable": false,
"sha512": ""
@@ -3,8 +3,7 @@
"additionalProbingPaths": [
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\David\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
]
}
}
File diff suppressed because it is too large Load Diff
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -19,5 +19,5 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyTitleAttribute("Stone_Red-C-Sharp-Utilities-Test")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.
// Generated by the MSBuild WriteCodeFragment class.
@@ -6,3 +6,5 @@ build_property.ProjectTypeGuids =
build_property.PublishSingleFile =
build_property.IncludeAllContentForSelfExtract =
build_property._SupportedPlatformList = Android,iOS,Linux,macOS,Windows
build_property.RootNamespace = Stone_Red_C_Sharp_Utilities_Test
build_property.ProjectDir = C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\
@@ -1 +1 @@
3e6e32b5a238cce47f7aeb7589b17b45b34cb0fa
0695ef4057aeda21f3ce87a2a7afa2d7965dbde9
@@ -18,3 +18,23 @@ C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.genruntimeconfig.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.exe
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.deps.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.runtimeconfig.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.runtimeconfig.dev.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Debug\net5.0\Stone_Red-C-Sharp-Utilities.xml
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.AssemblyReference.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.AssemblyInfoInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.AssemblyInfo.cs
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.CoreCompileInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.CopyComplete
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Debug\net5.0\Stone_Red-C-Sharp-Utilities-Test.genruntimeconfig.cache
@@ -1 +1 @@
d8c70e80eb8e020766aa7f8073262ae63ee0a93c
6290a4409a767b69d47331bf0fe2819329d850a7
@@ -6,3 +6,5 @@ build_property.ProjectTypeGuids =
build_property.PublishSingleFile =
build_property.IncludeAllContentForSelfExtract =
build_property._SupportedPlatformList = Android,iOS,Linux,macOS,Windows
build_property.RootNamespace = Stone_Red_C_Sharp_Utilities_Test
build_property.ProjectDir = C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\
@@ -1 +1 @@
bd88301ce8fb7aadd4b4649bbdcf209c9abd7ef1
5375b33f90ea389df924475d2d3675a20dffae64
@@ -18,3 +18,23 @@ C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.genruntimeconfig.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.exe
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.deps.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.runtimeconfig.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.runtimeconfig.dev.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\bin\Release\net5.0\Stone_Red-C-Sharp-Utilities.xml
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.AssemblyReference.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.AssemblyInfoInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.AssemblyInfo.cs
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.CoreCompileInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.csproj.CopyComplete
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\ref\Stone_Red-C-Sharp-Utilities-Test.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities-Test\obj\Release\net5.0\Stone_Red-C-Sharp-Utilities-Test.genruntimeconfig.cache
@@ -1 +1 @@
d8c70e80eb8e020766aa7f8073262ae63ee0a93c
6290a4409a767b69d47331bf0fe2819329d850a7
@@ -1,41 +1,40 @@
{
"format": 1,
"restore": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj": {}
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj": {}
},
"projects": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj": {
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectUniqueName": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectName": "Stone_Red-C-Sharp-Utilities-Test",
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\obj\\",
"outputPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net5.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"projectReferences": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj"
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj"
}
}
}
@@ -64,34 +63,33 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.401\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"version": "1.0.2.1",
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"version": "1.0.3.1",
"restore": {
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectUniqueName": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectName": "Stone_Red-C-Sharp-Utilities",
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"outputPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netstandard2.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -109,6 +107,14 @@
"frameworks": {
"netstandard2.1": {
"targetAlias": "netstandard2.1",
"dependencies": {
"Vsxmd": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[1.4.5, )"
}
},
"imports": [
"net461",
"net462",
@@ -124,7 +130,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -5,14 +5,13 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.1</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\David\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
@@ -2,7 +2,7 @@
"version": 3,
"targets": {
"net5.0": {
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"type": "project",
"framework": ".NETStandard,Version=v2.1",
"compile": {
@@ -15,7 +15,7 @@
}
},
"libraries": {
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"type": "project",
"path": "../Stone_Red-C-Sharp-Utilities/Stone_Red-C-Sharp-Utilities.csproj",
"msbuildProject": "../Stone_Red-C-Sharp-Utilities/Stone_Red-C-Sharp-Utilities.csproj"
@@ -23,46 +23,44 @@
},
"projectFileDependencyGroups": {
"net5.0": [
"Stone_Red-C-Sharp-Utilities >= 1.0.2.1"
"Stone_Red-C-Sharp-Utilities >= 1.0.3.1"
]
},
"packageFolders": {
"C:\\Users\\David\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {},
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {}
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectUniqueName": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectName": "Stone_Red-C-Sharp-Utilities-Test",
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\obj\\",
"outputPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net5.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"projectReferences": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj"
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj"
}
}
}
@@ -91,7 +89,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "NeCYdZewH6fNanQP+zkM3RezZexyXY/n2C/0p/0pM8z68CQJ1pDcJ+IXp5xEPCodvU0P8joEhCwg5L/MxmPUCg==",
"dgSpecHash": "i9sxl0DK4prGdivFoHN0urjiTdeJN7pdMVng46dayLfJokZ9N5lHYpWasE93pEfNg8KMgQDtDsbVnvjJQeZa6g==",
"success": true,
"projectFilePath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"projectFilePath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities-Test\\Stone_Red-C-Sharp-Utilities-Test.csproj",
"expectedPackageFiles": [],
"logs": []
}
@@ -13,7 +13,9 @@
public static void OneWayTrue(this ref bool bol, bool input)
{
if (bol == false && input)
{
bol = true;
}
}
/// <summary>
@@ -24,7 +26,9 @@
public static void OneWayFalse(this ref bool bol, bool input)
{
if (bol == true && !input)
{
bol = false;
}
}
/// <summary>
@@ -47,7 +47,7 @@ namespace Stone_Red_Utilities.CollectionExtentions
int i = 0;
int length = collection.Count() - 1;
string split = delimiter + (delimiter == '\n' ? string.Empty : " ");
foreach (var item in collection)
foreach (T item in collection)
{
if (item is IEnumerable<T> ie)
{
@@ -109,9 +109,14 @@ namespace Stone_Red_Utilities.CollectionExtentions
if (tableStyle == TableStyle.Minimum || tableStyle == TableStyle.List)
{
if (tableStyle == TableStyle.List && forcePrint)
{
Console.Write(intersect);
}
if (!forcePrint)
{
return;
}
}
else
{
@@ -0,0 +1,46 @@
using System;
namespace Stone_Red_Utilities.FluentMath.Shapes
{
/// <summary>
/// Represents a rectangle
/// </summary>
public class Rectangle
{
/// <summary>
/// The length of the <see cref="Rectangle"/>
/// </summary>
public double Length { get; set; }
/// <summary>
/// The width of the <see cref="Rectangle"/>
/// </summary>
public double Width { get; set; }
/// <summary>
/// The diagonal of the <see cref="Rectangle"/>
/// </summary>
public double Diagonal => System.Math.Sqrt(Math.Pow(Length, 2) + Math.Pow(Width, 2));
/// <summary>
/// The area of the <see cref="Rectangle"/>
/// </summary>
public double Area => Length * Width;
/// <summary>
/// The perimeter of the <see cref="Rectangle"/>
/// </summary>
public double Perimeter => Length * 2 + Width * 2;
/// <summary>
/// Creates a new rectangle instance
/// </summary>
/// <param name="length"></param>
/// <param name="width"></param>
public Rectangle(double length, double width)
{
Length = length;
Width = width;
}
}
}
@@ -0,0 +1,164 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// DecimalFluent class
/// </summary>
public static class DecimalFluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static double ToDouble(this decimal num)
{
return (double)num;
}
/// <summary>
/// Converts number to <see cref="float"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="float"/></returns>
public static float ToSingle(this decimal num)
{
return (float)num;
}
/// <summary>
/// Converts number to <see cref="short"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="short"/></returns>
public static short ToInt16(this decimal num)
{
return (short)num;
}
/// <summary>
/// Converts number to <see cref="int"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="int"/></returns>
public static int ToInt32(this decimal num)
{
return (int)num;
}
/// <summary>
/// Converts number to <see cref="long"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="long"/></returns>
public static long ToInt64(this decimal num)
{
return (long)num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static decimal Add(this decimal num, decimal value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static decimal Subtract(this decimal num, decimal value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static decimal Multiply(this decimal num, decimal value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static decimal Divide(this decimal num, decimal value)
{
return num / value;
}
/// <inheritdoc cref="Math.Abs(decimal)"/>
public static decimal Abs(this decimal num)
{
return Math.Abs(num);
}
/// <inheritdoc cref="Math.Ceiling(decimal)"/>
public static decimal Ceiling(this decimal num)
{
return Math.Ceiling(num);
}
/// <inheritdoc cref="Math.Clamp(decimal,decimal,decimal)"/>
public static decimal Clamp(this decimal num, decimal min, decimal max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="Math.Floor(decimal)"/>
public static decimal Floor(this decimal num)
{
return Math.Floor(num);
}
/// <inheritdoc cref="Math.Round(decimal)"/>
public static decimal Round(this decimal num)
{
return Math.Round(num);
}
/// <inheritdoc cref="Math.Round(decimal,MidpointRounding)"/>
public static decimal Round(this decimal num, MidpointRounding mode)
{
return Math.Round(num, mode);
}
/// <inheritdoc cref="Math.Round(decimal,int)"/>
public static decimal Round(this decimal num, int digits)
{
return Math.Round(num, digits);
}
/// <inheritdoc cref="Math.Round(decimal,int,MidpointRounding)"/>
public static decimal Round(this decimal num, int digits, MidpointRounding mode)
{
return Math.Round(num, digits, mode);
}
/// <inheritdoc cref="Math.Sign(decimal)"/>
public static int Sign(this decimal num)
{
return Math.Sign(num);
}
/// <inheritdoc cref="Math.Truncate(decimal)"/>
public static decimal Truncate(this decimal num)
{
return Math.Truncate(num);
}
}
}
@@ -0,0 +1,290 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// DoubleFluent class
/// </summary>
public static class DoubleFluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static decimal ToDecimal(this double num)
{
return (decimal)num;
}
/// <summary>
/// Converts number to <see cref="float"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="float"/></returns>
public static float ToSingle(this double num)
{
return (float)num;
}
/// <summary>
/// Converts number to <see cref="short"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="short"/></returns>
public static short ToInt16(this double num)
{
return (short)num;
}
/// <summary>
/// Converts number to <see cref="int"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="int"/></returns>
public static int ToInt32(this double num)
{
return (int)num;
}
/// <summary>
/// Converts number to <see cref="long"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="long"/></returns>
public static long ToInt64(this double num)
{
return (long)num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static double Add(this double num, double value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static double Subtract(this double num, double value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static double Multiply(this double num, double value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static double Divide(this double num, double value)
{
return num / value;
}
/// <inheritdoc cref="Math.Abs(double)"/>
public static double Abs(this double num)
{
return Math.Abs(num);
}
/// <inheritdoc cref="Math.Acos(double)"/>
public static double Acos(this double num)
{
return Math.Acos(num);
}
/// <inheritdoc cref="Math.Acosh(double)"/>
public static double Acosh(this double num)
{
return Math.Acosh(num);
}
/// <inheritdoc cref="Math.Asin(double)"/>
public static double Asin(this double num)
{
return Math.Asin(num);
}
/// <inheritdoc cref="Math.Asinh(double)"/>
public static double Asinh(this double num)
{
return Math.Asinh(num);
}
/// <inheritdoc cref="Math.Atan(double)"/>
public static double Atan(this double num)
{
return Math.Atan(num);
}
/// <inheritdoc cref="Math.Atan2(double,double)"/>
public static double Atan2(this double num, double valuee)
{
return Math.Atan2(num, valuee);
}
/// <inheritdoc cref="Math.Atanh(double)"/>
public static double Atanh(this double num)
{
return Math.Atanh(num);
}
/// <inheritdoc cref="Math.Cbrt(double)"/>
public static double Cbrt(this double num)
{
return Math.Cbrt(num);
}
/// <inheritdoc cref="Math.Ceiling(double)"/>
public static double Ceiling(this double num)
{
return Math.Ceiling(num);
}
/// <inheritdoc cref="Math.Clamp(double,double,double)"/>
public static double Clamp(this double num, double min, double max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="Math.Cos(double)"/>
public static double Cos(this double num)
{
return Math.Cos(num);
}
/// <inheritdoc cref="Math.Cosh(double)"/>
public static double Cosh(this double num)
{
return Math.Cosh(num);
}
/// <inheritdoc cref="Math.Exp(double)"/>
public static double Exp(this double num)
{
return Math.Exp(num);
}
/// <inheritdoc cref="Math.Floor(double)"/>
public static double Floor(this double num)
{
return Math.Floor(num);
}
/// <inheritdoc cref="Math.IEEERemainder(double,double)"/>
public static double IEEERemainder(this double num, double valuee)
{
return Math.IEEERemainder(num, valuee);
}
/// <inheritdoc cref="Math.Log(double)"/>
public static double Log(this double num)
{
return Math.Log(num);
}
/// <inheritdoc cref="Math.Log(double,double)"/>
public static double Log(this double num, double newBase)
{
return Math.Log(num, newBase);
}
/// <inheritdoc cref="Math.Log10(double)"/>
public static double Log10(this double num)
{
return Math.Log10(num);
}
/// <inheritdoc cref="Math.Pow(double,double)"/>
public static double Pow(this double num, double power)
{
return Math.Pow(num, power);
}
/// <inheritdoc cref="Math.Round(double)"/>
public static double Round(this double num)
{
return Math.Round(num);
}
/// <inheritdoc cref="Math.Round(double,MidpointRounding)"/>
public static double Round(this double num, MidpointRounding mode)
{
return Math.Round(num, mode);
}
/// <inheritdoc cref="Math.Round(double,int)"/>
public static double Round(this double num, int digits)
{
return Math.Round(num, digits);
}
/// <inheritdoc cref="Math.Round(double,int,MidpointRounding)"/>
public static double Round(this double num, int digits, MidpointRounding mode)
{
return Math.Round(num, digits, mode);
}
/// <inheritdoc cref="Math.Sign(double)"/>
public static int Sign(this double num)
{
return Math.Sign(num);
}
/// <inheritdoc cref="Math.Sin(double)"/>
public static double Sin(this double num)
{
return Math.Sin(num);
}
/// <inheritdoc cref="Math.Sinh(double)"/>
public static double Sinh(this double num)
{
return Math.Sinh(num);
}
/// <inheritdoc cref="Math.Sqrt(double)"/>
public static double Sqrt(this double num)
{
return Math.Sqrt(num);
}
/// <inheritdoc cref="Math.Tan(double)"/>
public static double Tan(this double num)
{
return Math.Tan(num);
}
/// <inheritdoc cref="Math.Tanh(double)"/>
public static double Tanh(this double num)
{
return Math.Tanh(num);
}
/// <inheritdoc cref="Math.Truncate(double)"/>
public static double Truncate(this double num)
{
return Math.Truncate(num);
}
}
}
@@ -0,0 +1,122 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// IntegerFluent class
/// </summary>
public static class Int16Fluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static decimal ToDecimal(this short num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="float"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="float"/></returns>
public static float ToSingle(this short num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="double"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="double"/></returns>
public static double ToDouble(this short num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="int"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="int"/></returns>
public static int ToInt32(this short num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="long"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="long"/></returns>
public static long ToInt64(this short num)
{
return num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Add(this short num, short value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Subtract(this short num, short value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Multiply(this short num, short value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Divide(this short num, short value)
{
return num / value;
}
/// <inheritdoc cref="Math.Abs(short)"/>
public static short Abs(this short num)
{
return Math.Abs(num);
}
/// <inheritdoc cref="Math.Clamp(short,short,short)"/>
public static short Clamp(this short num, short min, short max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="Math.Sign(short)"/>
public static int Sign(this short num)
{
return Math.Sign(num);
}
}
}
@@ -0,0 +1,122 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// IntegerFluent class
/// </summary>
public static class Int32Fluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static decimal ToDecimal(this int num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="float"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="float"/></returns>
public static float ToSingle(this int num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="double"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="double"/></returns>
public static double ToDouble(this int num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="short"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="short"/></returns>
public static short ToInt16(this int num)
{
return (short)num;
}
/// <summary>
/// Converts number to <see cref="long"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="long"/></returns>
public static long ToInt64(this int num)
{
return num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Add(this int num, int value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Subtract(this int num, int value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Multiply(this int num, int value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int Divide(this int num, int value)
{
return num / value;
}
/// <inheritdoc cref="Math.Abs(int)"/>
public static int Abs(this int num)
{
return Math.Abs(num);
}
/// <inheritdoc cref="Math.Clamp(int,int,int)"/>
public static int Clamp(this int num, int min, int max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="Math.Sign(int)"/>
public static int Sign(this int num)
{
return Math.Sign(num);
}
}
}
@@ -0,0 +1,122 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// IntegerFluent class
/// </summary>
public static class Int64Fluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static decimal ToDecimal(this long num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="float"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="float"/></returns>
public static float ToSingle(this long num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="double"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="double"/></returns>
public static double ToDouble(this long num)
{
return num;
}
/// <summary>
/// Converts number to <see cref="short"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="short"/></returns>
public static short ToInt16(this long num)
{
return (short)num;
}
/// <summary>
/// Converts number to <see cref="int"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="int"/></returns>
public static int ToInt32(this long num)
{
return (int)num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static long Add(this long num, long value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static long Subtract(this long num, long value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static long Multiply(this long num, long value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static long Divide(this long num, long value)
{
return num / value;
}
/// <inheritdoc cref="Math.Abs(long)"/>
public static long Abs(this long num)
{
return Math.Abs(num);
}
/// <inheritdoc cref="Math.Clamp(long,long,long)"/>
public static long Clamp(this long num, long min, long max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="Math.Sign(long)"/>
public static long Sign(this long num)
{
return Math.Sign(num);
}
}
}
@@ -0,0 +1,290 @@
using System;
namespace Stone_Red_Utilities.FluentMath
{
/// <summary>
/// FloatFluent class
/// </summary>
public static class SingleFluent
{
/// <summary>
/// Converts number to <see cref="decimal"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="decimal"/></returns>
public static decimal ToDecimal(this float num)
{
return (decimal)num;
}
/// <summary>
/// Converts number to <see cref="double"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="double"/></returns>
public static double ToDouble(this float num)
{
return (float)num;
}
/// <summary>
/// Converts number to <see cref="short"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="short"/></returns>
public static short ToInt16(this float num)
{
return (short)num;
}
/// <summary>
/// Converts number to <see cref="int"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="int"/></returns>
public static int ToInt32(this float num)
{
return (int)num;
}
/// <summary>
/// Converts number to <see cref="long"/>
/// </summary>
/// <param name="num"></param>
/// <returns>Number as <see cref="long"/></returns>
public static long ToInt64(this float num)
{
return (long)num;
}
/// <summary>
/// Adds the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static float Add(this float num, float value)
{
return num + value;
}
/// <summary>
/// Subtracts the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static float Subtract(this float num, float value)
{
return num - value;
}
/// <summary>
/// Multiplys the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static float Multiply(this float num, float value)
{
return num * value;
}
/// <summary>
/// Divides the two nums
/// </summary>
/// <param name="num"></param>
/// <param name="value"></param>
/// <returns></returns>
public static float Divide(this float num, float value)
{
return num / value;
}
/// <inheritdoc cref="MathF.Abs(float)"/>
public static float Abs(this float num)
{
return MathF.Abs(num);
}
/// <inheritdoc cref="MathF.Acos(float)"/>
public static float Acos(this float num)
{
return MathF.Acos(num);
}
/// <inheritdoc cref="MathF.Acosh(float)"/>
public static float Acosh(this float num)
{
return MathF.Acosh(num);
}
/// <inheritdoc cref="MathF.Asin(float)"/>
public static float Asin(this float num)
{
return MathF.Asin(num);
}
/// <inheritdoc cref="MathF.Asinh(float)"/>
public static float Asinh(this float num)
{
return MathF.Asinh(num);
}
/// <inheritdoc cref="MathF.Atan(float)"/>
public static float Atan(this float num)
{
return MathF.Atan(num);
}
/// <inheritdoc cref="MathF.Atan2(float,float)"/>
public static float Atan2(this float num, float value)
{
return MathF.Atan2(num, value);
}
/// <inheritdoc cref="MathF.Atanh(float)"/>
public static float Atanh(this float num)
{
return MathF.Atanh(num);
}
/// <inheritdoc cref="MathF.Cbrt(float)"/>
public static float Cbrt(this float num)
{
return MathF.Cbrt(num);
}
/// <inheritdoc cref="MathF.Ceiling(float)"/>
public static float Ceiling(this float num)
{
return MathF.Ceiling(num);
}
/// <inheritdoc cref="Math.Clamp(float,float,float)"/>
public static float Clamp(this float num, float min, float max)
{
return Math.Clamp(num, min, max);
}
/// <inheritdoc cref="MathF.Cos(float)"/>
public static float Cos(this float num)
{
return MathF.Cos(num);
}
/// <inheritdoc cref="MathF.Cosh(float)"/>
public static float Cosh(this float num)
{
return MathF.Cosh(num);
}
/// <inheritdoc cref="MathF.Exp(float)"/>
public static float Exp(this float num)
{
return MathF.Exp(num);
}
/// <inheritdoc cref="MathF.Floor(float)"/>
public static float Floor(this float num)
{
return MathF.Floor(num);
}
/// <inheritdoc cref="MathF.IEEERemainder(float,float)"/>
public static float IEEERemainder(this float num, float value)
{
return MathF.IEEERemainder(num, value);
}
/// <inheritdoc cref="MathF.Log(float)"/>
public static float Log(this float num)
{
return MathF.Log(num);
}
/// <inheritdoc cref="MathF.Log(float,float)"/>
public static float Log(this float num, float newBase)
{
return MathF.Log(num, newBase);
}
/// <inheritdoc cref="MathF.Log10(float)"/>
public static float Log10(this float num)
{
return MathF.Log10(num);
}
/// <inheritdoc cref="MathF.Pow(float,float)"/>
public static float Pow(this float num, float power)
{
return MathF.Pow(num, power);
}
/// <inheritdoc cref="MathF.Round(float)"/>
public static float Round(this float num)
{
return MathF.Round(num);
}
/// <inheritdoc cref="MathF.Round(float,MidpointRounding)"/>
public static float Round(this float num, MidpointRounding mode)
{
return MathF.Round(num, mode);
}
/// <inheritdoc cref="MathF.Round(float,int)"/>
public static float Round(this float num, int digits)
{
return MathF.Round(num, digits);
}
/// <inheritdoc cref="MathF.Round(float,int,MidpointRounding)"/>
public static float Round(this float num, int digits, MidpointRounding mode)
{
return MathF.Round(num, digits, mode);
}
/// <inheritdoc cref="MathF.Sign(float)"/>
public static int Sign(this float num)
{
return MathF.Sign(num);
}
/// <inheritdoc cref="MathF.Sin(float)"/>
public static float Sin(this float num)
{
return MathF.Sin(num);
}
/// <inheritdoc cref="MathF.Sinh(float)"/>
public static float Sinh(this float num)
{
return MathF.Sinh(num);
}
/// <inheritdoc cref="MathF.Sqrt(float)"/>
public static float Sqrt(this float num)
{
return MathF.Sqrt(num);
}
/// <inheritdoc cref="MathF.Tan(float)"/>
public static float Tan(this float num)
{
return MathF.Tan(num);
}
/// <inheritdoc cref="MathF.Tanh(float)"/>
public static float Tanh(this float num)
{
return MathF.Tanh(num);
}
/// <inheritdoc cref="MathF.Truncate(float)"/>
public static float Truncate(this float num)
{
return MathF.Truncate(num);
}
}
}
-198
View File
@@ -1,198 +0,0 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using Stone_Red_Utilities.ConsoleExtentions;
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Specifies the severity of the log target.
/// </summary>
public enum LogTarget
{
/// <summary>
/// Writes log to console
/// </summary>
Console,
/// <summary>
/// Writes log to debug console
/// </summary>
DebugConsole,
/// <summary>
/// Writes log to file
/// </summary>
File,
/// <summary>
/// Writes log to console debug console and file
/// </summary>
All
}
/// <summary>
/// Specifies the severity of the log message.
/// </summary>
public enum LogSeverity
{
/// <summary>
/// Logs that contain the most detailed messages.
/// </summary>
Debug,
/// <summary>
/// Logs that track the general flow of the application.
/// </summary>
Info,
/// <summary>
/// Logs that highlight an abnormal activity in the flow of execution.
/// </summary>
Warning,
/// <summary>
/// Logs that highlight when the flow of execution is stopped due to a failure.
/// </summary>
Error,
/// <summary>
/// Logs that contain the most severe level of error. This type of error indicate that immediate attention may be required.
/// </summary>
Fatal
}
/// <summary>
/// Class used for logging
/// </summary>
public class Logger
{
private readonly string logPath;
private readonly LogTarget logTarget;
/// <summary>
/// Format that is used when logging to the console
/// </summary>
public string ConsoleLogFormat { get; set; }
/// <summary>
/// Format that is used when logging to the debug console
/// </summary>
public string DebugConsoleLogFormat { get; set; }
/// <summary>
/// Format that is used when logging to a file
/// </summary>
public string FileLogFormat { get; set; }
/// <summary>
/// Initializes the logger with the default format and a file path
/// </summary>
/// <param name="defaultFormat"></param>
/// <param name="logTarg"></param>
/// <param name="file"></param>
public Logger(LogTarget logTarg = LogTarget.Console, string file = null, string defaultFormat = "{<dateTime>:HH:mm:ss} | {<level>,-7} | {<source>,-15} | {<message>}")
{
if ((logTarg & LogTarget.File) == LogTarget.File || (logTarg & LogTarget.All) == LogTarget.All)
logPath = file ?? throw new ArgumentNullException(nameof(file), $"file can't be null!");
logTarget = logTarg;
ConsoleLogFormat = defaultFormat;
DebugConsoleLogFormat = defaultFormat;
FileLogFormat = defaultFormat;
}
/// <summary>
/// Log the message to the specified output
/// </summary>
/// <param name="message"></param>
/// <param name="source"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void Log(string message, string source, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
WriteLog(message, source, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
/// <summary>
/// Log the message to the specified output if the condition is met
/// </summary>
/// <param name="condition"></param>
/// <param name="message"></param>
/// <param name="source"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void LogIf(bool condition, string message, string source, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
if (condition)
WriteLog(message, source, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
/// <summary>
/// Clears the log file
/// </summary>
public void ClearLogFile()
{
if (File.Exists(logPath))
File.WriteAllText(logPath, string.Empty);
}
private void WriteLog(string message, string source, LogSeverity logSeverity, string memberName = "", string sourceFilePath = "", int sourceLineNumber = 0)
{
string consoleOutput = GetFormattedString(ConsoleLogFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
string debugOutput = GetFormattedString(DebugConsoleLogFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
string fileOutput = GetFormattedString(FileLogFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
if ((logTarget & LogTarget.Console) == LogTarget.Console)
{
ConsoleExt.WriteLine(consoleOutput, GetColor(logSeverity));
}
if ((logTarget & LogTarget.DebugConsole) == LogTarget.DebugConsole)
{
Debug.WriteLine(debugOutput);
}
if ((logTarget & LogTarget.File) == LogTarget.File)
File.AppendAllLines(logPath, new[] { fileOutput });
if ((logTarget & LogTarget.All) == LogTarget.All)
{
Debug.WriteLine(debugOutput);
ConsoleExt.WriteLine(consoleOutput, GetColor(logSeverity));
File.AppendAllLines(logPath, new[] { fileOutput });
}
}
private ConsoleColor GetColor(LogSeverity logSeverity)
{
return logSeverity switch
{
LogSeverity.Fatal => ConsoleColor.DarkRed,
LogSeverity.Error => ConsoleColor.Red,
LogSeverity.Warning => ConsoleColor.DarkYellow,
LogSeverity.Info => ConsoleColor.White,
_ => ConsoleColor.DarkGray,
};
}
private string GetFormattedString(string format, LogSeverity logSeverity, string source, string message, string memberName, string sourceFilePath, int sourceLineNumber)
{
format = format
.Replace("<dateTime>", "0")
.Replace("<level>", "1")
.Replace("<lineNumber>", "2")
.Replace("<filePath>", "3")
.Replace("<memberName>", "4")
.Replace("<source>", "5")
.Replace("<message>", "6");
return string.Format(format, DateTime.Now, logSeverity, sourceLineNumber, sourceFilePath, memberName, source, message);
}
}
}
@@ -0,0 +1,82 @@
using System;
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Logging configuration.
/// </summary>
public class LogConfig
{
/// <summary>
/// The configuration for <see cref="LogSeverity.Debug"/> messages.
/// </summary>
public OutputConfig DebugConfig { get; set; } = new OutputConfig();
/// <summary>
/// The configuration for <see cref="LogSeverity.Info"/> messages.
/// </summary>
public OutputConfig InfoConfig { get; set; } = new OutputConfig();
/// <summary>
/// The configuration for <see cref="LogSeverity.Warn"/> messages.
/// </summary>
public OutputConfig WarnConfig { get; set; } = new OutputConfig();
/// <summary>
/// The configuration for <see cref="LogSeverity.Error"/> messages.
/// </summary>
public OutputConfig ErrorConfig { get; set; } = new OutputConfig();
/// <summary>
/// The configuration for <see cref="LogSeverity.Fatal"/> messages.
/// </summary>
public OutputConfig FatalConfig { get; set; } = new OutputConfig();
/// <summary>
/// The configuration for the message format.
/// </summary>
public FormatConfig FormatConfig { get; set; } = new FormatConfig();
}
/// <summary>
/// Output configuration.
/// </summary>
public class OutputConfig
{
/// <summary>
/// The onsole color of the log message.
/// </summary>
public ConsoleColor Color { get; set; } = ConsoleColor.White;
/// <summary>
/// The target for the log message.
/// </summary>
public LogTarget LogTarget { get; set; } = LogTarget.DebugConsole;
/// <summary>
/// The log file path.
/// </summary>
public string FilePath { get; set; } = "log.log";
}
/// <summary>
/// Foramt configuration.
/// </summary>
public class FormatConfig
{
/// <summary>
/// The format for the debug console.
/// </summary>
public string DebugConsoleFormat { get; set; } = $"{{{LogFormatType.DateTime}:yyyy-MM-dd HH:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Source},-15}} | {{{LogFormatType.Message}}}";
/// <summary>
/// The format for the console.
/// </summary>
public string ConsoleFormat { get; set; } = $"{{{LogFormatType.DateTime}:yyyy-MM-dd HH:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Source},-15}} | {{{LogFormatType.Message}}}";
/// <summary>
/// The format for the log file.
/// </summary>
public string FileFormat { get; set; } = $"{{{LogFormatType.DateTime}:yyyy-MM-dd HH:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Source},-15}} | {{{LogFormatType.Message}}}";
}
}
@@ -0,0 +1,43 @@
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Specifies the info type of the log message format.
/// </summary>
public class LogFormatType
{
/// <summary>
/// The <see cref="System.DateTime"/> of the log message.
/// </summary>
public const string DateTime = "<DateTime>";
/// <summary>
/// The <see cref="Logging.LogSeverity"/> of the log message.
/// </summary>
public const string LogSeverity = "<LogSeverity>";
/// <summary>
/// The line number of the log message.
/// </summary>
public const string LineNumber = "<LineNumber>";
/// <summary>
/// The file path of the log message.
/// </summary>
public const string FilePath = "<FilePath>";
/// <summary>
/// The member name of the log message.
/// </summary>
public const string MemberName = "<MemberName>";
/// <summary>
/// The source of the log message.
/// </summary>
public const string Source = "<Source>";
/// <summary>
/// The message of the log message.
/// </summary>
public const string Message = "<Message>";
}
}
@@ -0,0 +1,33 @@
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Specifies the severity of the log message.
/// </summary>
public enum LogSeverity
{
/// <summary>
/// Logs that contain the most detailed messages.
/// </summary>
Debug,
/// <summary>
/// Logs that track the general flow of the application.
/// </summary>
Info,
/// <summary>
/// Logs that highlight an abnormal activity in the flow of execution.
/// </summary>
Warn,
/// <summary>
/// Logs that highlight when the flow of execution is stopped due to a failure.
/// </summary>
Error,
/// <summary>
/// Logs that contain the most severe level of error. This type of error indicate that immediate attention may be required.
/// </summary>
Fatal
}
}
@@ -0,0 +1,23 @@
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Specifies the target of the log message.
/// </summary>
public enum LogTarget
{
/// <summary>
/// Writes log to console
/// </summary>
Console = 1,
/// <summary>
/// Writes log to debug console
/// </summary>
DebugConsole = 2,
/// <summary>
/// Writes log to file
/// </summary>
File = 3
}
}
@@ -0,0 +1,151 @@
using Stone_Red_Utilities.ConsoleExtentions;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace Stone_Red_Utilities.Logging
{
/// <summary>
/// Class used for logging
/// </summary>
public class Logger
{
/// <summary>
/// The logging configuration.
/// </summary>
public LogConfig Config { get; set; }
/// <summary>
/// Log the message to the specified output
/// </summary>
/// <param name="message"></param>
/// <param name="source"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void Log(string message, string source, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
WriteLog(message, source, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
/// <summary>
/// Log the message to the specified output
/// </summary>
/// <param name="message"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void Log(string message, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
WriteLog(message, string.Empty, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
/// <summary>
/// Log the message to the specified output if the condition is met
/// </summary>
/// <param name="condition"></param>
/// <param name="message"></param>
/// <param name="source"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void LogIf(bool condition, string message, string source, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
if (condition)
{
WriteLog(message, source, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
}
/// <summary>
/// Log the message to the specified output if the condition is met
/// </summary>
/// <param name="condition"></param>
/// <param name="message"></param>
/// <param name="logSeverity"></param>
/// <param name="memberName"></param>
/// <param name="sourceFilePath"></param>
/// <param name="sourceLineNumber"></param>
public void LogIf(bool condition, string message, LogSeverity logSeverity = LogSeverity.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
{
if (condition)
{
WriteLog(message, string.Empty, logSeverity, memberName, sourceFilePath, sourceLineNumber);
}
}
/// <summary>
/// Clears the log file
/// </summary>
public void ClearLogFile(LogSeverity logSeverity)
{
OutputConfig outputConfig = GetOutputConfig(logSeverity);
if (File.Exists(outputConfig.FilePath))
{
File.WriteAllText(outputConfig.FilePath, string.Empty);
}
}
private void WriteLog(string message, string source, LogSeverity logSeverity, string memberName = "", string sourceFilePath = "", int sourceLineNumber = 0)
{
Config ??= new LogConfig();
string consoleOutput = GetFormattedString(Config.FormatConfig.ConsoleFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
string debugOutput = GetFormattedString(Config.FormatConfig.DebugConsoleFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
string fileOutput = GetFormattedString(Config.FormatConfig.FileFormat, logSeverity, source, message, memberName, sourceFilePath, sourceLineNumber);
OutputConfig outputConfig = GetOutputConfig(logSeverity);
if ((outputConfig.LogTarget & LogTarget.Console) == LogTarget.Console)
{
ConsoleExt.WriteLine(consoleOutput, outputConfig.Color);
}
if ((outputConfig.LogTarget & LogTarget.DebugConsole) == LogTarget.DebugConsole)
{
Trace.WriteLine(debugOutput);
}
if ((outputConfig.LogTarget & LogTarget.File) == LogTarget.File)
{
if (!File.Exists(outputConfig.FilePath))
{
File.Create(outputConfig.FilePath).Close();
}
File.AppendAllLines(outputConfig.FilePath, new[] { fileOutput });
}
}
private OutputConfig GetOutputConfig(LogSeverity logSeverity)
{
return logSeverity switch
{
LogSeverity.Fatal => Config.FatalConfig,
LogSeverity.Error => Config.ErrorConfig,
LogSeverity.Warn => Config.WarnConfig,
LogSeverity.Info => Config.InfoConfig,
_ => Config.DebugConfig
};
}
private string GetFormattedString(string format, LogSeverity logSeverity, string source, string message, string memberName, string sourceFilePath, int sourceLineNumber)
{
format = format
.Replace($"{LogFormatType.DateTime}", "0")
.Replace($"{LogFormatType.LogSeverity}", "1")
.Replace($"{LogFormatType.LineNumber}", "2")
.Replace($"{LogFormatType.FilePath}", "3")
.Replace($"{LogFormatType.MemberName}", "4")
.Replace($"{LogFormatType.Source}", "5")
.Replace($"{LogFormatType.Message}", "6");
return string.Format(format, DateTime.Now, logSeverity.ToString().ToUpper(), sourceLineNumber, sourceFilePath, memberName, source, message);
}
}
}
@@ -44,9 +44,8 @@ namespace Stone_Red_Utilities.RandomExtentions
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="random"></param>
/// <param name="_"></param>
/// <returns></returns>
public static T NextEnum<T>(this Random random, T _) where T : Enum //Not the best solution but it works
public static T NextEnum<T>(this Random random) where T : Enum //Not the best solution but it works
{
Array arr = Enum.GetValues(typeof(T));
return (T)arr.GetValue(random.Next(arr.Length));
+60
View File
@@ -0,0 +1,60 @@
using System;
using System.Reflection;
namespace Stone_Red_Utilities.Reflection
{
/// <summary>
/// Reflection class
/// </summary>
public static class Reflection
{
/// <summary>
/// Copies all properties of an object to a new one.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <returns></returns>
public static T CopyProperties<T>(this object obj) where T : new()
{
T newObj = new T();
Type objType = obj.GetType();
Type newObjType = newObj.GetType();
foreach (PropertyInfo propertyInfo in objType.GetProperties())
{
PropertyInfo newObjPropertyInfo = newObjType.GetProperty(propertyInfo.Name);
if (!(newObjPropertyInfo is null) && newObjPropertyInfo.PropertyType.IsAssignableFrom(propertyInfo.PropertyType))
{
newObjPropertyInfo.SetValue(newObj, propertyInfo.GetValue(obj));
}
}
return newObj;
}
/// <summary>
/// Copies all properties of an object to a different one.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <param name="newObj"></param>
/// <returns></returns>
public static T CopyProperties<T>(this object obj, T newObj)
{
Type objType = obj.GetType();
Type newObjType = newObj.GetType();
foreach (PropertyInfo propertyInfo in objType.GetProperties())
{
PropertyInfo newObjPropertyInfo = newObjType.GetProperty(propertyInfo.Name);
if (!(newObjPropertyInfo is null) && newObjPropertyInfo.PropertyType.IsAssignableFrom(propertyInfo.PropertyType))
{
newObjPropertyInfo.SetValue(newObj, propertyInfo.GetValue(obj));
}
}
return newObj;
}
}
}
@@ -12,13 +12,13 @@
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<AssemblyVersion>1.0.2.1</AssemblyVersion>
<FileVersion>1.0.2.1</FileVersion>
<Version>1.0.2.1</Version>
<AssemblyVersion>1.0.3.1</AssemblyVersion>
<FileVersion>1.0.3.1</FileVersion>
<Version>1.0.3.1</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities.xml</DocumentationFile>
<DocumentationFile>C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -31,4 +31,11 @@
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Vsxmd" Version="1.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+24 -11
View File
@@ -1,7 +1,6 @@
using System;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace Stone_Red_Utilities.StringExtentions
@@ -55,19 +54,21 @@ namespace Stone_Red_Utilities.StringExtentions
char[] invalidChars = Path.GetInvalidFileNameChars();
if (!allowSpaces)
{
str = str.Replace(" ", string.Empty);
}
foreach (var item in invalidChars)
foreach (char item in invalidChars)
{
str = str.Replace(item.ToString(), string.Empty);
}
var normalizedString = str.Normalize(NormalizationForm.FormD);
var stringBuilder = new StringBuilder();
string normalizedString = str.Normalize(NormalizationForm.FormD);
StringBuilder stringBuilder = new StringBuilder();
foreach (var c in normalizedString)
foreach (char c in normalizedString)
{
var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
UnicodeCategory unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
if (unicodeCategory != UnicodeCategory.NonSpacingMark)
{
stringBuilder.Append(c);
@@ -88,19 +89,21 @@ namespace Stone_Red_Utilities.StringExtentions
char[] invalidChars = Path.GetInvalidPathChars();
if (!allowSpaces)
{
str = str.Replace(" ", string.Empty);
}
foreach (var item in invalidChars)
foreach (char item in invalidChars)
{
str = str.Replace(item.ToString(), string.Empty);
}
var normalizedString = str.Normalize(NormalizationForm.FormD);
var stringBuilder = new StringBuilder();
string normalizedString = str.Normalize(NormalizationForm.FormD);
StringBuilder stringBuilder = new StringBuilder();
foreach (var c in normalizedString)
foreach (char c in normalizedString)
{
var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
UnicodeCategory unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
if (unicodeCategory != UnicodeCategory.NonSpacingMark)
{
stringBuilder.Append(c);
@@ -119,7 +122,9 @@ namespace Stone_Red_Utilities.StringExtentions
public static string Truncate(this string str, int length)
{
if (str.Length > length && length > 0)
{
return str.Substring(0, length);
}
return str;
}
@@ -134,6 +139,7 @@ namespace Stone_Red_Utilities.StringExtentions
public static string Truncate(this string str, int length, bool ellipsis)
{
if (str.Length > length && length > 0)
{
if (ellipsis)
{
return $"{str.Substring(0, length - 3)}...";
@@ -142,6 +148,7 @@ namespace Stone_Red_Utilities.StringExtentions
{
return str.Substring(0, length);
}
}
return str;
}
@@ -154,9 +161,13 @@ namespace Stone_Red_Utilities.StringExtentions
public static string CorrectNewLine(this string str)
{
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
str = str.Replace("\r\n", "\n");
}
else
{
str = str.Replace("\n", "\r\n"); //Ik that this can produce wrong results
}
return str;
}
@@ -172,7 +183,9 @@ namespace Stone_Red_Utilities.StringExtentions
foreach (char c in str)
{
if (!char.IsWhiteSpace(c))
{
result.Append(c);
}
}
return result.ToString();
}
@@ -7,18 +7,29 @@
"targets": {
".NETStandard,Version=v2.1": {},
".NETStandard,Version=v2.1/": {
"Stone_Red-C-Sharp-Utilities/1.0.2.0": {
"Stone_Red-C-Sharp-Utilities/1.0.3.0": {
"dependencies": {
"Vsxmd": "1.4.5"
},
"runtime": {
"Stone_Red-C-Sharp-Utilities.dll": {}
}
}
},
"Vsxmd/1.4.5": {}
}
},
"libraries": {
"Stone_Red-C-Sharp-Utilities/1.0.2.0": {
"Stone_Red-C-Sharp-Utilities/1.0.3.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Vsxmd/1.4.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-mvTZKIhKUFvcjYv/p9dxgSFHrAlNFIemT3ai1XAFV4yJYGu/6e73NgzfHwhDi0QevuYURVdd+p088CG6KQFENg==",
"path": "vsxmd/1.4.5",
"hashPath": "vsxmd.1.4.5.nupkg.sha512"
}
}
}
File diff suppressed because it is too large Load Diff
@@ -7,18 +7,29 @@
"targets": {
".NETStandard,Version=v2.1": {},
".NETStandard,Version=v2.1/": {
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"dependencies": {
"Vsxmd": "1.4.5"
},
"runtime": {
"Stone_Red-C-Sharp-Utilities.dll": {}
}
}
},
"Vsxmd/1.4.5": {}
}
},
"libraries": {
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
"Stone_Red-C-Sharp-Utilities/1.0.3.1": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Vsxmd/1.4.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-mvTZKIhKUFvcjYv/p9dxgSFHrAlNFIemT3ai1XAFV4yJYGu/6e73NgzfHwhDi0QevuYURVdd+p088CG6KQFENg==",
"path": "vsxmd/1.4.5",
"hashPath": "vsxmd.1.4.5.nupkg.sha512"
}
}
}
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -14,13 +14,13 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Stone_Red")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Adds useful methods")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.2.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.2.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.3.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.3.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Stone_Red-C-Sharp-Utilities")]
[assembly: System.Reflection.AssemblyTitleAttribute("Stone_Red-C-Sharp-Utilities")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.2.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.3.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/Stone-Red-Code/Stone_Red-C-Sharp-Utilities")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.
// Generated by the MSBuild WriteCodeFragment class.
@@ -1 +1 @@
ea6ef826f39150eace08005921640b734848a705
d764562853b5ba354fbea393b129e90e5ee79585
@@ -1 +1 @@
6deaaecbe153b73cd69e5aef5c8f7411fc6a1d64
e212c174a1e5a595b04913b341fd229c2266267c
@@ -8,3 +8,14 @@ C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.csprojAssemblyReference.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.deps.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.AssemblyInfoInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.AssemblyInfo.cs
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.csproj.CoreCompileInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Debug\netstandard2.1\Stone_Red-C-Sharp-Utilities.csproj.AssemblyReference.cache
@@ -4,7 +4,6 @@
<id>Stone_Red-C-Sharp-Utilities</id>
<version>1.0.2.1</version>
<authors>Stone_Red</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="file">LICENSE</license>
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
<description>Adds useful methods</description>
@@ -15,8 +14,8 @@
</dependencies>
</metadata>
<files>
<file src="C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll" target="lib\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll" />
<file src="C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml" target="lib\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml" />
<file src="C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\LICENSE" target="LICENSE" />
<file src="C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll" target="lib\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll" />
<file src="C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml" target="lib\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml" />
<file src="C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\LICENSE" target="LICENSE" />
</files>
</package>
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -14,13 +14,13 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Stone_Red")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Adds useful methods")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.2.1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.2.1")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.3.1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.3.1")]
[assembly: System.Reflection.AssemblyProductAttribute("Stone_Red-C-Sharp-Utilities")]
[assembly: System.Reflection.AssemblyTitleAttribute("Stone_Red-C-Sharp-Utilities")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.2.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.3.1")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/Stone-Red-Code/Stone_Red-C-Sharp-Utilities")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.
// Generated by the MSBuild WriteCodeFragment class.
@@ -1 +1 @@
7050d59067f2c4d7fb2c393d24fc7d30560227c7
d91dda1234dcb8f3cb5efb6b99052d23406ecd49
@@ -1 +1 @@
f0f0f7765de7b51881bd79150dfdfa528122c41c
51e61123768d6c5b1a0a6d92b017f369b83c2cff
@@ -8,3 +8,14 @@ C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Google Drive\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.csprojAssemblyReference.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.deps.json
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\bin\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.xml
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.AssemblyInfoInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.AssemblyInfo.cs
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.csproj.CoreCompileInputs.cache
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.dll
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.pdb
C:\Users\David\Programmieren\Stone_Red-C-Sharp-Utilities\Stone_Red-C-Sharp-Utilities\obj\Release\netstandard2.1\Stone_Red-C-Sharp-Utilities.csproj.AssemblyReference.cache
@@ -1,33 +1,32 @@
{
"format": 1,
"restore": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {}
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {}
},
"projects": {
"C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"version": "1.0.2.1",
"C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj": {
"version": "1.0.3.1",
"restore": {
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectUniqueName": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectName": "Stone_Red-C-Sharp-Utilities",
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"outputPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netstandard2.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -45,6 +44,14 @@
"frameworks": {
"netstandard2.1": {
"targetAlias": "netstandard2.1",
"dependencies": {
"Vsxmd": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[1.4.5, )"
}
},
"imports": [
"net461",
"net462",
@@ -60,7 +67,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -5,16 +5,18 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.1</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\David\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgVsxmd Condition=" '$(PkgVsxmd)' == '' ">C:\Users\David\.nuget\packages\vsxmd\1.4.5</PkgVsxmd>
</PropertyGroup>
</Project>
@@ -3,4 +3,7 @@
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)vsxmd\1.4.5\build\Vsxmd.targets" Condition="Exists('$(NuGetPackageRoot)vsxmd\1.4.5\build\Vsxmd.targets')" />
</ImportGroup>
</Project>
@@ -1,41 +1,68 @@
{
"version": 3,
"targets": {
".NETStandard,Version=v2.1": {}
".NETStandard,Version=v2.1": {
"Vsxmd/1.4.5": {
"type": "package",
"build": {
"build/Vsxmd.targets": {}
}
}
}
},
"libraries": {
"Vsxmd/1.4.5": {
"sha512": "mvTZKIhKUFvcjYv/p9dxgSFHrAlNFIemT3ai1XAFV4yJYGu/6e73NgzfHwhDi0QevuYURVdd+p088CG6KQFENg==",
"type": "package",
"path": "vsxmd/1.4.5",
"hasTools": true,
"files": [
".nupkg.metadata",
".signature.p7s",
"LICENSE",
"build/Vsxmd.targets",
"tools/linux-musl-x64/Vsxmd",
"tools/linux-x64/Vsxmd",
"tools/osx-x64/Vsxmd",
"tools/win-x64/Vsxmd.exe",
"tools/win-x86/Vsxmd.exe",
"vsxmd.1.4.5.nupkg.sha512",
"vsxmd.nuspec"
]
}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETStandard,Version=v2.1": []
".NETStandard,Version=v2.1": [
"Vsxmd >= 1.4.5"
]
},
"packageFolders": {
"C:\\Users\\David\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {},
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {}
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.2.1",
"version": "1.0.3.1",
"restore": {
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectUniqueName": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectName": "Stone_Red-C-Sharp-Utilities",
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"projectPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"outputPath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netstandard2.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@@ -53,6 +80,14 @@
"frameworks": {
"netstandard2.1": {
"targetAlias": "netstandard2.1",
"dependencies": {
"Vsxmd": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[1.4.5, )"
}
},
"imports": [
"net461",
"net462",
@@ -68,7 +103,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -1,8 +1,10 @@
{
"version": 2,
"dgSpecHash": "p4c3IZ9yAUJ67kieuETabF5CDiZOQrx5HZrwcxLn1ewQ4upa2wfnGjETbLHe0eiwv/Y/p0wbkqpAYMCLl3qfWA==",
"dgSpecHash": "szJPtVin5IzkXVU9ObH6EXYb2PHQ5ZOfTN/fz6Vsz068SnBXJvLOMYWPHTw47eLiq1vQxy3andOX2PcxdtU8Uw==",
"success": true,
"projectFilePath": "C:\\Users\\David\\Google Drive\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"expectedPackageFiles": [],
"projectFilePath": "C:\\Users\\David\\Programmieren\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities\\Stone_Red-C-Sharp-Utilities.csproj",
"expectedPackageFiles": [
"C:\\Users\\David\\.nuget\\packages\\vsxmd\\1.4.5\\vsxmd.1.4.5.nupkg.sha512"
],
"logs": []
}