示例#1
0
        private void menuOpen_Click(object sender, EventArgs e)
        {
            ArtFile newFile;

            if (myOpenDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    newFile = ArtFile.Load(myOpenDialog.FileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(String.Format(
                                        "The file '{0}' cannot be loaded.",
                                        myOpenDialog.FileName));
#if DEBUG
                    Debug.WriteLine(ex.ToString());
#endif
                    return;
                }

                RefreshFile(newFile);
            }
        }