Class Level
Represents a level in a hierarchy that provides a logical hierarchical drilldown path for client applications. It is a child of a Hierarchy object. The level is based on the values in a column.
Assembly: TOMWrapper.dll
Syntax
public sealed class Level : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IDescriptionObject, ILineageTagObject, IExtendedPropertyObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IClonableObject, ITabularTableObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Properties
Annotations
The collection of Annotations on the current Level.
Declaration
[Browsable(true)]
public AnnotationCollection Annotations { get; }
Property Value
Column
A reference to a Column object associated with this Level.
Declaration
[TypeConverter(typeof(HierarchyColumnConverter))]
public Column Column { get; set; }
Property Value
Description
The description of the level, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.
Declaration
public string Description { get; set; }
Property Value
ExtendedProperties
The collection of Extended Properties on the current Level.
Declaration
public ExtendedPropertyCollection ExtendedProperties { get; }
Property Value
Hierarchy
A reference to a Hierarchy object that owns this level.
Declaration
[Browsable(false)]
public Hierarchy Hierarchy { get; }
Property Value
LineageTag
A tag that represents the lineage of the object.
Declaration
public string LineageTag { get; set; }
Property Value
Ordinal
The position of the level within the hierarchy. The levels in the hierarchy must be properly ordered, starting with 1 and increasing monotonically.
Declaration
public int Ordinal { get; set; }
Property Value
Parent
The parent Hierarchy of the current Level.
Declaration
public Hierarchy Parent { get; }
Property Value
SourceLineageTag
A tag that represents the lineage of the source for the object.
Declaration
public string SourceLineageTag { get; set; }
Property Value
Synonyms
Collection of localized synonyms for this Level.
Declaration
[Browsable(true)]
public SynonymIndexer Synonyms { get; }
Property Value
Table
Declaration
[Browsable(false)]
public Table Table { get; }
Property Value
TranslatedDescriptions
Collection of localized descriptions for this Level.
Declaration
[Browsable(true)]
public TranslationIndexer TranslatedDescriptions { get; }
Property Value
TranslatedNames
Collection of localized names for this Level.
Declaration
[Browsable(true)]
public TranslationIndexer TranslatedNames { get; }
Property Value
Methods
ClearAnnotations()
Removes all annotations from this object.
Declaration
public void ClearAnnotations()
ClearExtendedProperties()
Removes all Extended Properties from this object.
Declaration
public void ClearExtendedProperties()
Clone(string, bool, Hierarchy)
Creates an exact copy of this Level object.
Declaration
public Level Clone(string newName = null, bool includeTranslations = true, Hierarchy newParent = null)
Parameters
Returns
CreateNew(Hierarchy, string)
Creates a new Level and adds it to the parent Hierarchy.
Also creates the underlying metadataobject and adds it to the TOM tree.
Declaration
public static Level CreateNew(Hierarchy parent, string name = null)
Parameters
Returns
GetAnnotation(int)
Gets the value of the annotation with the given index, assuming it exists.
Declaration
public string GetAnnotation(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetAnnotation(string)
Gets the value of the annotation with the given name. Returns null if no such annotation exists.
Declaration
public string GetAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetAnnotations()
Gets a collection of all annotation names on the current Level.
Declaration
public IEnumerable<string> GetAnnotations()
Returns
GetAnnotationsCount()
Gets the number of annotations on the current Level.
Declaration
public int GetAnnotationsCount()
Returns
GetExtendedProperties()
Gets a collection of all ExtendedProperty names on the current object.
Declaration
public IEnumerable<string> GetExtendedProperties()
Returns
GetExtendedProperty(int)
Gets the value of the ExtendedProperty with the given index, assuming it exists.
Declaration
public string GetExtendedProperty(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetExtendedProperty(string)
Gets the value of the ExtendedProperty with the given name. Returns null if no such ExtendedProperty exists.
Declaration
public string GetExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetExtendedPropertyCount()
Gets the number of ExtendedProperties on the current object.
Declaration
public int GetExtendedPropertyCount()
Returns
GetExtendedPropertyType(int)
Gets the type of the ExtendedProperty with the given index, assuming it exists.
Declaration
public ExtendedPropertyType GetExtendedPropertyType(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetExtendedPropertyType(string)
Gets the type of the ExtendedProperty with the given name, assuming it exists.
Declaration
public ExtendedPropertyType GetExtendedPropertyType(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetNewAnnotationName()
Returns a unique name for a new annotation.
Declaration
public string GetNewAnnotationName()
Returns
GetNewExtendedPropertyName()
Returns a unique name for a new ExtendedProperty.
Declaration
public string GetNewExtendedPropertyName()
Returns
HasAnnotation(string)
Returns true if an annotation with the given name exists. Otherwise false.
Declaration
public bool HasAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasExtendedProperty(string)
Returns true if an ExtendedProperty with the given name exists. Otherwise false.
Declaration
public bool HasExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
OnPropertyChanged(string, object, object)
Fired after a property is changed
Declaration
protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)
Parameters
Overrides
OnPropertyChanging(string, object, ref bool, ref bool)
Called before a property is changed on an object. Derived classes can control how the change is handled.
Throw ArgumentException within this method, to display an error message in the UI.
Declaration
protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)
Parameters
Type |
Name |
Description |
string |
propertyName |
Name of the changed property.
|
object |
newValue |
New value assigned to the property.
|
bool |
undoable |
Return false if automatic undo of the property change is not needed.
|
bool |
cancel |
Return true if the property change should not apply.
|
Overrides
RemoveAnnotation(string)
Remove an annotation by the given name.
Declaration
public void RemoveAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
RemoveExtendedProperty(string)
Remove an ExtendedProperty by the given name.
Declaration
public void RemoveExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
SetAnnotation(int, string)
Sets the value of the annotation with the given index, assuming it exists.
Declaration
public void SetAnnotation(int index, string value)
Parameters
SetAnnotation(string, string)
Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.
Declaration
public void SetAnnotation(string name, string value)
Parameters
SetExtendedProperty(int, string, ExtendedPropertyType)
Sets the value of the ExtendedProperty with the given index, optionally specifiying the type (string or JSON) of the ExtendedProperty.
Declaration
public void SetExtendedProperty(int index, string value, ExtendedPropertyType type)
Parameters
SetExtendedProperty(string, string, ExtendedPropertyType)
Sets the value of the ExtendedProperty having the given name. If no such ExtendedProperty exists, it will be created. If value is set to null, the ExtendedProperty will be removed.
Declaration
public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)
Parameters
Implements
Extension Methods