Page 11 of 18

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 13 Feb, 2011 18:59
by NightRoman

Latest post of the previous page:

= 4.4.0 =

*** Massive revision of panel API and the first step to "file explorers" ***

All module panels have to be adapted to the new infrastructure.
Modules accessing changed panel members have to be updated, too.

*) Classes and interfaces
- Panel replaces IPanel
- IAnyPanel becomes IPanel (any panel: native, plugin, module)
- Removed IPanelInfo (Info property), its data moved to the class.
- Removed AlternateName from files, it is generated and used internally.

Module panel interface (old IPanel) is combined with the Panel class. The Panel
class (or derived) holds the panel data, event handlers, extra members, etc.
The Host property was removed.

*) New class Explorer
Experimental data provider dealing with FarFile. Explorers are panel helpers
but they can be used without panels for pure data operations including testing.

The PowerShellFar script Test-Explorer-.ps1 shows how various explorers work.

To be continued. All panel methods operating on its virtual file system will be
moved to explorers soon. Panels should be for pure UI classes.

*) Renamed/changed quite a number of lame names/things; just some of them:
- IPanel.Path -> CurrentDirectory
- IPanel.ActivePath -> StartDirectory
- IFar.ActivePath -> CurrentDirectory
- Use*Highlighting -> Highlighting (3 states)
- AddDots -> DotsMode:PanelDotsMode (3 states)
- Some flags were renamed, e.g. related to RealNames mode.
- Events: UpdateFiles, ExportFiles, ImportFiles, MakeDirectory, and
SetPanelDirectory (should set PanelDirectory, not CurrentDirectory).

*) IFar
New method MatchPattern() compatible with the core file masks.

Re: FarNet — .NET Far API and .NET module manager

Posted: Wed 16 Feb, 2011 08:25
by NightRoman

= 4.4.1 =

Module panel revision, continued
(changes are unlikely breaking for the most of users)

- Fixed a few bugs in the Panel class
- ExplorerResult -> JobResult (to be used elsewhere)
- Panel.UI{View/Edit}CurrentFile -> UI{View/Edit}File
- Added to explorers the DeleteFiles method and its infrastructure

Concept proof: the first version of universal search in explorer panels:
[ShiftF7] (hardcoded so far). There is no dialog yet, it finds all items and
shows them in a new search result panel. [Enter] on found items opens their
original panels as child panels of the search. If an item (its explorer)
supports Export/Import then you can view/edit it in the result panel.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 20 Feb, 2011 17:49
by NightRoman

= 4.4.2 =

*) Module panel revision, continued
(changes are unlikely breaking for the most of users)

Experimental search command moved to the new module Explore. But the search
core moved to FarNet.Tools - the idea is that any module can make its own
custom search using the tools. There are two consumers so far:
- the FarNet module Explore;
- the Start-FarSearch cmdlet in PowerShellFar.

Corrections/changes/etc. in panels and explorers:
- Renamed OperationModes -> ExplorerModes.
- CanX() methods are replaced with Function flags.
- MakePanel(args) -> CreatePanel(): now it has to create or get null.
- Removed SetupPanel() as redundant, CreatePanel() should do this job.
- CanImport is used in ExportFileArgs to let the core to [not] lock the editor.
- Panel.DataId is replaced with more flexible FileComparer approach/property.
- IPanel.TempFileExtension -> ExportFileArgs.FileNameExtension (search panel
can now Export/Edit files with the proper extensions + extensions may now be
different for different files).

Explorers/panels have TypeId and ExplorerTypeId - simple way to tell the core
to reuse the panel with several explorers of the same type.

New explorer type/method ExploreLocation - it works with pure paths and files
with no data. Advantage: standard Far search [AltF7] and [F3], [CtrlQ] work.

*) Editor
- IsLocked is settable (before opening, too).

*) Dialog
- IButton.Text - added internal setter (reflection issue).
- Added IControl.Name (not used by the core) in addition to Data.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sat 05 Mar, 2011 16:59
by NightRoman

= 4.4.3 =

*) Module panel revision, continued
(changes are unlikely breaking for the most of users)

*) Explorer
- Added quite a number of new methods, changed some existing.

*) Panels revision
- All module panels are based on explorers now. A lots of stuff moved to the
Explorer class. To be continued.

*) Panels new
- Method SelectFiles().
- Property SelectionExists.

*) IFar
- FindPanel() ~ one panel -> Panels() ~ all panels

*) Misc
- Error message box: removed [Copy], [More] shows details in the locked editor.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 13 Mar, 2011 18:51
by NightRoman

= 4.4.4 =

