// The constraint MUST exist in the collection // Could be called if the constraint was previously removed. // Return 'true' if the constraint was actually removed and disposed. public bool RemoveAndDestroyConstraint(BSConstraint constrain) { bool removed = false; lock (m_constraints) { // remove the constraint from our collection removed = m_constraints.Remove(constrain); } // Dispose() is safe to call multiple times constrain.Dispose(); return(removed); }
// The constraint MUST exist in the collection // Could be called if the constraint was previously removed. // Return 'true' if the constraint was actually removed and disposed. public bool RemoveAndDestroyConstraint(BSConstraint constrain) { bool removed = false; lock (m_constraints) { // remove the constraint from our collection removed = m_constraints.Remove(constrain); } // Dispose() is safe to call multiple times constrain.Dispose(); return removed; }