コード例 #1
0
        private void LoadParamFile()
        {
            string file = conf_file;

            if (System.IO.File.Exists(file))
            {
                try {
                    System.Xml.Serialization.XmlSerializer xml_sr = new System.Xml.Serialization.XmlSerializer(typeof(SettingParams));
                    System.IO.StreamReader sr = new System.IO.StreamReader(file, new System.Text.UTF8Encoding(false));
                    prms = (SettingParams)xml_sr.Deserialize(sr);
                    sr.Close();
                }
                catch
                {
                    prms = new SettingParams();
                    prms.load_default_param();
                    return;
                }
            }
            else
            {
                prms = new SettingParams();
                prms.load_default_param();
            }
        }
コード例 #2
0
 public void AttachObject(Form1 fm, SettingParams pm)
 {
     parent_form = fm;
     prms        = pm;
 }