/// <summary> /// Fixes features in dependent clauses in preparation for deleting a row. /// Caller guarantees that the Clause Marker pointed to more than one row, since Markers /// go away automatically when their 'last' row is deleted. /// </summary> /// <param name="marker"></param> /// <param name="e">RemoveObjectEventArgs</param> private static void FixAffectedClauseMarker(IConstChartClauseMarker marker, RemoveObjectEventArgs e) { // Enhance GordonM: This is another place that will need to change in the unlikely event that // dependent clauses can someday be non-contiguous. var arrayMax = marker.DependentClausesRS.Count - 1; // the new array limit var idelRow = e.Index; // Of the 2 following conditionals, only one should match, if any. // If the deleted reference was the first in the property, // move the firstDep feature to the next row in the list. if (idelRow == 0) { marker.DependentClausesRS[0].StartDependentClauseGroup = true; } // If delRow was the last reference in the property, // move the endDep feature to the previous row in the list. if (idelRow > arrayMax) { marker.DependentClausesRS[arrayMax].EndDependentClauseGroup = true; } }
/// <summary> /// Fixes features in dependent clauses in preparation for deleting a row. /// Caller guarantees that the Clause Marker pointed to more than one row, since Markers /// go away automatically when their 'last' row is deleted. /// </summary> /// <param name="marker"></param> /// <param name="e">RemoveObjectEventArgs</param> private static void FixAffectedClauseMarker(IConstChartClauseMarker marker, RemoveObjectEventArgs e) { // Enhance GordonM: This is another place that will need to change in the unlikely event that // dependent clauses can someday be non-contiguous. var arrayMax = marker.DependentClausesRS.Count - 1; // the new array limit var idelRow = e.Index; // Of the 2 following conditionals, only one should match, if any. // If the deleted reference was the first in the property, // move the firstDep feature to the next row in the list. if (idelRow == 0) marker.DependentClausesRS[0].StartDependentClauseGroup = true; // If delRow was the last reference in the property, // move the endDep feature to the previous row in the list. if (idelRow > arrayMax) marker.DependentClausesRS[arrayMax].EndDependentClauseGroup = true; }