HotRS.Tools.Std 1.0.0

dotnet add package HotRS.Tools.Std --version 1.0.0
NuGet\Install-Package HotRS.Tools.Std -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HotRS.Tools.Std" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HotRS.Tools.Std --version 1.0.0
#r "nuget: HotRS.Tools.Std, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HotRS.Tools.Std as a Cake Addin
#addin nuget:?package=HotRS.Tools.Std&version=1.0.0

// Install HotRS.Tools.Std as a Cake Tool
#tool nuget:?package=HotRS.Tools.Std&version=1.0.0

HotRS.Tools.Std

Various tools and extensions for .Net Standard 2.1 (Built in VS 2022 with C# 10 syntax)

Follow/Contribute: https://github.com/rkreisel/HotRS.Tools.Std

Categories

  1. Console Application Helper CloseIfNotAborted(int seconds = 60) - closes the application after the defined number of seconds if the user does not press a key.

  2. Extensions

    1. Assembly

      GetTextFileFromAssembly(this Assembly asm, string filename)
      
    2. Collection

      IsNullOrEmpty<T>(this IEnumerable<T> source)
      
    3. Enum Three extensions to simplify using attributes on Enums:

      GetEnumDescription<T>(this T value, bool useDisplayIfNoDesc = true, bool useDefaultIfNoDescOrDisplay = true) 
      
      GetDataType<T>(this T value)
      
      GetValueFromDescription<T>(this T value, string description)
      
    4. Exception Four extensions for Exceptions:

      /*
      Access the normally readonly Data property. Useful for passing detailed information to the "catcher" of the exception.
      */
      SetData<T>(this T source, IDictionary<string, string> data) 
      
      //Access the normally readonly HelpLink property
      SetHelpLink<T>(this T source, string helpLink) 
      
      /*
      Returns a simple List<Exception> with all the exceptions in the primary 
      exception.
      */    
      GetInnerExceptions(this Exception ex)
      
      //Returns a list of all the exception messages as a single string
      AllExceptionMessages<T>(this T source, bool withCR = true) 
      
    5. Object A new custom CheckForNull extension that allows the developer to throw a custom exception of <T> with a custom message

      CheckForNull<T>(this object o, string paramName, string message = "") 
      
    6. String A handful of string manipulation extensions:

      ToNullableDateTime(this string s)
      ToNullableInt(this string s) 
      AddCSVInjectionProtection(this string source)
      RemoveCSVInjectionProtection(this string source)
      DateStringFromExcelDateString(this string source, string format = null)
      AppendListToString<T>(this string source, List<T> list, string prefix = ", ")
      
    7. Helpers

    8. Miscellaneous

      1. Directory

        CleanUp(string folder, int hours)
        
        EnsurePathExists(string path)
        
      2. Reflection

        GetCurrentMethod()	
        
    9. ZipTools

      GetManifest(string fileName)
      
      ExtractFile(string zipFileName, string itemPathAndName)
      
    10. Office Office File Property Helper

      /*
      Gets the extended file properties (Owner, LastUpdatedBy, whatever else is there)
      */
      GetProperties(string fileName)
      
    11. Testing Two methods that allow unit testing of private methods With the caveat that is is NOT considered Best Practice to test private methods independently....

      GetPrivateMethod<T>(T source, string methodName) where T : class
      
      GetPrivateMethodAsync<T>(T source, string methodName) where T : class
      
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 426 4/24/2022
0.0.1 390 3/27/2022

Generic .Net standard version of RK.HotRSTools