Пример #1
0
        private void SaveFiles(bool overwrite = false)
        {
            var newAssetsList = Workspace.NewAssets.Values.ToList();

            if (FromBundle)
            {
                ModifiedFiles      = WriteFilesToMemory(newAssetsList);
                Workspace.Modified = false;
                ClearModified();
            }
            else
            {
                if (overwrite)
                {
                    var choice = MsgBoxUtils.ShowWarningDialog("This action will overwrite the file.\n" +
                                                               "Are you sure you want to continue?");
                    if (choice != DialogResult.Yes)
                    {
                        return;
                    }
                }
                WriteFiles(newAssetsList, overwrite);
                Workspace.Modified = false;
                ClearModified();
            }
        }
Пример #2
0
        private void RemoveAssetItems()
        {
            var choice = MsgBoxUtils.ShowWarningDialog("Are you sure you want to remove the selected asset(s)?\n" +
                                                       "This will break any reference to this/these.");

            if (choice != DialogResult.Yes)
            {
                return;
            }

            foreach (ListViewItem listItem in assetList.SelectedItems)
            {
                var item = Workspace.LoadedAssets[listItem.Index];
                Workspace.AddReplacer(AssetModifier.CreateAssetRemover(item));
                assetList.Items.Remove(listItem);
                Workspace.LoadedAssets.Remove(item);
            }
        }