Table of Contents

Class AlternateOf

Inheritance
AlternateOf
Implements
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Represents a AlternativeSource object. It is a child of either a Table or a Column object.

public sealed class AlternateOf : TabularObject, ICustomTypeDescriptor, INotifyPropertyChanging, IAnnotationObject, ITabularObject, INotifyPropertyChanged
Extension Methods

Remarks

This metadata object is only supported when the compatibility level of the database is at 1460 or above.

Properties

Annotations

The collection of Annotations on the current Alternate Of.

[Browsable(true)]
public AnnotationCollection Annotations { get; }

Property Value

Type Description
AnnotationCollection

BaseColumn

A reference ID to the referenced source column.

[TypeConverter(typeof(AlternateOfColumnConverter))]
public Column BaseColumn { get; set; }

Property Value

Type Description
Column

BaseTable

A reference ID to the referenced source table. You may either define BaseTable or BaseColumn, but not both.

[TypeConverter(typeof(OtherTableConverter))]
public Table BaseTable { get; set; }

Property Value

Type Description
Table

Column

ID of the owning/parent column.

public Column Column { get; }

Property Value

Type Description
Column

ObjectTypeName

The type name of this object ("Folder", "Measure", "Table", etc.).

public override string ObjectTypeName { get; }

Property Value

Type Description
string

Summarization

A value indicating the summarization type used by this alternative sources' column. The possible values are GroupBy (0), Sum (1), Count (2), Min (3), Max (4).

public SummarizationType Summarization { get; set; }

Property Value

Type Description
SummarizationType

Methods

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

CreateNew(Column)

public static AlternateOf CreateNew(Column parent)

Parameters

Type Name Description
Column parent

Returns

Type Description
AlternateOf

Delete()

Delete the AlternateOf

public void Delete()

GetAnnotation(int)

Gets the value of the annotation with the given index, assuming it exists.

public string GetAnnotation(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetAnnotation(string)

Gets the value of the annotation with the given name. Returns null if no such annotation exists.

public string GetAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetAnnotations()

Gets a collection of all annotation names on the current Alternate Of.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Alternate Of.

public int GetAnnotationsCount()

Returns

Type Description
int

GetNewAnnotationName()

Returns a unique name for a new annotation.

public string GetNewAnnotationName()

Returns

Type Description
string

HasAnnotation(string)

Returns true if an annotation with the given name exists. Otherwise false.

public bool HasAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

OnPropertyChanged(string, object, object)

Fired after a property is changed

protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)

Parameters

Type Name Description
string propertyName
object oldValue
object newValue

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.

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.

RemoveAnnotation(string)

Remove an annotation by the given name.

public void RemoveAnnotation(string name)

Parameters

Type Name Description
string name

SetAnnotation(int, string)

Sets the value of the annotation with the given index, assuming it exists.

public void SetAnnotation(int index, string value)

Parameters

Type Name Description
int index
string value

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.

public void SetAnnotation(string name, string value)

Parameters

Type Name Description
string name
string value