public static void LoadTraitDefinitions() { if (JsonFiles.JsonFilePaths[typeof(TraitDefinitions).Name] == "") { definitions = JsonFiles.LoadFromCommonDirectory <TraitDefinitions>(TRAIT_FILE); } else { definitions = JsonFiles.LoadFrom <TraitDefinitions>(JsonFiles.JsonFilePaths[typeof(TraitDefinitions).Name]); } loaded = true; }
private T ShowLoadJsonObjectDialog <T>() { LoadDialog.InitialDirectory = JsonFiles.JsonFilePaths[typeof(T).Name]; LoadDialog.ShowDialog(); if (LoadDialog.FileName != "") { return(JsonFiles.LoadFrom <T>(LoadDialog.FileName)); } else { return(default(T)); } }