Ejemplo n.º 1
0
        public static bool LoadFile()
        {
            string exe = Assembly.GetExecutingAssembly().Location;
            string filename = Path.GetDirectoryName(exe) + "\\setting.xml";
            if (!File.Exists(filename))
            {
                SaveFile();
            }
            XmlSerializer serializer = new XmlSerializer(typeof(Preference));
            using (StreamReader reader = new StreamReader(filename))
            {
                pre = (Preference)serializer.Deserialize(reader);
            }

            return true;
        }
Ejemplo n.º 2
0
 void PreferencesForm_Shown(object sender, EventArgs e)
 {
     _preference = PreferencesMgr.Preference;
     _propertyGrid.SelectedObject = _preference;
 }