private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { TreeView treeView = GetTreeView(treeViewTabControl.SelectedIndex); TreeNode selectedNode = treeView.SelectedNode; string filePath = selectedNode.Tag != null?selectedNode.Tag.ToString() : null; if (filePath == null) { MessageBox.Show("Invalid effect file!"); return; } FileData selectedFileData = GetFileDataFromPath(filePath); char separator = '\\'; if (!selectedNode.FullPath.Contains('\\')) { // For cubemitters the paths were being retrieved as filepaths, not nodepaths // so do this to retrieve the source mod name correctly separator = '/'; } string sourceModName = selectedNode.FullPath.Split(separator)[0]; CloneEffectFileCallback callback = new CloneEffectFileCallback(this, selectedFileData); CloneDialog dialog = new CloneDialog(selectedFileData.FileName, selectedFileData.GetNameForCloning(), sourceModName); dialog.SetCallback(callback); dialog.ShowDialog(); }
private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { TreeView treeView = GetTreeView(treeViewTabControl.SelectedIndex); TreeNode selectedNode = treeView.SelectedNode; string filePath = selectedNode.Tag != null ? selectedNode.Tag.ToString() : null; if (filePath == null) { MessageBox.Show("Invalid effect file!"); return; } FileData selectedFileData = GetFileDataFromPath(filePath); CloneEffectFileCallback callback = new CloneEffectFileCallback(this, selectedFileData); CloneDialog dialog = new CloneDialog(selectedFileData.FileName, selectedFileData.GetNameForCloning()); dialog.SetCallback(callback); dialog.ShowDialog(); }