Add(Value: IMetaAttributeParamItem);
Add(Value: Prognoz.Platform.Interop.ExtCtrls.MetaAttributeParamItem);
Value. Parameter to be added to the collection.
The Add method adds the specified parameter to the collection.
Executing the example requires a form with the Button1 button and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The MetaAttributesBreadcrumb1 component is linked to a time series database.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Setting: IMetaAttributeSetting;
AttrParam: IMetaAttributeParamItem;
Begin
Setting := MetaAttributesBreadcrumb1.MetaAttributeSettings.FindById("DL");
//Set up parameter
AttrParam := New MetaAttributeParamItem.Create;
AttrParam.Id := "Param1";
AttrParam.Key := 1;
AttrParam.Name := "Period 1";
AttrParam.Tag := "Day;Week";
AttrParam.Visible := True;
//Add parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Set up parameter
AttrParam := New MetaAttributeParamItem.Create;
AttrParam.Id := "Param2";
AttrParam.Key := 2;
AttrParam.Name := "Period 2";
AttrParam.Tag := "Month;Year";
AttrParam.Visible := True;
//Add parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Set the first parameter as attribute value
Setting.SelectedParam := Setting.MetaParamItemsCollection.FindById("Param1");
End Sub Button1OnClick;
Clicking 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 component 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");
//Set parameter
AttrParam := New MetaAttributeParamItemClass();
AttrParam.Id := "Param1";
AttrParam.Key := 1;
AttrParam.Name := "Period 1";
AttrParam.Tag := "Day;Week";
AttrParam.Visible := True;
//Add parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Set up parameter
AttrParam := New MetaAttributeParamItemClass();
AttrParam.Id := "Param2";
AttrParam.Key := 2;
AttrParam.Name := "Period 2";
AttrParam.Tag := "Month;Year";
AttrParam.Visible := True;
//Add parameter to collection
Setting.MetaParamItemsCollection.Add(AttrParam);
//Set the first parameter as attribute value
Setting.SelectedParam := Setting.MetaParamItemsCollection.FindById("Param1");
End Sub;
Clicking the button creates two parameters for the Period attribute. The first parameter is set as attribute value.
See also: