Add(Value: IMetaAttributeParamItem);
Add(Value: Prognoz.Platform.Interop.ExtCtrls.MetaAttributeParamItem);
Value. Parameter to be added to the collection.
The Add method adds selected parameter to the collection.
Executing the example requires a form with the Button1 button and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The MetaAttributesBreadcrumb1 is linked to a time series database.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Setting: IMetaAttributeSetting;
AttrParam: IMetaAttributeParamItem;
Begin
Setting := MetaAttributesBreadcrumb1.MetaAttributeSettings.FindById("DL");
//Setting of the parameter
AttrParam := New MetaAttributeParamItem.Create;
AttrParam.Id := "Param1";
AttrParam.Key := 1;
AttrParam.Name := "Period 1";
AttrParam.Tag := "Day;Week";
AttrParam.Visible := True;
//Addition of parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Setting of the parameter
AttrParam := New MetaAttributeParamItem.Create;
AttrParam.Id := "Param2";
AttrParam.Key := 2;
AttrParam.Name := "Period Two";
AttrParam.Tag := "Month;Year";
AttrParam.Visible := True;
//Addition of parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Setting the first parameter as value of attribute
Setting.SelectedParam := Setting.MetaParamItemsCollection.FindById("Param1");
End Sub Button1OnClick;
Clicking on the button creates two parameters for the Period attribute. The first parameter is set as attribute value.
Executing the example requires a .NET form with the Button1 button and the MetaAttributesBreadcrumbNet component named MetaAttributesBreadcrumbNet1. The MetaAttributesBreadcrumbNet1 is linked to a time series database.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Setting: IMetaAttributeSetting;
AttrParam: MetaAttributeParamItem;
Begin
Setting := MetaAttributesBreadcrumbNet1.CtrlBox.MetaAttributeSettings.FindById("DL");
//Setting of the parameter
AttrParam := New MetaAttributeParamItemClass();
AttrParam.Id := "Param1";
AttrParam.Key := 1;
AttrParam.Name := "Period 1";
AttrParam.Tag := "Day;Week";
AttrParam.Visible := True;
//Addition of parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Setting of the parameter
AttrParam := New MetaAttributeParamItemClass();
AttrParam.Id := "Param2";
AttrParam.Key := 2;
AttrParam.Name := "Period Two";
AttrParam.Tag := "Month;Year";
AttrParam.Visible := True;
//Addition of parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Setting the first parameter as value of attribute
Setting.SelectedParam := Setting.MetaParamItemsCollection.FindById("Param1");
End Sub;
Clicking on the button creates two parameters for Period attribute. The first parameter is set as attribute value.
See also: