示例#1
0
        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 {}
        }
示例#2
0
        public DlgEula()
        {
            InitializeComponent();

            TextReader reader = null;

            string fileName = "LicenseBSD.txt";

            string filePath = Project.GetMiscPath(fileName);

            try
            {
                if (File.Exists(fileName) &&
                    File.GetLastWriteTime(fileName).AddDays(Project.LICENSE_FILE_MAX_AGE_DAYS).CompareTo(DateTime.Now) > 0)
                {
                    reader = new StreamReader(fileName);
                }
                else
                {
                    // load the file remotely, don't hold diagnostics if load fails:
                    string            url        = Project.MISC_FOLDER_URL + "/" + fileName;
                    DloadProgressForm loaderForm = new DloadProgressForm(url, fileName, false, true);
                    loaderForm.ShowDialog();
                    reader = new StreamReader(fileName);
                }
            }
            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);
        }