void DependentValueChanged(object sender, ValueChangedEventArgs e) { if (!DependentColumns.Contains(e.Column)) { return; } foreach (var row in GetAffectedRows(e.Row, (Table)sender)) { OnRowInvalidated(row); } }
/// <summary> /// Gets an operation to create an index on the foreign key column(s). /// </summary> /// <returns> An operation to add the index. </returns> public virtual CreateIndexOperation CreateCreateIndexOperation() { var createIndexOperation = new CreateIndexOperation { Table = DependentTable }; DependentColumns.Each(c => createIndexOperation.Columns.Add(c)); return(createIndexOperation); }
/// <summary> /// Gets an operation to drop the associated index on the foreign key column(s). /// </summary> /// <returns> An operation to drop the index. </returns> public virtual DropIndexOperation CreateDropIndexOperation() { var dropIndexOperation = new DropIndexOperation(_inverse.CreateCreateIndexOperation()) { Table = DependentTable }; DependentColumns.Each(c => dropIndexOperation.Columns.Add(c)); return(dropIndexOperation); }
///<summary>Unregisters event handlers registered in Register.</summary> public override void Unregister(Table table) { var rc = GetRowCollection(table); rc.RowAdded -= DependentRowAdded; rc.RowRemoved -= DependentRowRemoved; if (DependentColumns.Any()) { rc.ValueChanged -= DependentValueChanged; } foreach (var child in NestedDependencies) { child.Unregister(table); } }
private void SetMultiplicities() { _assocationType.SourceEnd.RelationshipMultiplicity = RelationshipMultiplicity.ZeroOrOne; _assocationType.TargetEnd.RelationshipMultiplicity = RelationshipMultiplicity.Many; var dependentTable = _assocationType.TargetEnd.GetEntityType(); if (dependentTable.DeclaredKeyProperties.Count() == DependentColumns.Count() && dependentTable.DeclaredKeyProperties.All(DependentColumns.Contains)) { _assocationType.SourceEnd.RelationshipMultiplicity = RelationshipMultiplicity.One; _assocationType.TargetEnd.RelationshipMultiplicity = RelationshipMultiplicity.ZeroOrOne; } else if (!DependentColumns.Any(p => p.Nullable)) { _assocationType.SourceEnd.RelationshipMultiplicity = RelationshipMultiplicity.One; } }