IResourceExporter.Consumer

Syntax

Consumer: Object;

Description

The Consumer property determines the object, in which resources are exported.

Example

Executing the example requires that the repository contains resources with the RESOURCES identifier. Russian and English languages should be in the given resources.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    ExpObj: ResourceExporter;
    Cons: DtTextConsumer;
    ResObj : IResourceObject;
    CountrysArr: Array[0..1Of String;
Begin
    Cons := New DtTextConsumer.Create;
    ExpObj := New ResourceExporter.Create;
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("RESOURCES").Edit;
    ResObj := MObj As IResourceObject;
    Cons.File := "C:\Res.txt";
    Cons.WriteHeader := True;
    ExpObj.Consumer := Cons;
    CountrysArr[0] := "ru";
    CountrysArr[1] := "en";
    ExpObj.Locales := CountrysArr;
    ExpObj.Resource := ResObj;
    ExpObj.Export;
End Sub UserProc;

After executing the example all resources strings referred to Russian and English languages are exported into the C:\Res.txt file.

See also:

IResourceExporter