/// <summary> /// Adds a new part to the group. This group will care about drawing and updating of the part. /// </summary> /// <param name="member">The new part for the group.</param> public void AddMember(PixelMapObject member) { AddNestedObject(member, 3); AddFocusableButton(member); _members.Add(member); member.ChangeParent(this); member.OnFocused += MemberOnOnFocus; member.OnUnFocused += MemberOnOnUnFocus; member.OnDragging += OnMemberDragging; }
public void RemoveMember(PixelMapObject member) { RemoveNestedObject(member); RemoveFocusableButton(member); _members.Remove(member); member.RemoveParent(); member.OnFocused -= MemberOnOnFocus; member.OnUnFocused -= MemberOnOnUnFocus; member.OnDragging -= OnMemberDragging; }
private void FocusChanged(PixelMapObject obj) { RemoveMember(obj); OnMemberChangedFocus?.Invoke(obj); }