/// <summary> /// Удаление таблицы из групп /// </summary> public void RemoveFromGroups(object parameter = null) { System.Collections.ICollection icol = parameter as System.Collections.ICollection; List <AbsM.GroupM> selGroups = new List <AbsM.GroupM>(icol.OfType <AbsM.GroupM>()); foreach (AbsM.GroupM item in selGroups) { if (!_groupsOut.Contains(item)) { _groupsOut.Add(item); _groupsIn.Remove(item); } } }
public void Align(System.Collections.ICollection currentSelection) { IEnumerable <ComponentShape> shapes = currentSelection.OfType <ComponentShape>(); if (shapes.Count() > 1) { // The shapes must all overlap either horizontally or vertically. // Find a horizontal line that is covered by all the shapes: double Y = HorizontalAlignCenter(shapes); if (Y > 0.0) // Negative if they don't overlap. { // Adjust all the shape positions in one transaction: using (Transaction t = this.Store.TransactionManager.BeginTransaction("align")) { foreach (ComponentShape shape in shapes) { shape.AlignYCenter(Y); } t.Commit(); } } else { // Find a vertical line that is covered by all the shapes: double X = VerticalAlignCenter(shapes); if (X > 0.0) // Negative if they don't overlap. { // Adjust all the shape positions in one transaction: using (Transaction t = this.Store.TransactionManager.BeginTransaction("align")) { foreach (ComponentShape shape in shapes) { shape.AlignXCenter(X); } t.Commit(); } } } } }