A Sandcastle Documented Class Library

# IMetricSetService AddElement Method

Adds an AnalysisElementUsage element to the given metric set and saves it.

Namespace: Dundas.BI.Entities.MetricSets
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    AnalysisElementUsage AddElement(
    	MetricSet metricSet,
    	Guid parentId,
    	string elementName,
    	PlacementPosition placement,
    	string levelUniqueName
    )

    Function AddElement (
    	metricSet As MetricSet,
    	parentId As Guid,
    	elementName As String,
    	placement As PlacementPosition,
    	levelUniqueName As String
    ) As AnalysisElementUsage

    AnalysisElementUsage^ AddElement(
    	MetricSet^ metricSet,
    	Guid parentId,
    	String^ elementName,
    	PlacementPosition placement,
    	String^ levelUniqueName
    )

    abstract AddElement :
            metricSet : MetricSet *
            parentId : Guid *
            elementName : string *
            placement : PlacementPosition *
            levelUniqueName : string -> AnalysisElementUsage

#### Parameters

metricSet
  Type: Dundas.BI.Entities.MetricSets
  MetricSet
  The MetricSet to add the element to.
parentId
  Type: System
  Guid
  The ID of the element parent structure.
elementName
  Type: System
  String
  The name of the element (column/measure/hierarchy) to add.
placement
  Type: Dundas.BI.Entities.MetricSets
  PlacementPosition
  The element placement position.
levelUniqueName
  Type: System
  String
  The optional unique name for hierarchy level, when the specified element is a hierarchy.

#### Return Value

Type: AnalysisElementUsage
The added usage element.
Exceptions

Exception | Condition
--- | ---
InvalidOperationException | The metric set is not checked out to the caller or the underlying IAnalysisStructure does not support the current operation, either because it is not auto-generated or joining to the structure specified by parentId is not supported.
ArgumentNullException | metricSet is .
ArgumentException | parentId is Empty or elementName is not a valid string or parentId references a structure that could not be found or that is invalid for the current operation or placement is not a PlacementPosition valid value.
NotFoundException | The structure with the specified parentId does not exist.
InvalidSessionException | The caller context is not associated with a valid session.
InvalidDynamicHierarchyOperationException | The operation is not supported for dynamic hierarchies.

See Also

#### Reference

IMetricSetService Interface
Dundas.BI.Entities.MetricSets Namespace