FolderFilters: IMetabaseDialogFilters;
FolderFilters: IPrognoz.Platform.Interop.ExtCtrls.IMetabaseDialogFilters;
The FolderFilters collection property returns a collection of filters used to define folder objects in the dialog box.
Filters of this collection allow to determine, which objects are considered to be folders. The open dialog allows to view contents of object-folder and to select child objects.
By default a filter of objects-folders is not set, and contents of all objects-containers can be viewed in a dialog, as well as of the objects that are parent folders for other objects (for example, contents of assemblies, .NET-assemblies).
Folders content is filtered according to the Filters collection.
Executing the example requires a form with the Button1 button and the MetabaseOpenDialog component named MetabaseOpenDialog1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Filters, FolderFilters: IMetabaseDialogFilters;
Filter: IMetabaseDialogFilter;
Begin
Filters := MetabaseOpenDialog1.Filters;
FolderFilters := MetabaseOpenDialog1.FolderFilters;
//Creating a new filter to determine objects available in a dialog
//The filter includes platform forms, modules and assemblies
Filter := New MetabaseDialogMetaclassFilter.Create;
(Filter As IMetabaseDialogMetaclassFilter).ObjectMetaclass := MetabaseObjectMetaclass.FORE_CLASS;
Filters.AddFilter(Filter);
//creating a new filter to determine objects, which contents can be viewed
//The filter includes only platform folders
Filter := New MetabaseDialogClassFilter.Create;
(Filter As IMetabaseDialogClassFilter).ObjectClass := MetabaseObjectClass.KE_CLASS_FOLDER;
FolderFilters.AddFilter(Filter);
MetabaseOpenDialogNet1.Execute(Self);
End Sub;
Pressing the button determines two filters for the MetabaseOpenDialog1 dialog:
Filter of objects that are available in a dialog.
A filter of objects that are objects-folders.
Modules, forms and repository assemblies are included in the first filter. Only platform folders will be included in the second filter. Therefore, when initiating a dialog, one can select a module, a form, or a repository assembly in this dialog. Selecting of modules and forms that are stored inside of assemblies is disabled.
Executing the example requires a .NET form with the Button1 button and the MetabaseOpenDialogNet component named MetabaseOpenDialogNet1.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Filters, FolderFilters: IMetabaseDialogFilters;
Filter: IMetabaseDialogFilter;
Begin
Filters := MetabaseOpenDialogNet1.Filters;
FolderFilters := MetabaseOpenDialogNet1.FolderFilters;
//Creating a new filter to determine objects available in a dialog
//Filter includes platform forms, modules and assemblies
Filter := New MetabaseDialogMetaclassFilter();
(Filter As IMetabaseDialogMetaclassFilter).ObjectMetaclass := MetabaseObjectMetaclass.FORE_CLASS;
Filters.AddFilter(Filter);
//creating a new filter to determine objects, which contents can be viewed
//The filter includes only platform folders
Filter := New MetabaseDialogClassFilter();
(Filter As IMetabaseDialogClassFilter).ObjectClass := MetabaseObjectClass.KE_CLASS_FOLDER;
FolderFilters.AddFilter(Filter);
MetabaseOpenDialogNet1.Execute(Self);
End Sub;
Pressing the button determines two filters for the MetabaseOpenDialogNet1 dialog:
Filter of objects that are available in a dialog
A filter of objects that are objects-folders.
Modules, forms and repository assemblies are included in the first filter. Only platform folders will be included in the second filter. Therefore, when initiating a dialog, one can select a module, a form, or a repository assembly in this dialog. Selecting of modules and forms that are stored inside of assemblies is disabled.
See also: