コード例 #1
0
 public frmPDFViewer()
 {
     InitializeComponent();
     //Update path to xpdfrc
     if (ConfigurationManager.AppSettings.Get("xpdfrc") == "xpdfrc")
     {
         // Open App.Config of executable
         Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
         // Add an Application Setting.
         config.AppSettings.Settings.Remove("xpdfrc");
         config.AppSettings.Settings.Add("xpdfrc", AppDomain.CurrentDomain.BaseDirectory + "xpdfrc");
         // Save the configuration file.
         config.Save(ConfigurationSaveMode.Modified);
         // Force a reload of a changed section.
         ConfigurationManager.RefreshSection("appSettings");
     }
     pageViewControl1.PageSize = new Size(pageViewControl1.Width,(int)( pageViewControl1.Width*11/8.5));
     pageViewControl1.Visible = true;
     Instance = this;
     
     StatusLabel.Text = Resources.UIStrings.StatusReady;
 }
コード例 #2
0
ファイル: frmPDFViewer.cs プロジェクト: w1146869587/XPdfNet
        public frmPDFViewer()
        {
            InitializeComponent();
            //Update path to xpdfrc
            if (ConfigurationManager.AppSettings.Get("xpdfrc") == "xpdfrc")
            {
                // Open App.Config of executable
                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                // Add an Application Setting.
                config.AppSettings.Settings.Remove("xpdfrc");
                config.AppSettings.Settings.Add("xpdfrc", AppDomain.CurrentDomain.BaseDirectory + "xpdfrc");
                // Save the configuration file.
                config.Save(ConfigurationSaveMode.Modified);
                // Force a reload of a changed section.
                ConfigurationManager.RefreshSection("appSettings");
            }
            pageViewControl1.PageSize = new Size(pageViewControl1.Width, (int)(pageViewControl1.Width * 11 / 8.5));
            pageViewControl1.Visible  = true;
            Instance = this;

            StatusLabel.Text = Resources.UIStrings.StatusReady;
        }