This class represents filter of
Function and derived from it classes. The FunctionsFilter can be accessed as a property of a
Page object or can be used as a parameter for
DMObjectsFinder. Setting more than one criterion of matching the filter (for \example Page that the matching function must be placed on, and the matching functions category, causes that returned functions must match both conditions.
Project proj;//a valid project
Page p;//a valid page object
p.Filter.Category = Function.Enums.Category.MOTOR;
//now we have all functions having category 'MOTOR' placed on page p
Function[] functions = p.Functions;
//other way to do the same:
FunctionFilter ff = new FunctionFilter();
ff.Category = Function.Enums.Category.MOTOR;
ff.Page = p;
DMObjectsFinder objFinder = DMObjectsFinder(proj);
//now we have all functions having category 'MOTOR' placed on page p
functions = objFinder.GetFunctions(ff);
The following example shows how to filter by user-defined properties
MultiLangString mlsTestValue = new MultiLangString();
mlsTestValue.AddString(ISOCode.Language.L_de_DE, "Test043c");
string strPropertyIdentyfingName = "Page.Test043c";
UserDefinedPropertyDefinition oUDPD = UserDefinedPropertyDefinition.Create(m_oProject, strPropertyIdentyfingName, UserDefinedPropertyDefinition.Enums.ClientType.Page);
//set test property
Page oPage = m_oProject.Pages[0];
oPage.Properties[strPropertyIdentyfingName] = mlsTestValue;
//search page with property value
DMObjectsFinder oFinder = new DMObjectsFinder(m_oProject);
PagesFilter oPagesFilter = new PagesFilter();
PagePropertyList oPagePropertyList = new PagePropertyList();
AnyPropertyId oAnyPropertyId = new AnyPropertyId(m_oProject, strPropertyIdentyfingName);
oPagePropertyList[oAnyPropertyId] = mlsTestValue;
oPagesFilter.SetFilteredPropertyList(oPagePropertyList);
Page[] arrPages1 = oFinder.GetPages(oPagesFilter);