Example #1
0
        private void AstroBodies_SelectedIndexChanged(object sender, EventArgs e)
        {
            CurrentBody = (MAstroBody)AstroBodies.SelectedItem;
            //string sPath =
            string sPath = CurrentBody.TextureName;

            if (MassiveTools.IsURL(sPath))
            {
                string cache = MassiveTools.GetCachePath(sPath);
                if (!File.Exists(cache))
                {
                    return;
                }
                bmp = Image.FromFile(cache);
                MapBox.BackgroundImage = bmp;
            }
            else
            {
                bmp = Image.FromFile(Path.Combine(MFileSystem.AssetsPath, CurrentBody.TextureName));
                MapBox.BackgroundImage = bmp;
            }
        }