Oakrey.Applications.FileBrowsing.Abstractions 6.0.0

dotnet add package Oakrey.Applications.FileBrowsing.Abstractions --version 6.0.0
                    
NuGet\Install-Package Oakrey.Applications.FileBrowsing.Abstractions -Version 6.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="Oakrey.Applications.FileBrowsing.Abstractions" Version="6.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Applications.FileBrowsing.Abstractions" Version="6.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Applications.FileBrowsing.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Oakrey.Applications.FileBrowsing.Abstractions --version 6.0.0
                    
#r "nuget: Oakrey.Applications.FileBrowsing.Abstractions, 6.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.
#:package Oakrey.Applications.FileBrowsing.Abstractions@6.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Oakrey.Applications.FileBrowsing.Abstractions&version=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.FileBrowsing.Abstractions&version=6.0.0
                    
Install as a Cake Tool

Oakrey.Applications.FileBrowsing.Abstractions

A .NET 10 Windows library that defines the contracts and base classes for file browsing and selection services. It contains no UI or file-system scanning code and carries only minimal runtime dependencies, making it the correct reference for libraries and application layers that need to consume or extend file browsing without coupling to a concrete implementation.

Main features

Service interfaces

Interface Description
IFileBrowsingService Core browsing contract: exposes the available file list, the selected file, and a reactive SelectedFileChanged observable
IExtendedFileBrowsingService Extends IFileBrowsingService with file management operations: create, delete, edit, open folder in shell, and reload

Settings interfaces and base class

Type Description
IFileBrowsingServiceSettings Settings contract: folder path, file extension, search pattern, sub-folder scan toggle, last selected file, and a reactive FolderPathChanged observable
IFileExtendedBrowsingServiceSettings Extends IFileBrowsingServiceSettings with NewFileTemplate for naming newly created files
FileBrowsingServiceSettingsBase Abstract base class implementing IFileBrowsingServiceSettings via SettingsBase. Handles persistence, reactive folder-path notifications, and sensible defaults. Consumers must provide FileExtension and SearchPattern.

Architecture

classDiagram
    class IFileBrowsingService {
        +AvailableFiles List~FileInfo~
        +SelectedFile FileInfo?
        +SelectedFileChanged IObservable~FileInfo?~
    }

    class IExtendedFileBrowsingService {
        +CreateNewFile(name, ct) Task
        +DeleteSelectedFile(ct) Task
        +EditSelectedFile(ct) Task
        +OpenFolder(ct) Task
        +Reload(fileInfo)
        +Reload()
    }

    class IFileBrowsingServiceSettings {
        +FileExtension string
        +FolderPath string
        +FolderPathChanged IObservable~string~
        +IncludeSubFolders bool
        +LastSelectedFile string
        +SearchPattern string
    }

    class IFileExtendedBrowsingServiceSettings {
        +NewFileTemplate string
    }

    class FileBrowsingServiceSettingsBase {
        <<abstract>>
        +FileExtension string*
        +SearchPattern string*
    }

    IExtendedFileBrowsingService --|> IFileBrowsingService
    IFileExtendedBrowsingServiceSettings --|> IFileBrowsingServiceSettings
    FileBrowsingServiceSettingsBase ..|> IFileBrowsingServiceSettings

    FileBrowsingService ..|> IFileBrowsingService
    ExtendedFileBrowsingService ..|> IExtendedFileBrowsingService

    note for FileBrowsingService "Oakrey.Applications.FileBrowsing"
    note for ExtendedFileBrowsingService "Oakrey.Applications.FileBrowsing.Extended"

Concrete implementations live in the separate Oakrey.Applications.FileBrowsing and Oakrey.Applications.FileBrowsing.Extended packages. Consuming projects should reference only this abstractions package and register the implementation via the extension methods provided by those packages.

Requirements

  • .NET 10 Windows (net10.0-windows) or later
  • System.Reactive 6.1 or later � required for IObservable members on the interfaces
  • Oakrey.Log 2.0 or later
  • Oakrey.Applications.Abstractions � provides SettingsBase and ISettingsService

Installation

dotnet add package Oakrey.Applications.FileBrowsing.Abstractions

To also include the concrete implementation:

dotnet add package Oakrey.Applications.FileBrowsing
dotnet add package Oakrey.Applications.FileBrowsing.Extended

Configuration

Derive from FileBrowsingServiceSettingsBase to create a settings class for a specific file type. The two abstract members that must be implemented are FileExtension and SearchPattern.

public sealed class CsvBrowsingServiceSettings : FileBrowsingServiceSettingsBase
{
    public CsvBrowsingServiceSettings(ISettingsService settingsService)
        : base(settingsService)
    {
    }

    public override string FileExtension => "csv";

    public override string SearchPattern => "*.csv";
}

Register the settings and service in the DI container:

services.AddSingleton<IFileBrowsingServiceSettings, CsvBrowsingServiceSettings>();
services.AddFileBrowsingService();

Example usage

Consuming the abstraction

public sealed class FileViewModel
{
    private readonly IFileBrowsingService _browser;

    public FileViewModel(IFileBrowsingService browser)
    {
        _browser = browser;

        _browser.SelectedFileChanged.Subscribe(file =>
        {
            if (file is not null)
            {
                Console.WriteLine($"Selected: {file.FullName}");
            }
        });
    }

    public IReadOnlyList<FileInfo> Files => _browser.AvailableFiles;
}

Using the extended service

await _extendedBrowser.CreateNewFile("report", cancellationToken);
await _extendedBrowser.DeleteSelectedFile(cancellationToken);
await _extendedBrowser.OpenFolder(cancellationToken);

Reacting to folder changes

settings.FolderPathChanged.Subscribe(newPath =>
{
    Console.WriteLine($"Folder changed to: {newPath}");
});

settings.FolderPath = @"C:\Data\Reports";

Development notes

  • This package contains only interfaces and the abstract settings base class. No file-system scanning, shell operations, or UI code is included.
  • FileBrowsingServiceSettingsBase inherits from SettingsBase in Oakrey.Applications.Abstractions and uses ISettingsService for value persistence. Values are stored and retrieved by caller member name via Get<T>() / Set(value).
  • Reactive notifications (SelectedFileChanged, FolderPathChanged) are backed by System.Reactive Subject<T> instances and are exposed as cold IObservable<T>.
  • The target framework is net10.0-windows because System.Reactive includes Windows-specific scheduler integrations used downstream. There is no direct WPF dependency in this package.

License

MIT � Copyright � Oakrey 2016-present

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Oakrey.Applications.FileBrowsing.Abstractions:

Package Downloads
Oakrey.Applications.FileParsing.DBC

Specialized file parsing library for DBC (CAN database) files. Built on FileParsing framework with automatic parsing into DbcMatrix objects, reactive updates, and extended file management. Features CAN message/signal access, template support, and seamless integration with Oakrey.DBC parser.

Oakrey.Applications.FileBrowsing

File browsing and selection management library for .NET applications. Features directory browsing with customizable search patterns, reactive file selection tracking, persistent settings, and WPF data binding support. Includes abstract base classes for creating specialized file browsers.

Oakrey.Applications.FileParsing

Abstract framework for parsing files with automatic loading and reactive observable patterns. Provides base classes for building file-based services that automatically parse and monitor file changes. Features integration with file browsing, error handling with user prompts, and pre-loading support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0 29 5/22/2026
2.0.0 36 5/22/2026