IAuditFilterObjects.Add

Syntax

Add: IAuditFilterObject;

Add(): Prognoz.Platform.Interop.Metabase.IAuditFilterObject;

Description

The Add method adds a new filter to the collection.

Example

Executing the example requires the C:\Filter.xml file.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    FilCon: IAuditFiltersContainer;
    Objs: IAuditFilterObjects;
    Obj: IAuditFilterObject;
Begin
    FilCon := New AuditFiltersContainer.Create;
    FilCon.Load;
    Objs := FilCon.Filters;
    Obj := Objs.Add.Edit;
    Obj.Description := "Filter description";
    Obj.Save;
    FilCon.SaveToFile("C:\Filter.xml");
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
    FilCon: IAuditFiltersContainer;
    Objs: IAuditFilterObjects;
    Obj: IAuditFilterObject;
Begin
    FilCon := 
New AuditFiltersContainer.Create();
    FilCon.Load();
    Objs := FilCon.Filters;
    Obj := Objs.Add().Edit();
    Obj.Description := 
"Filter description";
    Obj.Save();
    FilCon.SaveToFile(
"C:\Filter.xml");
End Sub;

After executing the example new filter is added to the objects collection. The container, that stores the collection is saved to the file C:\Filter.xml.

See also:

IAuditFilterObjects