SetAttributeValue(Attribute: IMetaAttribute; Value: IDimSelection);
SetAttributeValue(Attribute: Prognoz.Platform.Interop.Rds.IMetaAttribute; Value: Prognoz.Platform.Interop.DimensionsDimSelection);
Attribute. The attribute, by which selection must be set.
Value. Elements selection, which must be set by the Attribute attribute.
The SetAttributeValue method selects indicators by the Attribute attribute.
The attribute specified as value of the Attribute parameter can be obtained in the IMetaAttributesBreadcrumb.MetaAttributes collection. The attribute selection is returned by the IMetaAttributesBreadcrumb.GetAttributeValue method.
Executing the example requires a form, a button on this form and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The MetaAttributesBreadcrumb1 component displays data of the time series database containing the COUNTRY attribute.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Attrs: IMetaAttributes;
Attr: IMetaAttribute;
Sel: IDimSelection;
Begin
Attrs := MetaAttributesBreadcrumb1.MetaAttributes;
Attr := Attrs.FindById("COUNTRY");
Sel := MetaAttributesBreadcrumb1.GetAttributeValue(Attr);
Sel.DeselectAll;
Sel.SelectElement(0, False);
Sel.SelectElement(1, False);
Sel.SelectElement(2, False);
MetaAttributesBreadcrumb1.SetAttributeValue(Attr, Sel);
End Sub Button1OnClick;
After executing the example clicking the button changes element selection by the COUNTRY attribute. The first three elements are selected by this attribute.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Rds;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Attrs: IMetaAttributes;
Attr: IMetaAttribute;
Sel: IDimSelection;
Begin
Attrs := MetaAttributesBreadcrumbNet1.MetaAttributes;
Attr := Attrs.FindById("COUNTRY");
Sel := MetaAttributesBreadcrumbNet1.CtrlBox.GetAttributeValue(Attr);
Sel.DeselectAll();
Sel.SelectElement(0, False);
Sel.SelectElement(1, False);
Sel.SelectElement(2, False);
MetaAttributesBreadcrumbNet1.CtrlBox.SetAttributeValue(Attr, Sel);
End Sub;
See also: