Exemplo n.º 1
0
        private void mLevelEditor_SelectionChanged(object sender, EventArgs e)
        {
            UpdateToolWindows();

            if (mLevelEditor.SelectedEntries.Count == 0)
            {
                mParent.SetStatus(String.Empty);
            }
            else if (mLevelEditor.SelectedEntries.Count == 1)
            {
                LevelEntry selentry = mLevelEditor.SelectedEntries[0];
                mParent.SetStatus("Entry: {0} ({1})", selentry.GetEntryIndex(), selentry.ToString());
            }
            else
            {
                mParent.SetStatus("{0} / {1} pegs selected", mLevelEditor.SelectedEntries.Count, mLevelEditor.Level.Entries.Count);
            }
        }
Exemplo n.º 2
0
        private void UpdateList()
        {
            mSuspendChangeEvent = true;

            int topIndex = mList.TopIndex;

            mList.BeginUpdate();
            mList.Items.Clear();
            List <string> items = new List <string>();

            for (int i = 0; i < mEditor.Level.Entries.Count; i++)
            {
                LevelEntry le = mEditor.Level.Entries[i];
                items.Add(String.Format("{0}. {1}", i, le.ToString()));
            }

            mList.Items.AddRange(items.ToArray());

            foreach (LevelEntry le in mEditor.SelectedEntries)
            {
                int index = mEditor.Level.Entries.IndexOf(le);
                mList.SelectedIndices.Add(index);
            }

            mList.EndUpdate();

            mEntries.Clear();
            mSelectedEntries.Clear();

            mEntries.AddRange(mEditor.Level.Entries);
            mSelectedEntries.AddRange(mEditor.SelectedEntries);

            mList.TopIndex = Math.Min(topIndex, mEntries.Count);

            mSuspendChangeEvent = false;
        }