Пример #1
0
 // <Snippet1>
 private void RemoveConstraint(ConstraintCollection constraints,
                               Constraint constraint)
 {
     if (constraints.Contains(constraint.ConstraintName))
     {
         if (constraints.CanRemove(constraint))
         {
             constraints.Remove(constraint.ConstraintName);
         }
     }
 }
Пример #2
0
 // <Snippet1>
 private void RemoveConstraint(
     ConstraintCollection constraints, Constraint constraint)
 {
     try
     {
         if (constraints.Contains(constraint.ConstraintName))
         {
             if (constraints.CanRemove(constraint))
             {
                 constraints.RemoveAt(constraints.IndexOf(constraint));
             }
         }
     }
     catch (Exception e)
     {
         // Process exception and return.
         Console.WriteLine("Exception of type {0} occurred.",
                           e.GetType());
     }
 }