AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.05.2007, 18:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,488 / 846 (79) +++++++
Регистрация: 28.10.2006
axaptapedia: Tabax Plugin API
Источник: http://www.axaptapedia.com/Tabax_Plugin_API
==============

Summary: /* goals */
Plugin API is supported by [[Tabax]] from version 0.3
=== goals ===
Provide users of [[tabax]] some methods to modify it without changing it's source code.

=== what is plugin ===
Plugin is a class with name starting with the 'TabaxPlugin_' prefix and which has a 'tabax' property

Tabax enumerates such classes and sets the 'tabax' property to itself (see 'attachPlugins' method of the 'Tabax' form)

=== what plugin can do ===
When Tabax sets the 'tabax' property of plugin it can modify it behaviour by:
*subscribing to events
*using methods of tabax

For ease of use available events and utility methods are in the TabaxPluginBase class. Tabax service methods are in the Tabax abstract class.

=== example ===
Tabax plugin SDK contains an example of plugin, which modifys default behaviour of Tabax input box the following way: if you input a string like "hello " it outputs to the infolog Hello,

Source code:

/// Hello world plugin for tabax
class TabaxPlugin_Hello extends TabaxPluginBase
{
}
/// method 'connected' is defined in the TabaxPluginBase
/// it is called after tabax have loaded the plugin and after setting
/// the 'tabax' property of the plugin
void connected()
{
;
// the utility macro #subscribe is defined in the TabaxPluginBase
// when plugin is compiles, this code is substitutes by:
// tabax.subscribe(methodStr(TabaxPluginBase, beforeStringInput), this);
#subscribe(beforeStringInput)
}
/// This method will be called when user inputs a string in the edit control of
/// Tabax. String inputed is in the _string parameter
/// If plugin wants tabax not to perform the standard behavoiur, this method
/// should return true
boolean beforeStringInput(Tabax _tabax, str _string)
{
#define.prefix("hello ")
// if _string starts with "hello "
if (substr(_string, 1, strLen(#prefix))==#prefix)
{
// show greeting
info("Hello, "+subStr(_string, strLen(#prefix)+1,
strLen(_string) - strLen(#prefix)));
// skip standard behavour
return true;
}
// otherwise: pervorm standard behavour
return false;
}



Источник: http://www.axaptapedia.com/Tabax_Plugin_API
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Kashperuk Ivan: Tabax plugins' update - RecentWindows, RecentProjects Blog bot DAX Blogs 0 27.06.2007 21:40
Kashperuk Ivan: 3 great Tabax Plugins Blog bot DAX Blogs 2 15.05.2007 11:55
axcoder: Tabax v 0.3 Blog bot DAX Blogs 0 14.05.2007 18:00
axaptapedia: DEV TabaxPlugin RecentWindows Blog bot DAX Blogs 0 14.05.2007 18:00
axaptapedia: DEV TabaxPlugin RecentProjects Blog bot DAX Blogs 0 14.05.2007 18:00

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:33.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.