IDimTextCriteria.SimpleProbe

Fore Syntax

SimpleProbe: IDimSimpleAttrProbe;

Fore.NET Syntax

SimpleProbe: Prognoz.Platform.Interop.Dimensions.IDimSimpleAttrProbe;

Description

The SimpleProbe property determines an object that helps test attributes, by values of which the search should be carried out.

Comments

This property is used to search elements in any dictionary or MDM dictionary. It is necessary to select a user class object, that implements methods of the IDimSimpleAttrProbe interface, as the value of this property.

NOTE. As a value of this property the object can be used which is returned by the property  IRdsAttributesList.Probe.

Fore Example

Executing the example requires a form, a button named Button1 positioned on this form, the RdsDictionaryBox component named RdsDictionaryBox1 and the UiRdsDictionary component used as a data source for RdsDictionaryBox1. The MDM dictionary linked to the UiRdsDictionary component, contains the Name and UserAttr attributes.

    Sub Button10OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        RdsInst: IRdsDictionaryInstance;
        Search: IRdsDictionaryElementsSearch;
        AttrsList: IRdsAttributesList;
        Crit: IDimTextCriteria;
        Keys: IRdsDictionaryElementArray;
    Begin
        RdsInst := RdsDictionaryBox1.Source.Instance;
        Search := RdsInst.CreateSearch;
        AttrsList := Search.Attributes;
        //Hint attributes in collection
        AttrsList.Attributes := "Name;Key";
        Crit := New DimTextCriteria.Create;
        //Define attributes using Probe method
        Crit.CriteriaOptions := TextCriteriaOptions.SearchProbeAttributes
            Or TextCriteriaOptions.FreeText;
        //Indicate object that determines attributes for search
        //For attributes Name and Key method returns value True as they are included to collection
        Crit.SimpleProbe := AttrsList.Probe;
        Crit.Text := "401";
        Search.SetTextCriteria(Crit);
        Keys := Search.FindAll;
    End Sub Button10OnClick;

After executing the example clicking the button creates an object for finding MDM dictionary elements. Search condition is selected. Attributes by values of which the search should be performed are defined using the Probe method. As the testing object the method uses system object based on the attribute collection stored in the AttrsList variable. After search the Keys variable contains the array of found elements keys.

Fore.NET Example

Executing the example requires a .NET form, a button named Button1 positioned on this form, the RdsDictionaryBoxNet component named RdsDictionaryBoxNet1 and any UiRdsDictionaryNet component that is a data source for RdsDictionaryBoxNet1. The MDM dictionary linked to the UiRdsDictionaryNet component, contains the Name and UserAttr attributes.

    Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
    Var
        RdsInst: IRdsDictionaryInstance;
        Search: IRdsDictionaryElementsSearch;
        AttrsList: IRdsAttributesList;
        Crit: DimTextCriteria;
        Keys: IRdsDictionaryElementArray;
    Begin
        RdsInst := RdsDictionaryBoxNet1.Source.Instance;
        Search := RdsInst.CreateSearch();
        AttrsList := Search.Attributes;
        //Hint attributes in collection
        AttrsList.Attributes := "Name;Key";
        Crit := New DimTextCriteria();
        //Define attributes using Probe method
        Crit.CriteriaOptions := TextCriteriaOptions.tecropSearchProbeAttributes
            Or TextCriteriaOptions.tecropFreeText;
        //Indicate object that determines attributes for search
        //For attributes Name and Key method returns value True as they are included to collection
        Crit.SimpleProbe := AttrsList.Probe;
        Crit.Text := "401";
        Search.SetTextCriteria(Crit);
        Keys := Search.FindAll();
    End Sub;

After executing the example clicking the button creates an object for finding MDM dictionary elements. Search condition is selected. Attributes by values of which the search should be performed are defined using the Probe method. As the testing object the method uses system object based on the attribute collection stored in the AttrsList variable. After search the Keys variable contains the array of found elements keys.

See also:

IDimTextCriteria