FarNet — плагин для написания плагинов на .NET языках

Здесь можно обсудить ваш любимый плагин.
mugz
Posts: 181
Joined: Thu 02 Jun, 2005 13:36
Contact:

Post by mugz »

Latest post of the previous page:

Outdated chm docs:

http://downloads.sourceforge.net/scrhos ... ror=belnet
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Я, честно говоря, не в курсе как построить CHM из XML доков (знаю, что вроде есть способы). Только вот уверенности нет, что это практически полезнее, чем именно те же самые комментарии в Object Browser в студии или в других прогах типа Reflector for .NET.

Однако, если потребность-таки есть, подумаю, как это организовать, только заодно нужны и советы "как".
Raindog
Posts: 2
Joined: Thu 15 Mar, 2007 19:02

Post by Raindog »

Troubles using Far.NET + Powershell.

I cannot get the latest version 3.3.6 with Powershell to properly function. In the end what I did was compile the Powershell source to work with 3.3.4 source code from the google SVN repo but I get some errors such as:

User menu $Psf.UserMenu is not defined. when I go to load the User Menu

And after a while I get an error whenever I open the "Editor" window but I cannot get it to reproduce now, but when it occurs i am forced to restart far.
mugz
Posts: 181
Joined: Thu 02 Jun, 2005 13:36
Contact:

Post by mugz »

NDoc для .NET 2.0
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Raindog
User menu $Psf.UserMenu is not defined.
- that means that YOU have not defined your user menu. Please, read help and see an example in Profile-.ps1. But, well, perhaps this is my overlook, too: the error message has to be more clear, I will fix it.
I get an error whenever I open the "Editor" window
- I would like to know how to reproduce it. Everything is working on my machine. Please, try to find and tell how to repro this.

If it is all, you don't have to use other versions or build something on your own. By the way, using mismatched versions of PowerShellFar and Far.NET3 is not recommended, results are unpredictable.
Raindog
Posts: 2
Joined: Thu 15 Mar, 2007 19:02

Post by Raindog »

I get this error when I try to run any scripts using >>: or >:

ERROR: The term 'Test-Build.ps1' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
ERROR: At line:1 char:14
ERROR: + Test-Build.ps1 <<<<


Also, I was able to get everything loading with using 3.3.6 and 1.1.6, but I sitll have the above error, so my previous post has been resolved.

I also got the user menu to show up, but only an empty menu by running

>:$Psf.UserMenu = $Far.CreateMenu()


Im not quite sure how to get powershell scripts working.

EDIT: I figured out the problem, I had to execute scripts by adding .\ in front of the script name. This should be communicated in the examples I think, or at least if there is a workaround to not requiring this syntax, to add a note about it.

EDIT2: I fixed that problem too. I had mistyped the Bench into the path.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

It is nice to know that you have resolved most of your problems. In addition I have to notice that all of them are pure PowerShell issues. I just can't (and it is not my task to) describe all PowerShell nuances in PowerShellFar documentation, it is for the plugin nuances. PowerShell is a really powerful tool, but it should be learned well, otherwise one can cut off his hand (or head).

BTW, it is highly recommended in help to include Bench in the system path. In this case you do not have to use .\ for running scripts from there. Besides, some of them call each other assuming that all of them are in the system path.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

As for a user menu ">:$Psf.UserMenu = $Far.CreateMenu()" just creates an empty menu. You have to fill it with what you want. And you should not do it manually, put this code in your startup profile. See Bench\Profile-.ps1 for an example. The things like these are described in help.
mugz
Posts: 181
Joined: Thu 02 Jun, 2005 13:36
Contact:

Post by mugz »

mugz
Posts: 181
Joined: Thu 02 Jun, 2005 13:36
Contact:

Post by mugz »

еще вот: http://www.sandcastledocs.com

мне сажется, удобно будет пользоваться chm при помощи ActiveHelp при писании скриптов в фаре
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Да, инструмент, похоже, отличный, только недоделанный изрядно - даже не бета, превью. Тем не менее для нашего хелпа он годится уже сейчас и заставить его работать удалось. Так что хелп будет, ориентировочно, в эти выходные.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Хелп готов: FarNET.doc.3.3.7.rar на: http://code.google.com/p/farnet/downloads/list

Сама версия 3.3.7 будет к понедельнику.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

В связи с началом работы по реализации панельных плагинов в Far.NET вижу, что неплохо бы, наверное, и исторически существующий интерфейс доступа к данным панелей изменить-подрефакторить: 1) для единообразия 2) для производительности 3) для простоты тоже. Мне кажется, это должно быть в целом безболезненно. Но советуюсь - ругайтесь, если чей код это сильно поломает.

Итак:

- IFolder убираем вообще, будет только IFile, который описывает элемент панели.
- соответственно из IFile убирается свойство IFolder Parent
- соответственно в IPanel свойство IFolder Contents (у которого далее надо было вызывать подсвойство-список IList<IFile> Files) заменяем просто на свойство IList<IFile> Contents.

Еще, хотя с этим и не связано:

в публичном интерфейсе есть IMenuItem.FireOnClick() и IPluginMenuItem.FireOnOpen(). Раньше они были нужны для внутренних нужд, сейчас - нет. Убираю из интерфейса, если нет возражений.
mugz
Posts: 181
Joined: Thu 02 Jun, 2005 13:36
Contact:

Post by mugz »

Если по папке нельзя получить список файлов, то как панель узнает, что ей надо отображать?
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Не понял вопрос, если честно. Что значит "по папке нельзя получить список файлов" и "как панель узнает, что ей надо отображать".

Экспериментальный вариант у меня уже работает (и уже с плагин-панелями частично). Все, что кому нужно - все получают без проблем. Какие конкретно операции ты имел в виду, каких у меня нигде нет? Может чего и проглядел.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Что мне еще не нравится в исторической реализации: самая частая операция с панелью (у меня) это получение текущего элемента (чаще всего в ком строках явно или в юзер меню командах). Нелепо, что эта операция всегда обязана конвертнуть в дот нет содержимое *всей* панели только потому, что элемент имеет св-во Parent и оно должно быть либо валидно (то есть содержать все элементы), либо его вообще не нужно (что и предлагается). Я его практически никогда не использую. Если мне нужен список всей панели, я запрошу его у панели, а не у элемента.

К тому же Parent у Parent все равно не устанавливается (как и списки Files у элементов, которые IFolder), то есть то, что исторически реализовано, все равно только частичное что-то и в моей концепции лучше вообще не идти по этому пути и сохранять непротиворечивость данных.
Post Reply

Return to “Обсуждение плагинов”