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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2013, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
24,022 / 809 (75) +++++++
Регистрация: 28.10.2006
tlefor: Dynamics AX2012: Integrating Managed Controls with Task Recorder
Источник: http://blogs.msdn.com/b/tlefor/archi...-recorder.aspx
==============

Integrating Managed Controls with Task Recorder:
Task Recorder Overview:
Task Recorder is a feature of Dynamics AX that is used extensively by partners and customers to create process or learning documents for customer specific scenarios.

With Task Recorder, the user can document the specific steps for completing a task in AX. In record mode, Task Recorder creates a "step by step" record of user actions in a textual
format that is then used to generate PowerPoint or Word documents, complete with screen shots as appropriate.The task recorder control panel can be found in Tools>>Task Recorder

Managed Control Integration with Task Recorder Overview:
Previously, every new control added to Dynamics needed to extend the sysTaskRecorder base class by creating a specialized class with methods that supported the types of events that they wanted recorded, and called
those methods when the event occurred. In addition, Task Recorder document generation needed to be extended with knowledge of the new base class in order to properly create documents based on the new events.
The process wasn't documented and the process was cumbersome and therefore externally added controls via ActiveX were never included in Task Recorder recordings.

With the introduction of new managed controls in Dynamics AX2012, we created a simplified integration pattern, one in which a simple "generic" Task Recorder class could be used by any control.

This new class allows all new controls without specialized event recording needs to simply call into the generic 'record event' class, passing in a descriptive string, with supporting data if desired.
Example:
Create an X++ event handler for a managed control event. In this example, we'll call task recorder to "record" that event.
1) Add an
X++ event handler to respond to events raised by your control.

You can define an X++ method and designate it as an event handler for events raised by your control. In this example, we're adding a form method.
While it's possible to use class methods, it's recommended that you use form methods.

In this example, we're passing in the ManagedHost instance... if you do this, a screenshot of the control will be taken, if no control is passed, no screenshot is taken.



void ManagedHost_SelectedDateChanged(System.Object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
// the control doesn't need to be cast here... it's also available as a form global
System.Windows.Controls.DatePicker datePicker = sender as system.Windows.Controls.DatePicker;

str dateChangedValue;

if (datePicker )

{
dateChangedValue = datePicker.get_Text();

SysTaskRecorder_Eventing::fire_UserSpecified(
strfmt("The user has changed the date to %1.", ManagedHostName), ManagedHost);
}
}

2) Hook up the managed event handler

It is recommended that you define all of your event handlers in the init method of the form.

// Glue code:
Hook the managed controls event to an X++ Event Handler:


ManagedHost.add_SelectedDateChanged(new ManagedEventHandler(this,'managedEventHandler_RecordDateChanged'));



Note on performance: Task recorder event SysTaskRecorder_Eventing::fireUserSpecified() is a expensive operation. It creates a XmlDocument and takes a screen capture. So we should fire the event
only when task is being recorded and should not call it for normal forms execution. To check if task is being recorded, use SysTaskRecorderEventManager::parmRecording() and if true, then call the
event.





Источник: http://blogs.msdn.com/b/tlefor/archi...-recorder.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicscare: How to: Using the Task Recorder in Dynamics AX Blog bot DAX Blogs 0 08.02.2012 21:12
Vincent: Managed code development in AX2012 (cont.). Proxying kernel classes. Blog bot DAX Blogs 0 10.06.2011 23:12
Vincent: Managed code development in AX2012 Blog bot DAX Blogs 0 29.04.2011 19:12
axaptapedia: Task Recorder Blog bot DAX Blogs 6 29.06.2008 21:01
msdynamicsax: Task Recorder Blog bot DAX Blogs 0 04.04.2008 11:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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