static void initWithDefaults( ) { _instance=new Constants( ); }
public static void TryToLoadOtherwiseSetDefaults( string filename ) { string path = @"{0}\{1}".FormatWith(Application.StartupPath, filename) ; if( !File.Exists( path ) ) { initWithDefaults( ); return ; } using( FileStream stream = File.Open( path, FileMode.Open ) ) { var serializer = new XmlSerializer( typeof( Constants ) ) ; _instance = (Constants) serializer.Deserialize( stream ) ; stream.Close( ) ; } }