Skip to content
Roman Kuzmin edited this page Dec 28, 2024 · 1 revision

FarNet 5.7.0 modules configuration

%FARPROFILE%\FarNet: new single file FarNet.xml replaces old <Module>\FarNet.binary files.

This file data are maintained by Options \ Plugin configuration \ FarNet.

To resurrect some data like complex masks for editors or drawers, you may use the PowerShell script Import-Binary.ps1 and command:

(Import-Binary.ps1 FarNet.binary).Values

Retired FarNet.Settings

(FarNet 5.6.0)

Old settings based on System.Configuration, .resources files, edited in panels, are retired. The namespace FarNet.Settings and all its types and FarNet.Settings.dll are gone.

New settings use XML serialization for storing and editing data in XML files. Modules use/implement FarNet.ModuleSettings from the main FarNet.dll.

Why XML?

  • editing is convenient, available in all areas, not just panels, with last positions remembered
  • module settings types are easier to create and maintain and XML serialization is powerful
  • no problem with future move to net core, old settings would require special packages
  • editing old settings in panels is odd and supported data are too primitive
  • XML files are easy for other tools

How to get data from old .resources files

Sample PowerShell script (replace the file path with yours):

$path = "$env:FARHOME\FarNet\Modules\FarNet.Demo\FarNet.Demo.resources"
$reader = [System.Resources.ResourceReader]$path
$it = $reader.GetEnumerator()
while($it.MoveNext()) {
    ''
    $it.Key
    $it.Value
}
$reader.Close()