Skip to content

Commit

Permalink
General Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gus33000 committed Feb 10, 2024
1 parent 5dae0b7 commit 7567eb5
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 44 deletions.
8 changes: 4 additions & 4 deletions FirmwareGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Global
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|Any CPU.Build.0 = Release|Any CPU
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM32.ActiveCfg = Release|Any CPU
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM32.Build.0 = Release|Any CPU
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM64.ActiveCfg = Release|Any CPU
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM64.Build.0 = Release|Any CPU
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM64.ActiveCfg = Release|arm64
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|ARM64.Build.0 = Release|arm64
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|x64.ActiveCfg = Release|x64
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|x64.Build.0 = Release|x64
{85918ACF-6909-45DA-B56D-3D5113B7EA6C}.Release|x86.ActiveCfg = Release|x86
Expand All @@ -55,8 +55,8 @@ Global
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|Any CPU.Build.0 = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM32.ActiveCfg = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM32.Build.0 = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM64.ActiveCfg = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM64.Build.0 = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM64.ActiveCfg = Release|ARM64
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|ARM64.Build.0 = Release|ARM64
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|x64.ActiveCfg = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|x64.Build.0 = Release|Any CPU
{AC699AC2-883A-4278-B2A8-F0F693DC8643}.Release|x86.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion FirmwareGen/FirmwareGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<OutputPath>$(SolutionDir)build\$(Platform)\$(Configuration)\FirmwareGen\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\FirmwareGen\</IntermediateOutputPath>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Platforms>AnyCPU;x64;x86;arm64</Platforms>
<Platforms>AnyCPU;x64;x86;ARM64</Platforms>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
Expand Down
62 changes: 31 additions & 31 deletions FirmwareGen/Logging.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
/*
Copyright (c) 2019, Gustave Monce - gus33000.me - @gus33000
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
* Copyright (c) Gustave Monce and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;

namespace FirmwareGen
{
internal static class Logging
{
private static readonly ConsoleColor StockColor;

static Logging()
{
StockColor = Console.ForegroundColor;
}

public enum LoggingLevel
{
Information,
Expand Down Expand Up @@ -70,6 +61,13 @@ private static string GetDismLikeProgBar(int perc)
return "[" + bases + "]";
}

private static readonly ConsoleColor Foreground;

static Logging()
{
Foreground = Console.ForegroundColor;
}

private static readonly object lockObj = new();

public static void Log(string message, LoggingLevel severity = LoggingLevel.Information, bool returnline = true)
Expand All @@ -90,13 +88,15 @@ public static void Log(string message, LoggingLevel severity = LoggingLevel.Info
msg = " Warning ";
Console.ForegroundColor = ConsoleColor.Yellow;
break;

case LoggingLevel.Error:
msg = " Error ";
Console.ForegroundColor = ConsoleColor.Red;
break;

case LoggingLevel.Information:
msg = "Information";
Console.ForegroundColor = StockColor;
Console.ForegroundColor = Foreground;
break;
}

Expand All @@ -109,7 +109,7 @@ public static void Log(string message, LoggingLevel severity = LoggingLevel.Info
Console.Write("\r" + DateTime.Now.ToString("'['HH':'mm':'ss']'") + "[" + msg + "] " + message);
}

Console.ForegroundColor = StockColor;
Console.ForegroundColor = Foreground;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions PartitionOffsetsHelperTool/DeviceProfiles/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PartitionOffsetsHelperTool.GPT;
using System;

namespace PartitionOffsetsHelperTool.DeviceProfiles
{
Expand Down
4 changes: 3 additions & 1 deletion PartitionOffsetsHelperTool/GPT/GPTPartition.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace PartitionOffsetsHelperTool.GPT
using System;

namespace PartitionOffsetsHelperTool.GPT
{
public class GPTPartition
{
Expand Down
6 changes: 5 additions & 1 deletion PartitionOffsetsHelperTool/GPT/GPTUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace PartitionOffsetsHelperTool.GPT
using System;
using System.Collections.Generic;
using System.Linq;

namespace PartitionOffsetsHelperTool.GPT
{
internal class GPTUtils
{
Expand Down
15 changes: 9 additions & 6 deletions PartitionOffsetsHelperTool/PartitionOffsetsHelperTool.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<OutputPath>$(SolutionDir)build\$(Platform)\$(Configuration)\PartitionOffsetsHelperTool\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)intermediate\$(Platform)\$(Configuration)\PartitionOffsetsHelperTool\</IntermediateOutputPath>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Platforms>AnyCPU;x64;x86;ARM64</Platforms>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions PartitionOffsetsHelperTool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PartitionOffsetsHelperTool.GPT;
using System;

namespace PartitionOffsetsHelperTool
{
Expand Down

0 comments on commit 7567eb5

Please sign in to comment.