예제 #1
0
 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;
 }
예제 #2
0
        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));
            }
        }