OpenMRU.WinForm 1.3.0

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

// Install OpenMRU.WinForm as a Cake Tool
#tool nuget:?package=OpenMRU.WinForm&version=1.3.0                

OpenMRU.WinForm

About

OpenMRU.WinForm is a part of OpenMRUSuite and contains WinForm GUI controls for "MRU (Most resently used) files" functionality. (Both menu-like control and control similar to one on VisualStudio start window)

Quick start

For to use controls from package, add them to your Toolbox palette by reference this package, then drag-and-drop MRUItemsControl to your form and initialize it with manager and localization.

For to use menu-like control, create ToolStripMenuItem item using visual editor, create MRUItemsMenu instance and initialize it with manager and localization. After that, attach MRUItemsMenu instance to certain ToolStripMenuItem item.

See code below for details (consider you have a form 'Form1', MRUItemsControl 'mruItemsControl1', Button 'ButtonOpen' and two ToolStripMenuItems 'recentFilesToolStripMenuItem' and 'recentcustomToolStripMenuItem' on it):

public partial class Form1 : Form
{
    // link to manager.
    private readonly MRUManager manager;

    public Form1()
    {
        InitializeComponent();
        // create IMRUItemStorage implementation using default xml-based storage from OpenMRU.Core
        MRUItemFileStorage storage = new MRUItemFileStorage("demo_mru_storage.xml");
        // create default manager from OpenMRU.Core
        manager = new MRUManager();
        // init manager with storage
        manager.Initialize(storage);
        // subscribe to 'item selected' event
        manager.MRUItemSelected += Manager_MRUItemSelected;
        // init GUI control with created manager and default (eng) localization
        mruItemsControl1.Initialize(manager, new MRUGuiLocalization());

        // init menu items
        MRUItemsMenu itemsMenu = new MRUItemsMenu();
        itemsMenu.Initialize(manager, new MRUGuiLocalization());
        itemsMenu.AttachToMenu(recentFilesToolStripMenuItem);


        // init menu items - custom appearance
        MRUItemsMenu itemsMenu2 = new MRUItemsMenu();
        itemsMenu2.Initialize(manager, new MRUGuiLocalization());
        itemsMenu2.AttachToMenu(recentcustomToolStripMenuItem, "%FileName% - [%Path%] - [%AccessDate%]");
    }

    private void Manager_MRUItemSelected(string path)
    {
        MessageBox.Show("Select file from MRU: " + path);
    }

    // handle open file event
    private void ButtonOpen_Click(object sender, EventArgs e)
    {
        OpenFileDialog ofd = new OpenFileDialog();
        if (ofd.ShowDialog() == DialogResult.OK)
        {
            string path = ofd.FileName;
            // add file that was selected by user to manager (begin track it and display on GUI)
            manager.AddFile(path);
        }

    }
}

For customizing of presentation of menu items, use next patterns:

// string that represent appearance
// available placeholders:
// %FileName% - just file name (w/o path)
// %Path% - path to file (excluding file name)
// %FullFileName% - path to file + file name
// %AccessDate% - last access date of MRU item
// default is: %FullFileName%

https://github.com/dmsobeshchanskiy/OpenMRUSuite

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

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.3.0 596 10/18/2020
1.2.0 516 10/1/2020
1.1.0 408 9/21/2020
1.0.0 425 9/12/2020

New features:
- get own images from MRU items;
- 'clear all' menu item;
- caption of 'last access date' group as menu separator;