Class AlternateOf
Represents a AlternativeSource object. It is a child of either a Table or a Column object.
Implements
Inherited Members
Namespace: TabularEditor.TOMWrapper
Assembly: TOMWrapper.dll
Syntax
public sealed class AlternateOf : TabularObject, ICustomTypeDescriptor, INotifyPropertyChanging, IAnnotationObject, ITabularObject, INotifyPropertyChanged
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.
Declaration
[Browsable(true)]
public AnnotationCollection Annotations { get; }
Property Value
Type | Description |
---|---|
AnnotationCollection |
BaseColumn
A reference ID to the referenced source column.
Declaration
[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.
Declaration
[TypeConverter(typeof(OtherTableConverter))]
public Table BaseTable { get; set; }
Property Value
Type | Description |
---|---|
Table |
Column
ID of the owning/parent column.
Declaration
public Column Column { get; }
Property Value
Type | Description |
---|---|
Column |
ObjectTypeName
The type name of this object ("Folder", "Measure", "Table", etc.).
Declaration
public override string ObjectTypeName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
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).
Declaration
public SummarizationType Summarization { get; set; }
Property Value
Type | Description |
---|---|
SummarizationType |
Methods
ClearAnnotations()
Removes all annotations from this object.
Declaration
public void ClearAnnotations()
CreateNew(Column)
Declaration
public static AlternateOf CreateNew(Column parent)
Parameters
Type | Name | Description |
---|---|---|
Column | parent |
Returns
Type | Description |
---|---|
AlternateOf |
Delete()
Delete the AlternateOf
Declaration
public void Delete()
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
Type | Description |
---|---|
string |
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
Type | Description |
---|---|
string |
GetAnnotations()
Gets a collection of all annotation names on the current Alternate Of.
Declaration
public IEnumerable<string> GetAnnotations()
Returns
Type | Description |
---|---|
IEnumerable<string> |
GetAnnotationsCount()
Gets the number of annotations on the current Alternate Of.
Declaration
public int GetAnnotationsCount()
Returns
Type | Description |
---|---|
int |
GetNewAnnotationName()
Returns a unique name for a new annotation.
Declaration
public string GetNewAnnotationName()
Returns
Type | Description |
---|---|
string |
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
Type | Description |
---|---|
bool |
OnPropertyChanged(string, object, object)
Fired after a property is changed
Declaration
protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | |
object | oldValue | |
object | newValue |
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 |
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
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.
Declaration
public void SetAnnotation(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
string | value |