public AboutForm() { InitializeComponent(); this.Text = "About " + Project.PROGRAM_NAME_HUMAN; versionLabel.Text = Project.PROGRAM_NAME_HUMAN + " version " + Project.PROGRAM_VERSION_HUMAN + " build " + Project.PROGRAM_VERSION_RELEASEDATE; licenseLabel.Text = "Open Source - no known origin"; Project.setDlgIcon(this); // try loading logo file: string logoFileName = Project.GetMiscPath("about.jpg"); try { if (!File.Exists(logoFileName)) { // load the file remotely, don't hold diagnostics if load fails: string url = Project.MISC_FOLDER_URL + "/about.jpg"; DloadProgressForm loaderForm = new DloadProgressForm(url, logoFileName, false, true); loaderForm.ShowDialog(); } logoPictureBox.Image = new Bitmap(logoFileName); } catch {} }
public AboutForm() { InitializeComponent(); this.Text = "About " + Project.PROGRAM_NAME_HUMAN; versionLabel.Text = Project.PROGRAM_NAME_HUMAN + " version " + Project.PROGRAM_VERSION_HUMAN + " build " + Project.PROGRAM_VERSION_RELEASEDATE; this.gpsbabelLinkLabel.Text = Project.GPSBABEL_URL; creditsLabel.Text = "Included here is GPSBabel - a program by Robert Lipe\n\nPlease visit www.gpsbabel.org for more info."; Project.setDlgIcon(this); // try loading logo file: string logoFileName = Project.GetMiscPath("about.jpg"); try { if (!File.Exists(logoFileName)) { // load the file remotely, don't hold diagnostics if load fails: string url = Project.MISC_FOLDER_URL + "/about.jpg"; DloadProgressForm loaderForm = new DloadProgressForm(url, logoFileName, false, true); loaderForm.ShowDialog(); } logoPictureBox.Image = new Bitmap(logoFileName); } catch {} }
public DlgEula() { InitializeComponent(); TextReader reader = null; string fileName = "LicenseBSD.txt"; string filePath = Project.GetMiscPath(fileName); try { if (File.Exists(filePath) && File.GetLastWriteTime(filePath).AddDays(Project.LICENSE_FILE_MAX_AGE_DAYS).CompareTo(DateTime.Now) > 0) { reader = new StreamReader(filePath); } else { // load the file remotely, don't hold diagnostics if load fails: string url = Project.MISC_FOLDER_URL + "/" + fileName; DloadProgressForm loaderForm = new DloadProgressForm(url, filePath, false, true); loaderForm.ShowDialog(); reader = new StreamReader(filePath); } } catch {} if (reader == null) { reader = new StringReader(eulaText); // in case everything else fails } string strEula; while ((strEula = reader.ReadLine()) != null) { eulaListBox.Items.Add(strEula); } Project.setDlgIcon(this); }
private static Hashtable tried = new Hashtable(); // if already tried to load bitmap by name, bool //private static Hashtable bitmaps = new Hashtable(); // bitmap by name public static Bitmap getVehicleImage(string sym) { if (sym == null || sym.Length == 0 || "none".Equals(sym)) { return(null); } Bitmap ret = (Bitmap)bitmaps[sym]; if (ret != null) { return(ret); } try { string filePath = Project.GetVehPath(sym + ".gif"); if (!File.Exists(filePath) && (tried[sym] == null || !(bool)tried[sym])) { tried[sym] = true; // load the file remotely, don't hold diagnostics if load fails: string url = Project.MISC_FOLDER_URL + "/vehicles/" + sym + ".gif"; DloadProgressForm loaderForm = new DloadProgressForm(url, filePath, false, true); loaderForm.ShowDialog(); } if (File.Exists(filePath)) { ret = new Bitmap(filePath); bitmaps[sym] = ret; } } catch { return(null); } return(ret); }