コード例 #1
0
        private void cmbFilenames_SelectedIndexChanged(object sender, EventArgs e)
        {
            string filename = imageLookup[cmbFilenames.SelectedIndex];

            image = SpriteTools.LoadFirstImageFromFile(filename);
            PostImageLoad();
        }
コード例 #2
0
        private void cmbFilenames_SelectedIndexChanged(object sender, EventArgs e)
        {
            string filename = imageLookup[cmbFilenames.SelectedIndex];

            try
            {
                image = SpriteTools.LoadFirstImageFromFile(filename);
            }
            catch (Types.InvalidDataException ex)
            {
                // use a placeholder in-case of bad data
                Factory.GUIController.ShowMessage(ex.Message, MessageBoxIconType.Error);
                image = SpriteTools.GetPlaceHolder();
            }

            PostImageLoad();
        }