private void buttonSelectPackage_Click(object sender, EventArgs e)
{
if (openPackageFileDialog.ShowDialog() == DialogResult.OK)
{
currentPackage = Manipulation.ReadPackage(openPackageFileDialog.FileName);
if (currentPackage != null)
{
buttonNext.Enabled = true;
textBoxPackageName.Text = currentPackage.Name;
textBoxPackageAuthor.Text = currentPackage.Author;
if (currentPackage.Description != null)
{
textBoxPackageDescription.Text = currentPackage.Description.Replace("\\r\\n", "\r\n");
}
textBoxPackageVersion.Text = currentPackage.PackageVersion.ToString();
if (currentPackage.Website != null)
{
linkLabelPackageWebsite.Links.Clear();
linkLabelPackageWebsite.Text = currentPackage.Website;
LinkLabel.Link link = new LinkLabel.Link {LinkData = currentPackage.Website};
linkLabelPackageWebsite.Links.Add(link);
}
else
{
linkLabelPackageWebsite.Text = Interface.GetInterfaceString("packages_selection_none_website");
}
if (currentPackage.PackageImage != null)
{
pictureBoxPackageImage.Image = currentPackage.PackageImage;
}
else
{
TryLoadImage(pictureBoxPackageImage, currentPackage.PackageType == 0 ? "route_unknown.png" : "train_unknown.png");
}
}
else
{
//ReadPackage returns null if the file is not a package.....
MessageBox.Show(Interface.GetInterfaceString("packages_install_invalid"));
}
}
}