Пример #1
0
        private void ContextMenu_Delete_Click(object sender, EventArgs e)
        {
            var elements = GetSelectedElements().ToList();


            if (elements.Count > 1)
            {
                //TODO: show confirmation message when deleting more than one
            }

            ProjectManager.ClearSelection();

            ProjectManager.StartBatchChanges();

            var removedElements = elements.Where(x => x.TryRemove()).ToList();

            if (removedElements.OfType <ModelMeshReference>().Any())
            {
                CurrentProject.RemoveUnreferencedMeshes();
            }

            ProjectManager.EndBatchChanges();
        }