コード例 #1
0
        /// <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;
        }
コード例 #2
0
        public void RemoveMember(PixelMapObject member)
        {
            RemoveNestedObject(member);
            RemoveFocusableButton(member);
            _members.Remove(member);

            member.RemoveParent();

            member.OnFocused   -= MemberOnOnFocus;
            member.OnUnFocused -= MemberOnOnUnFocus;
            member.OnDragging  -= OnMemberDragging;
        }
コード例 #3
0
        private void FocusChanged(PixelMapObject obj)
        {
            RemoveMember(obj);

            OnMemberChangedFocus?.Invoke(obj);
        }