示例#1
0
        private void frmVWRAPLauncher_Load(object sender, EventArgs e)
        {
            string path, arguments;

            cboStartLocation.Items.Add(START_HOME);
            cboStartLocation.Items.Add(START_LAST);
            cboStartLocation.Items.Add(START_TYPE);
            cboStartLocation.SelectedIndex = 1;

            panel.VerticalScroll.Enabled = true;
            panel.Click += HighlightItem;

            PopulateList();

            if (!String.IsNullOrEmpty(LaunchDocumentPath))
            {
                m_launchDocument = LaunchDocument.FromFile(LaunchDocumentPath);
                if (m_launchDocument == null)
                {
                    MessageBox.Show("Failed to load a VWRAP launch document from \"" + LaunchDocumentPath + "\"",
                                    "VWRAP Launcher", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            if (m_launchDocument != null)
            {
                // If a viewer preference was saved we can go straight to launching
                if (LoadViewerPreference(out path, out arguments))
                {
                    chkRemember.Checked = true;
                    LaunchViewer(path, arguments);
                }
            }
            else
            {
                // Clear the remember preference
                chkRemember_CheckedChanged(chkRemember, null);

                MessageBox.Show("The VWRAP Launcher will automatically handle VWRAP documents in a web browser. " +
                                "You do not need to run this application directly.", "VWRAP Launcher",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }