private void Form1_Load(object sender, System.EventArgs e) { // load PersistedData FileStream fs = null; try { // Create an XmlSerializer for the PersistedData type. XmlSerializer ser = new XmlSerializer(typeof(PersistedData)); FileInfo fi = new FileInfo(Application.LocalUserAppDataPath + Path.DirectorySeparatorChar + @"FontVal.Data"); // If the config file exists, open it. if(fi.Exists) { fs = fi.OpenRead(); m_PersistedData = (PersistedData)ser.Deserialize(fs); } } catch(Exception ex) { MessageBox.Show(ex.Message); } finally { // If the FileStream is open, close it. if (fs != null) fs.Close(); } UpdateMRUMenus(); // hack the size of the listbox if it is bigger than the tabcontrol // which happens courtesy of the current .Net framework when running the program // on a display that is greater than 96 dpi if (listBoxFont.Right > tabControl1.Width || listBoxFont.Bottom > tabControl1.Height) { listBoxFont.SetBounds(listBoxFont.Location.X, listBoxFont.Location.Y, tabControl1.Width-listBoxFont.Left*3, tabControl1.Height-listBoxFont.Top-listBoxFont.Left*3, BoundsSpecified.Size); } // show help if this is the first time the program is being run if (m_PersistedData.m_bFirstTime) { Help.ShowHelp(this, "fontvalidatorhelp.chm", HelpNavigator.Topic, "usingvalidator.htm"); m_PersistedData.m_bFirstTime = false; } }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // m_Validator = new Validator(); string [] sTableTypes = TableManager.GetKnownOTTableTypes(); for (int i=0; i<sTableTypes.Length; i++) { checkedListBoxTests.Items.Add(sTableTypes[i], System.Windows.Forms.CheckState.Checked); } groupBoxCTFlags.Enabled = checkBoxClearType.Checked; m_project = new project(); m_RastTestTransform = new RastTestTransform(); m_PersistedData = new PersistedData(); }