Exemple #1
0
        public void SendObjectsBackward()
        {
            LevelEntryCollection objs = GetSelectedObjectsInZOrder();

            foreach (LevelEntry obj in objs)
            {
                int index = mLevel.Entries.IndexOf(obj);

                //Top of the list, no change
                if (index == 0)
                {
                    continue;
                }

                //Move up one
                int new_index = index - 1;

                LevelEntry eo = mLevel.Entries[new_index];
                if (objs.Contains(eo))
                {
                    continue;
                }

                mLevel.Entries[index]     = mLevel.Entries[new_index];
                mLevel.Entries[new_index] = obj;
            }

            UpdateRedraw();
        }
Exemple #2
0
        public void CheckSelectionChanged()
        {
            //Checks if the selection has changed, and only invokes change event if different

            //Check if selection count is different
            if (mSelectedEntries.Count != mOldSelectedEntries.Count)
            {
                UpdateOldSelection();
                InvokeSelectionChangedEvent();
                return;
            }

            //Check all elements exist
            foreach (LevelEntry le in mSelectedEntries)
            {
                if (!mOldSelectedEntries.Contains(le))
                {
                    UpdateOldSelection();
                    InvokeSelectionChangedEvent();
                    return;
                }
            }

            //No change
        }
Exemple #3
0
        public LevelEntryCollection GetSelectedObjectsInZOrder()
        {
            LevelEntryCollection objects = new LevelEntryCollection();

            foreach (LevelEntry le in Level.Entries)
            {
                if (!mSelectedEntries.Contains(le))
                {
                    continue;
                }

                objects.Add(le);
            }

            return(objects);
        }