StaticExtensions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package StaticExtensions --version 1.0.0
NuGet\Install-Package StaticExtensions -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="StaticExtensions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StaticExtensions --version 1.0.0
#r "nuget: StaticExtensions, 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 StaticExtensions as a Cake Addin
#addin nuget:?package=StaticExtensions&version=1.0.0

// Install StaticExtensions as a Cake Tool
#tool nuget:?package=StaticExtensions&version=1.0.0

StaticExtensions

  • Extensions for all
     
    public static string AppExeFolder(){ return MMConLocation() + "\\"; }
    public static string MMConLocation()  -- wrapper around Application.CommonAppDataPath backing up and adding "MMCommons";
    
    
    #region object exts

    public static Boolean isNull(this object aObj)
    public static bool toBoolean(this object aObj)
    public static string toString(this object aObj)
    public static Int32 toInt32(this object aObj)
    public static DateTime toDateTime(this object aObj)
    public static Double toDouble(this object aObj)
    public static Decimal toDecimal(this object aObj)

    #region Parse strings
    
    public static int ParseCount(this string content, string delims)
    public static string ParseString(this string content, string delims, int take)
    public static string ParseFirst(this string content, string delims)
    public static string ParseLast(this string content, string delims)
    public static string ParseReverse(this string content, string delims, string concatString)

    #region Date to string with popular time formats. 
    
    public static string toStrDate(this DateTime x)
    public static string toStrDateTime(this DateTime x)
    public static string toStrTime(this DateTime x)
    public static string ToStrDateMM(this DateTime x)
    public static string toStrDay(this DateTime x)

    #region Double

    public static Int32 toInt32(this double x)
    public static Int32 toInt32T(this double x)
    public static string toStr2(this double x)
    public static string toStr2P(this double x, Int32 iDigitToPad)
    public static string toStr4(this double x)
    public static string toStr4P(this double x, Int32 iDigitToPad)
    public static string toStr8(this double x)
    public static string toStr8P(this double x, Int32 iDigitToPad)
    public static decimal toDecimal(this double x)
    public static double toPointsVertical(this double dIn)
    public static double toPointsHorizontal(this double dIn)

    #region Decimal
    
    public static float toFloat(this decimal x) 
    public static Int32 toInt32(this decimal x)
    public static Int32 toInt32T(this decimal x)
    public static string toStr2(this decimal x)
    public static string toStr2P(this decimal x, Int32 iDigitToPad)
    public static string toStr4(this decimal x)
    public static string toStr4P(this decimal x, Int32 iDigitToPad)
    public static string toStr8(this decimal x)
    public static string toStr8P(this decimal x, Int32 iDigitToPad)
    public static double toDouble(this decimal x)

    #region cryptish masks 
    
    // variant uses ? as fillers instead of = for base64 in inifiles.
    public static string toBase64EncryptStr(this string Text)
    public static string toBase64DecryptStr(this string Text)

    public static Int32 toSum(this byte[] value)
    public static string toHexStr(this byte[] byteArray) 
    public static byte[] toByteArray(this string hexString)
    public static string toFiletoMD5(string filePath) 

    #region exceptions
    
    public static string toWalkExcTreePath(this Exception e)   
    public static Exception toAppLog(this Exception e, string sLocation)
    public static void toAppLog(this string sLine)
    public static string toTextFile(this string sMsg, string sLogFileName)
    public static string toTextFileLine(this string sMsg, string sLogFileName)
    public static Exception toLogException(this Exception e, string sLogName)

    #region Images

    public static Regex r = new Regex(":");
    
    //retrieves the datetime WITHOUT loading the whole image
    public static DateTime GetDateTakenFromImage(this string path) 

    // GetColors by Matt Meents, creates const foreach ARGB and then sum out the colors...
    public static Color[] GetColors(Color A, Color B, int HowMany)

    #endregion
Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 3.5

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on StaticExtensions:

Package Downloads
AppCrypto

Reusable Helpers and Cuncurrent Dictionaries and IniFile

DiagramNet

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.3 275 12/24/2022
2.0.2 458 11/27/2022
2.0.1 352 11/20/2022
2.0.0 62 11/19/2022
1.0.3 326 11/13/2022
1.0.2 316 11/12/2022
1.0.0 391 11/11/2022

Initial Release.