Skip to content

Commit bf1729c

Browse files
committed
Initial commit.
0 parents  commit bf1729c

File tree

187 files changed

+84936
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+84936
-0
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: [blacktempel] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/master.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build master
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os: [windows-latest, ubuntu-latest]
18+
19+
env:
20+
Solution_Name: DiskInfoToolkit.sln
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup MSBuild on Windows
29+
if: runner.os == 'Windows'
30+
uses: microsoft/setup-msbuild@v2
31+
with:
32+
msbuild-architecture: x64
33+
34+
- name: Install .NET Core 8
35+
uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: 8.0.x
38+
39+
- name: Install .NET Core 9
40+
uses: actions/setup-dotnet@v4
41+
with:
42+
dotnet-version: 9.0.x
43+
44+
- name: NuGet restore Windows
45+
if: runner.os == 'Windows'
46+
run: nuget restore $env:Solution_Name
47+
48+
- name: Dotnet restore Linux
49+
if: runner.os == 'Linux'
50+
run: dotnet restore
51+
52+
# Create the app package by building and packaging the Windows Application Packaging project
53+
- name: Build Windows Release
54+
if: runner.os == 'Windows'
55+
run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform="Any CPU" -m
56+
57+
- name: Build Linux Release
58+
if: runner.os == 'Linux'
59+
run: dotnet build --configuration Release --no-restore
60+
61+
- name: Run Unit Tests
62+
run: dotnet test
63+
64+
- name: Publish net472 for Windows
65+
if: runner.os == 'Windows'
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: DiskInfoToolkit-net472
69+
path: bin/Release/net472
70+
71+
- name: Publish net481 for Windows
72+
if: runner.os == 'Windows'
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: DiskInfoToolkit-net481
76+
path: bin/Release/net481
77+
78+
- name: Publish net8
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: DiskInfoToolkit-net8
82+
path: bin/Release/net8
83+
84+
- name: Publish net9
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: DiskInfoToolkit-net9
88+
path: bin/Release/net9

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.vs/
2+
3+
ipch/
4+
debug/
5+
release/
6+
x64/
7+
TestResults/
8+
9+
bin/
10+
obj/
11+
12+
Submodules/
13+
14+
*.VC.*db
15+
*.vcxproj.user
16+
*.csproj.user
17+
18+
Log.txt
19+
20+
launchSettings.json
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<ApplicationManifest>Resources\app.manifest</ApplicationManifest>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\DiskInfoToolkit\DiskInfoToolkit.csproj" />
12+
</ItemGroup>
13+
14+
</Project>

ConsoleOutputTest/Program.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*
6+
* Copyright (c) 2025 Florian K.
7+
*
8+
* Code inspiration, improvements and fixes are from, but not limited to, following projects:
9+
* CrystalDiskInfo
10+
*/
11+
12+
using BlackSharp.Core.Extensions;
13+
using BlackSharp.Core.Logging;
14+
15+
namespace ConsoleOutputTest
16+
{
17+
internal class Program
18+
{
19+
static void Main(string[] args)
20+
{
21+
//Enable logging and set level
22+
Logger.Instance.IsEnabled = true;
23+
Logger.Instance.LogLevel = LogLevel.Trace;
24+
25+
var tc = new TestClass();
26+
27+
try
28+
{
29+
//Start our test
30+
tc.DoTest();
31+
}
32+
catch (Exception e)
33+
{
34+
//On exception, we log it to console first and also to our log file
35+
var exceptionString = e.FullExceptionString();
36+
Console.WriteLine(exceptionString);
37+
38+
Logger.Instance.Add(LogLevel.Error, exceptionString, DateTime.Now);
39+
}
40+
41+
//Save log file to current directory
42+
Logger.Instance.SaveToFile("Log.txt", false);
43+
44+
//All done
45+
Console.WriteLine("Press enter to exit...");
46+
Console.ReadLine();
47+
}
48+
}
49+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC Manifest Options
8+
If you want to change the Windows User Account Control level replace the
9+
requestedExecutionLevel node with one of the following.
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
Specifying requestedExecutionLevel element will disable file and registry virtualization.
16+
Remove this element if your application requires this virtualization for backwards
17+
compatibility.
18+
-->
19+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- A list of the Windows versions that this application has been tested on
27+
and is designed to work with. Uncomment the appropriate elements
28+
and Windows will automatically select the most compatible environment. -->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
41+
42+
<!-- Windows 10 -->
43+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
49+
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
50+
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
51+
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
52+
53+
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
54+
<!--
55+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
56+
<windowsSettings>
57+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
58+
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
59+
</windowsSettings>
60+
</application>
61+
-->
62+
63+
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
64+
<!--
65+
<dependency>
66+
<dependentAssembly>
67+
<assemblyIdentity
68+
type="win32"
69+
name="Microsoft.Windows.Common-Controls"
70+
version="6.0.0.0"
71+
processorArchitecture="*"
72+
publicKeyToken="6595b64144ccf1df"
73+
language="*"
74+
/>
75+
</dependentAssembly>
76+
</dependency>
77+
-->
78+
79+
</assembly>

0 commit comments

Comments
 (0)