예제 #1
0
파일: MainForm.cs 프로젝트: gone3d/ortelius
        ///<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();
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: gone3d/ortelius
        //Initialize
        void InitStuff()
        {
            projSettings = new ProjectSettings();
            appSettings = new GenerelSettings();

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