/// <summary> /// creates a new config /// </summary> public FlakeLIConfiguration() { _Path = @"Flake.MoBa.XpressNetLi.conf"; Data = new FlakeLIConfigData(); Read(); #if DEBUG Write(@"Flake.MoBa.XpressNetLi.conf.debug"); #endif }
/// <summary> /// reads the config from disk /// </summary> private void Read() { FileInfo fi = new FileInfo(_Path); if (fi.Exists) { XmlSerializer ser = new XmlSerializer(typeof(FlakeLIConfigData)); StreamReader sr = new StreamReader(_Path); Data = (FlakeLIConfigData)ser.Deserialize(sr); sr.Close(); } else { Write(); } }