Class RelationDescriptor
A RelationDescriptor defines constraints for a relation between two tables and schema information of child tables. RelationDescriptors are managed by the RelationDescriptorCollection which is returned by the Relations property of a TableDescriptor.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Grouping
Assembly: Syncfusion.Grouping.Base.dll
Syntax
public class RelationDescriptor : DescriptorBase, ICustomTypeDescriptor, IDisposable, ICloneable, IStandardValuesProvider
Constructors
RelationDescriptor()
Initializes a new empty relation descriptor.
Declaration
public RelationDescriptor()
RelationDescriptor(String)
Initializes a new relation descriptor with the given name.
Declaration
public RelationDescriptor(string relationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | relationName | Name of the relation. |
Properties
AllowCacheChildList
If RelationKind.UniformChildList was specified, this value indicates whether the ChildList / Related View that is associated with a view can be cached or if it should be requeried each time by calling PropertyDescriptor.GetValue(MappingName). Note that a DataView will always create a new DataRelatedView in such case and therefore it is recommended to allow cache the child list.
Declaration
public bool AllowCacheChildList { get; set; }
Property Value
Type |
---|
System.Boolean |
ChildTableDescriptor
The TableDescriptor that describes the child table.
Declaration
public TableDescriptor ChildTableDescriptor { get; set; }
Property Value
Type |
---|
TableDescriptor |
ChildTableName
The name of the child table.
Declaration
public string ChildTableName { get; set; }
Property Value
Type |
---|
System.String |
Collection
The collection this descriptor belongs to.
Declaration
public RelationDescriptorCollection Collection { get; }
Property Value
Type |
---|
RelationDescriptorCollection |
DisposedId
For internal use.
Declaration
public int DisposedId { get; set; }
Property Value
Type |
---|
System.Int32 |
MappingName
The name of a PropertyDescriptor in the parent table that contains details about this relation. With a DataTable for example, there will be a DataRelation with such a MappingName. The MappingName can also be the name of child-collection when the main table is a strong-typed collection.
Declaration
public string MappingName { get; set; }
Property Value
Type |
---|
System.String |
Name
The name of this relation.
Declaration
public virtual string Name { get; set; }
Property Value
Type |
---|
System.String |
ParentTableDescriptor
The parent TableDescriptor this descriptor belongs to.
Declaration
public TableDescriptor ParentTableDescriptor { get; }
Property Value
Type |
---|
TableDescriptor |
RelationKeys
A collection of RelationKeyDescriptor that defines the mapping between parent and child columns in a master details relation.
Declaration
public RelationKeyDescriptorCollection RelationKeys { get; }
Property Value
Type |
---|
RelationKeyDescriptorCollection |
RelationKind
The type of relation this descriptor defines.
Declaration
public RelationKind RelationKind { get; set; }
Property Value
Type |
---|
RelationKind |
Methods
Clone()
Creates a copy of this descriptor and copies also the child table descriptor.
Declaration
public virtual RelationDescriptor Clone()
Returns
Type | Description |
---|---|
RelationDescriptor | A copy of this descriptor. |
CopyMembersFrom(RelationDescriptor)
Copies all properties from another element without raising Changing or Changed events.
Declaration
protected virtual void CopyMembersFrom(RelationDescriptor other)
Parameters
Type | Name | Description |
---|---|---|
RelationDescriptor | other | The source object. |
CreateChildTableDescriptor()
Called to create the TableDescriptor for the child table.
Declaration
public virtual TableDescriptor CreateChildTableDescriptor()
Returns
Type | Description |
---|---|
TableDescriptor | A new TableDescriptor. |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
EnsureInitialized()
Ensures relation keys are properly initialized after changes to the parent table descriptor.
Declaration
public void EnsureInitialized()
Equals(Object)
Determines if the specified object is equivalent to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if the objects are equivalent; False otherwise. |
Overrides
GetCustomPDC(PropertyDescriptorCollection)
Used to represents the collection of property descriptor
Declaration
protected override PropertyDescriptorCollection GetCustomPDC(PropertyDescriptorCollection baseprops)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.PropertyDescriptorCollection | baseprops | PropertyDescriptorCollection |
Returns
Type | Description |
---|---|
System.ComponentModel.PropertyDescriptorCollection | An instance of the System.ComponentModel.PropertyDescriptorCollection class. |
Overrides
GetHashCode()
Serves as a hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code. |
Overrides
GetName()
Returns descriptor name.
Declaration
public override string GetName()
Returns
Type | Description |
---|---|
System.String | Descriptor name. |
Overrides
GetStandardValues(PropertyDescriptor)
Returns an array of standard values used by StandardValuesCollectionConverter.
Declaration
public ICollection GetStandardValues(PropertyDescriptor propertyDescriptor)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.PropertyDescriptor | propertyDescriptor | The context.PropertyDescriptor of a TypeConverter.GetStandardValues method. |
Returns
Type | Description |
---|---|
System.Collections.ICollection | An array of standard values used by StandardValuesCollectionConverter. |
InitializeFrom(RelationDescriptor)
Initializes this object and copies properties from another object. PropertyChanging and PropertyChanged events are raised for every property that is modified. If both objects are equal, no events are raised.
Declaration
public virtual void InitializeFrom(RelationDescriptor other)
Parameters
Type | Name | Description |
---|---|---|
RelationDescriptor | other | The source object. |
IsChildTableDescriptorCreated()
Determines if an instance for the ChildTableDescriptor has been created.
Declaration
public bool IsChildTableDescriptorCreated()
Returns
Type | Description |
---|---|
System.Boolean | true if TableDescriptor was created, |
OnPropertyChanged(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs that contains the event data. |
OnPropertyChanging(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanging event.
Declaration
protected virtual void OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A System.ComponentModel.PropertyChangedEventArgs that contains the event data. |
Reset()
Resets the relation.
Declaration
public override void Reset()
Overrides
ResetAllowCacheChildList()
Resets the AllowCacheChildList property.
Declaration
public void ResetAllowCacheChildList()
ResetChildTableDescriptor()
Resets the child table descriptor back to its default state.
Declaration
public void ResetChildTableDescriptor()
ResetChildTableName()
Resets the name of the child table.
Declaration
public void ResetChildTableName()
ResetMappingName()
Resets the mapping name.
Declaration
public void ResetMappingName()
ResetName()
Resets the relation name back to default.
Declaration
public void ResetName()
ResetRelationKeys()
Clears RelationKeys.
Declaration
public void ResetRelationKeys()
ResetRelationKind()
Resets the relation kind to RelationDescriptor.
Declaration
public void ResetRelationKind()
ShouldSerializeAllowCacheChildList()
Determines if AllowCacheChildList property was modified.
Declaration
public bool ShouldSerializeAllowCacheChildList()
Returns
Type | Description |
---|---|
System.Boolean | True if the property was modified. |
ShouldSerializeChildTableDescriptor()
Determines if the child table descriptor or any of its inner properties was modified.
Declaration
public bool ShouldSerializeChildTableDescriptor()
Returns
Type | Description |
---|---|
System.Boolean | True if the child table descriptor was modified. |
ShouldSerializeChildTableName()
Determines if a ChildTableName was specified.
Declaration
public bool ShouldSerializeChildTableName()
Returns
Type | Description |
---|---|
System.Boolean | True if the ChilTableName was specified. |
ShouldSerializeName()
Determines if relation name was modified from default.
Declaration
public bool ShouldSerializeName()
Returns
Type | Description |
---|---|
System.Boolean | True if relation name was modified. |
ShouldSerializeRelationKeys()
Determines if RelationKeys have been added.
Declaration
public bool ShouldSerializeRelationKeys()
Returns
Type | Description |
---|---|
System.Boolean | True if the RelationKeys have been added. |
ShouldSerializeRelationKind()
Determines if RelationKind property was modified.
Declaration
public bool ShouldSerializeRelationKind()
Returns
Type | Description |
---|---|
System.Boolean | True if the property was modified. |
ToString()
Returns a string holding the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |
Overrides
Events
PropertyChanged
Occurs when a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
DescriptorPropertyChangedEventHandler |
PropertyChanging
Occurs before a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanging
Event Type
Type |
---|
DescriptorPropertyChangedEventHandler |
Explicit Interface Implementations
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type |
---|
System.Object |