BinaryFormatterUtility 1.0.2

dotnet add package BinaryFormatterUtility --version 1.0.2                
NuGet\Install-Package BinaryFormatterUtility -Version 1.0.2                
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="BinaryFormatterUtility" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BinaryFormatterUtility --version 1.0.2                
#r "nuget: BinaryFormatterUtility, 1.0.2"                
#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 BinaryFormatterUtility as a Cake Addin
#addin nuget:?package=BinaryFormatterUtility&version=1.0.2

// Install BinaryFormatterUtility as a Cake Tool
#tool nuget:?package=BinaryFormatterUtility&version=1.0.2                
/// <summary>
/// Application Settings
/// Need Serializable attribute
/// </summary>
[Serializable]
public class BinaryFormatterUtilityTesterSettings
{
    public BinaryFormatterUtilityTesterSettings()
    {
        StartupHistory = new List<DateTime>();
        CurrentLocationAndSize = new Rectangle(100,100,400,200);
    }

    public Rectangle CurrentLocationAndSize;
    public DateTime LatestStartup;
    public List<DateTime> StartupHistory;

}

public partial class BinaryFormatterUtilityTester : Form
{
    const string SETTINGS_PATH = ".\\settings.dat";

    public BinaryFormatterUtilityTester()
    {
        /** load settings */
        var settings = BinaryFormatterUtility.BinaryFormatterUtil.Load<BinaryFormatterUtilityTesterSettings>(SETTINGS_PATH);

        FormClosing += (sender, e) =>
        {
            /** save settings when closing. */
            settings.CurrentLocationAndSize = new Rectangle(Top, Left, Width, Height);
            BinaryFormatterUtility.BinaryFormatterUtil.Save(SETTINGS_PATH, settings);
        };

        var statusStrip = new StatusStrip() { Parent = this, };
        var progress = new ToolStripStatusLabel()
        {
            TextAlign = ContentAlignment.MiddleLeft,
            Spring = true,
            Text = settings.LatestStartup != default(DateTime) ?
            string.Format("Last started: {0}", settings.LatestStartup) : "Last started: -",
        };

        statusStrip.Items.Add(progress);

        ListBox listBox = new ListBox() { Parent = this, Dock = DockStyle.Top, };

        SizeChanged += (sender, e) =>
        {
            listBox.Height = ClientSize.Height - progress.Height;
            progress.Width = statusStrip.Width - 10;
        };

        StartPosition = FormStartPosition.Manual;
        Location = new Point(settings.CurrentLocationAndSize.Top, settings.CurrentLocationAndSize.Left);
        Size = new Size(settings.CurrentLocationAndSize.Width, settings.CurrentLocationAndSize.Height);

        settings.LatestStartup = DateTime.Now;
        settings.StartupHistory.Add(DateTime.Now);
        if (settings.StartupHistory.Count > 5) settings.StartupHistory.RemoveAt(0);

        listBox.Items.AddRange(settings.StartupHistory.Select(x => x.ToString()).ToArray());

    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  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.

This package has no dependencies.

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.2 305 1/7/2022

v1.0.2.0