예제 #1
0
파일: Share.cs 프로젝트: HJfod/gdtools
            private void ExportLevel()
            {
                FolderBrowserDialog fbd = new FolderBrowserDialog();
                DialogResult        dr  = fbd.ShowDialog();

                if (dr == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    string failure = "";
                    string success = "";
                    foreach (Elem.Select.SelectItem i in ExportSelect.SelectedItems)
                    {
                        string ExportTry = GDTools.ExportLevel(i.Text, fbd.SelectedPath, ExportCompressed.Checked);
                        if (ExportTry != null)
                        {
                            failure += ExportTry;
                        }
                        else
                        {
                            success += $"{i.Text}, ";
                        }
                    }
                    MessageBox.Show($"Succesfully exported {(success.Length > 0 ? success.Substring(0,success.Length-2) : "")}{(failure.Length > 0 ? $"; Failed: {failure}" : "")}");
                }
                else if (dr != DialogResult.Cancel)
                {
                    MessageBox.Show("Selected path not accepted.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }