/// <summary> /// Deletes the group and all its children from the diagram. /// </summary> /// <param name="group">A group instnace.</param> public void RemoveGroup(GroupModel group) { if (!_groups.Remove(group)) { return; } Batch(() => { Nodes.Remove(group.Children.ToArray()); Links.Remove(group.AllLinks.ToArray()); group.Ungroup(); GroupRemoved?.Invoke(group); }); }
public void Ungroup(Group group) { if (!_groups.Remove(group)) { return; } foreach (var node in group.Nodes) { node.Group = null; node.Refresh(); } group.Clear(); GroupRemoved?.Invoke(group); }
public void Ungroup(GroupModel group) { if (!_groups.Remove(group)) { return; } group.Ungroup(); foreach (var node in group.Children) { _nodes.Add(node); } GroupRemoved?.Invoke(group); Refresh(); }
/// <summary> /// Clear all items. /// </summary> public void clear() { foreach (ButtonGridGroup group in groups) { //Alert that the items are removed if (ItemRemoved != null) { foreach (ButtonGridItem item in group.Items) { ItemRemoved.Invoke(this, item); } } if (GroupRemoved != null) { GroupRemoved.Invoke(this, group.Name); } group.Dispose(); } selectionStrategy.itemsCleared(); groups.Clear(); itemCount = 0; layout(); }
public void Ungroup(GroupModel group) { if (!_groups.Remove(group)) { return; } group.Ungroup(); foreach (var child in group.Children) { if (child is GroupModel g) { _groups.Add(g); } else { _nodes.Add(child); } } GroupRemoved?.Invoke(group); Refresh(); }
public void removeMovementSequence(String groupName, MovementSequenceInfo info) { MovementSequenceGroup group = currentSequenceSet.getGroup(groupName); if (group != null) { if (info != null) { if (SequenceRemoved != null) { SequenceRemoved.Invoke(this, group, info); } group.removeSequence(info); if (group.Count == 0) { currentSequenceSet.removeGroup(group); if (GroupRemoved != null) { GroupRemoved.Invoke(this, group); } } } } }
public void Delete(Property property) { if (property.Name == null) { properties.Clear(); groups.Clear(); } else { Property cachedProperty = properties.FirstOrDefault(x => x.Name == property.Name); if (cachedProperty != null) { properties.Remove(cachedProperty); PropertyRemoved?.Invoke(cachedProperty); Group group = GetOrAddGroup(cachedProperty.GroupName); group.Delete(property); if (group.Properties.Count == 0) { groups.Remove(group.Name); GroupRemoved?.Invoke(group); } } } }