Bind;
Bind();
The Bind method initializes the custom method.
The list of parameters is updated when initializing.
Executing the example requires that repository contains a custom Fore method with parameters.
Add links to the Fore and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
SharedParams: ISharedParams;
Methods: IForeMethods;
Method: IForeMethod;
MethodParams: IForeMethodParams;
Param: IForeMethodParam;
i: Integer;
Begin
Mb := MetabaseClass.Active;
SharedParams := Mb.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
Methods := SharedParams.Methods;
Method := Methods.Item(0);
If Not IsNull(Method) Then
Method.Bind;
MethodParams := Method.Params;
For i := 0 To MethodParams.Count - 1 Do
Param := MethodParams.Item(i);
Debug.Write("Parameter: " + Param.Param);
Debug.WriteLine(". Default value: " + Param.DefaultValue);
End For;
End If;
End Sub UserProc;
Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
SharedParams: ISharedParams;
Methods: IForeMethods;
Method: IForeMethod;
MethodParams: IForeMethodParams;
Param: IForeMethodParam;
i: Integer;
Begin
Mb := Params.Metabase;
SharedParams := Mb.SpecialObject[MetabaseSpecialObject.msoSharedParams].Bind() As ISharedParams;
Methods := SharedParams.Methods;
Method := Methods.Item[0];
If Method <> Null Then
Method.Bind();
MethodParams := Method.Params;
For i := 0 To MethodParams.Count - 1 Do
Param := MethodParams.Item[i];
System.Diagnostics.Debug.Write("Parameter: " + Param.Param);
System.Diagnostics.Debug.WriteLine(". Default value: " + Param.DefaultValue);
End For;
End If;
End Sub;
On executing the example the first custom method will be initialized. The console dialog box will display names and default values of all method parameters.
See also: