Manage your ASL charts, play aids and other documents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
asl-charts/src/JsonConfig.cs

25 lines
649 B

using System ;
using System.IO ;
using Newtonsoft.Json ;
// --------------------------------------------------------------------
public class JsonConfig
{
private dynamic mData ;
public JsonConfig( string caption, string fname )
{
// load the JSON config
string data ;
if ( File.Exists( fname ) ) {
Program.logTraceMsg( String.Format( "Loading {0}: {1}", caption, Path.GetFullPath(fname) ) ) ;
data = File.ReadAllText( fname ) ;
} else
data ="{}" ;
mData = JsonConvert.DeserializeObject( data ) ;
}
public dynamic data { get { return mData ; } }
}