private void button_RemoveAsset_Click(object sender, EventArgs e) { if (MessageBox.Show("Really remove the asset from the project? \r\n This will remove all assets of this type in the scene.", "Remove Asset", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { var nameToRemove = listBox_Assets.SelectedItem.ToString(); StaticEditorMode.RemoveAssetsWithTextureName(nameToRemove); var files = GetXnaFileList(); foreach (var file in files) { if (Path.GetFileNameWithoutExtension(file) == nameToRemove) { try { File.Delete(file); } catch (Exception exception) { Console.WriteLine(exception); throw; } } } Do_Refresh_XNB_Asset_List(); PopulateTree(); } }
private void DeleteActor(TreeNode node) { // StaticEditorMode.RemoveAsset(actor); if (node != null) { ExecuteOnActorAndAllTreeChildren(node, (n, actor) => StaticEditorMode.RemoveAsset(actor)); node.Remove(); } }