BinaryFormatterUtility 1.0.2

.NET Framework 4.5.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.
dotnet add package BinaryFormatterUtility --version 1.0.2
<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, C# scripting and .NET Interactive. 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 Versions
.NET Framework net452 net46 net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
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 108 1/7/2022

v1.0.2.0