*) File search
- Uses the progress box with some info and [Esc] key stopping the search.
- Results are shown as Name/Owner where Owner values are explorer locations.
- Can be performed in the background with the new switch -Asynchronous of the
Explore module "explore:" command. Results are added to the panel dynamically.
NOTE: Asynchronous mode is very cool but vulnerable, some module panels are not
suitable for this, it all depends on how they and their dependencies work.
- On [Esc] you are prompted to Close or Push the result panel. Push can be done
even if the search process is still in progress. Use the FarNet menu to pop the
panel later (perhaps with more results).
- Added -Depth parameter to the explore: command.

*) Super panel, analogue of the temporary panel

Unlike the temporary panel the super panel deals with files from module panels,
including mixed. It knows how to view / edit / copy / move / delete and etc.
its files because any super file keeps the reference to its source explorer
that actually performs that operations on files, the super panel simply
dispatches operations and files.

It is opened by the empty "explore:" command (i.e. without parameters).

It is also used for search results in both sync and async modes.

*) Opening files (on [Enter])
Added methods OpenFile() and UIOpenFile() to explorer and panels. As a result,
files are opened "as usual" from super/search panels if an explorer can do.

*) ProgressBox
- New properties ElapsedFromShow (used to avoid too frequent shows),
ElapsedFromStart (useful for statistics, performance measurement, etc.)

*) ProgressForm
uses "safe" abort, if possible. The idea/code is from:

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 20 Mar, 2011 13:06
by NightRoman

= 4.4.5 =

*) Explorer arguments
Removed the Panel property. Instead, most of explorer methods are called via
virtual panel methods, so that panels have a chance to do something before or
after. There is also the Parameter property, explorers and callers may use it.

*) Explorer methods
- Renamed a few methods (see the forum discussion)
- AcceptFilesEventArgs: Delete -> ToDeleteFiles

*) Explorers and panels
- Added RenameFile() to rename a file
- Added ExportFiles() to copy/move module files to native destinations
- Super panel supports ExportFiles (actually it depends on explorers of files)

*) Misc
- FarFile class is abstract

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 27 Mar, 2011 13:19
by NightRoman

= 4.4.6 =

*) Panels & explorers
- ImportFiles supports the FilesToStay list and selection recovery.
- ExportFiles: target panel is updated to show new items without a delay.
- New *CloneFile* family of methods for [ShiftF5] in panels.
- New method Navigate(), only for the same type explorers ~ same virtual FS.
- Removed the dialog from UIRename() and NewName from RenameFileEventArgs, it
is completely up to panels and explorers what they do and show on operations.
- Select|UnselectNames parameter is IEnumerable now (and ToString() is used).

*) UI menu: .NET \ Panels
- New commands "Decrease left column", "Increase left column" work for module
panel if its current view has two columns. The vertical column separator is
moved left and right on these commands. Use [Space] to repeat the menu.
- For example it works in super panels, including search result panels.
- They are candidates for macros, e.g. for CtrlAltLeft/Right.

*) UI menu: .NET \ Console \ Decrease|Increase font size
- [Space] is used to invoke commands and repeat the menu.

*) Misc
- New property IPanel.ViewPlan - info about column kinds and widths.

*) Bugs
- Native panel state was not restored in some cases.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 03 Apr, 2011 14:16
by NightRoman

= 4.4.7 =

*) Panel
Converted some more internal methods & events into public virtual:
- WorksClosed -> UIClosed
- WorksClosing -> UIClosing
NOTE: UIClosing is useful but buggy:

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 10 Apr, 2011 16:27
by NightRoman

= 4.4.8 =

*) Panel
Converted some more internal methods into public virtual:
- WorksCtrlBreak -> UICtrlBreak
- WorksGotFocus -> UIGotFocus
- WorksLosingFocus -> UILosingFocus
- WorksRedrawing -> UIRedrawing
- WorksUpdateInfo -> UIUpdateInfo

Re: FarNet — .NET Far API and .NET module manager

Posted: Mon 18 Apr, 2011 19:16
by NightRoman

= 4.4.9 =

*) Panel
Converted one more internal method into public virtual:
- WorksViewChanged -> UIViewChanged

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 24 Apr, 2011 09:30
by NightRoman

= 4.4.10 =

*) XPath queries in file searches and related tools
- Added parameters XFile, XPath to the Explore module 'explore:' command.
- Extended the XPath engine with custom helper functions:
* equals(p1, p2) : string.Equals(p1, p2, StringComparison.OrdinalIgnoreCase)
* compare(p1, p2) : string.string.CompareOrdinal(p1, p2)
* is-match(p1, p2) : Regex.IsMatch(p1, p2)

See some examples of XPath queries in Readme.txt of the Explore module.

HINT: use .xq extensions for files with XPath expressions, so that Colorer
processes them as xquery. This is not the same, indeed, but it's quite fine.

