
Hi all,
I need to create a customized dialog, developed with the SysOperationService framework. In particular, I must implement the following job (that open a dialog in "multiselect" mode):
static void multiselectField(Args _args)
{
int idx;
int cnt;
boolean result;
System.String[] files;
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.set_Multiselect(true);
dlg.set_DefaultExt(".txt");
dlg.set_Filter("Text documents|*.txt|All files|*.*");
result = dlg.ShowDialog();
if (result)
{
files = dlg.get_FileNames();
cnt = files.get_Count();
for (idx = 0; idx <= cnt; idx++)
{
info(files.get_Item(idx));
}
}
}
Where should I insert the code shown below? In the contract class?
Thanks in advance.
Giuseppe
*This post is locked for comments
I have the same question (0)First consider the logical perspective - does this logic form a part of data contract? It doesn't. It belongs to the UI builder component.
The other question is implementation. Either you will find a way how to inject your code to a UI builder class, or you'll have to create a new form in AOT and use it as the dialog. Look for controllers overriding templateForm() method, if you need an example of the latter approach.