Example #1
0
        ///<summary>Gemmer indstillings hashtablen i en fil</summary>
        void loadProjectSettings()
        {
            if(File.Exists(appSettings.CurrentProject)){
                //opret stream
                FileStream myStream=new FileStream(appSettings.CurrentProject,FileMode.Open,FileAccess.Read);
                myStream.Seek(0,SeekOrigin.Begin);
                BinaryFormatter binLaeser=new BinaryFormatter();

                ProjectSettings tempSettings = projSettings;

                try{
                    projSettings = (ProjectSettings) binLaeser.Deserialize(myStream);
                    introHeader.Text = projSettings.IntroHeader;
                    introText.Text = projSettings.IntroText;

                    //MessageBox.Show(projSettings.ShowAfterBuild.ToString());
                    showAfterBuildCB.Checked = projSettings.ShowAfterBuild;
                    changeFlag = false;
                }
                catch(Exception){
                    projSettings = tempSettings;
                    MessageBox.Show("The file hasent the right format","Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                myStream.Close();
            }
        }
Example #2
0
        //Initialize
        void InitStuff()
        {
            projSettings = new ProjectSettings();
            appSettings = new GenerelSettings();

            populateStyleCombo();
            changeFlag = false;
            newVersion.Visible = false;
            //checkForUpdates();
        }