Re: FarNet — .NET Far API and .NET module manager

Posted: Tue 03 May, 2011 02:32
by NightRoman

= 4.4.11 =

*) XPath searches
- Optimized the XPath navigator (performance gain is about 30%).
- Changed File and Directory attributes: boolean flags (ReadOnly, Archive, ...)
always exist, their values are 0 (false) and 1 (true).
- XPath files (.xq) can contain comments and variable declarations with defined
values or external. In the latter case an input box is shown in order to input
values. All this stuff has to be placed before the XPath expression.
Demo XPath file: ... ile.xq.htm

*) SearchFileCommand
- New property XVariables allow to perform XPath queries with variables.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sat 07 May, 2011 17:41
by NightRoman

= 4.4.12 =

*) XPath searches
- Fixed occasional error messages on stopping a search.
- Optimized memory use during search (weak references allows to discard some of
not used data). This introduces a little overhead but on large data sets saves
a lot of memory, avoids out of memory cases, and even may work faster.

Re: FarNet — .NET Far API and .NET module manager

Posted: Tue 24 May, 2011 08:02
by NightRoman

= 4.4.13 =
= 4.4.14 =

### No official Windows registry support for modules

Modules should use new standard FarNet settings (see ModuleSettings from new
FarNet.Settings.dll) or take care of settings on their own. In the latter case
it is recommended to use files in local or roaming folders (see IModuleManager
GetFolderPath()). Note: all names like FarNet.* are reserved.

*) New .NET menu item "Settings..."
Shows modules with at least one settings set implemented and opens the settings
panel for a selected module settings set. Use [F1] for help. The panel UI is
rather simple but it is quite enough. To be improved when needed/requested.

*) FarNet module cache (just in case of problems):
%LOCALAPPDATA%\Far Manager\FarNet\Cache.binary

These old registry data can be removed manually:

FarNet itself does not use registry when deals with modules. But it still uses
registry because Far 2 does. Thus, FarNet.Works.Registry.dll still exits and
IFar.OpenRegistryKey(), too, just in case if some module needs registry data.

*) Modules with old FarNet registry tools should be updated and some settings
migrated. PowerShellFar, RightControl, and Vessel use new settings approach, so
that their settings can be viewed/modified in the new module settings panel.

### Other changes

*) Panels
- Removed KeyPressing event (Far 3 is going to drop it, perhaps).

*) 4.4.14
Fix for localized modules.

Re: FarNet — .NET Far API and .NET module manager

Posted: Sun 29 May, 2011 15:05
by NightRoman

= 4.4.15 =

*) IFar
- All Post*(EventHandler) methods are replaced with Post*(Action). Practice
shows that EventHandler is redundant. This change is breaking but not many
modules should be affected (the latest PowerShellFar is updated).

*) IModuleManager.GetFolderPath()
- Added the 'bool create' parameter, so that creation is now optional and
it is requested only when it is really needed (on writing files). Thus:
-- Better performance (some expensive checks of existance are avoided)
-- No more empty profile sub-directories (you can remove them now)

*) Module settings engine
- Binary serialization should work fine now (with usual caveats).
- Saves one file if just one of Local and Roaming sets is dirty.
- Other tweaks.

*) Module settings panel
- Better validation of entered values (consider to [F2] before closing editors).
- Values serialized as XML can be edited as XML. Normally such data should be
[Browsable(false)] (excluded from UI) but it's up to a developer, after all.

*) Sample modules in FarNet\Modules
Replaced sample modules Tutorial-Command, Tutorial-Filer, Tutorial-Host with
one module FarNet.Demo with its Visual Studio solution/project. Features:
* Host class (not pre-loaded)
* Menu tool class (all areas)
* Command class (prefix `Demo:`)
* Filer class (`*.resources` files)
* Explorer class (used by the filer)
* Settings classes (various settings)
* Localized module resources (English and Russian)

*) Misc
- IFar.PostJob uses delegate chains instead of job queues.
- Cache.binary does not use FarNet types (bullet-proof and effective way).

Re: FarNet — .NET Far API and .NET module manager

Posted: Tue 31 May, 2011 02:15
by NightRoman

= 4.4.16 =

*) New FarNet module file structure and loading rules

Simplified the module file structure. See Readme.txt for details. It is now
mandatory that the module directory and the base assembly names are the same
(just like it is for Windows PowerShell modules).

Modules may have any other .dll files in their directories. There is no need in
using .CFG files in order to tell the core what .dll should be loaded exactly.
Thus, .CFG files are not used now.

Review your modules and make sure they follow these new rules.

*) Bugs in the module settings panel (but settings work fine)
- Some default values were shown empty.
- Settings were not saved if only reset to defaults was used ([Del] or [F8]).