Пример #1
0
        private void EditLevel(object sender, EventArgs e)
        {
            CampaignLevel level = levelList.SelectedItem;

            if (!Equals(level, null))
            {
                int index = levelList.SelectedRow;

                level = new LevelPropertiesWindow(editor, level).ShowModal();

                if (!Equals(level, null))
                {
                    collection[index] = level;
                    OnModified?.Invoke(this, EventArgs.Empty);

                    levelList.SuspendLayout();

                    levelList.UpdateBindings();
                    levelList.Invalidate();

                    levelList.SelectedRow = index;

                    levelList.ResumeLayout();
                }
            }
        }
Пример #2
0
        private void AddLevel(object sender, EventArgs e)
        {
            CampaignLevel level = new LevelPropertiesWindow(editor, null).ShowModal();

            if (!Equals(level, null))
            {
                collection.Add(level);
                OnModified?.Invoke(this, EventArgs.Empty);
            }
        }