Beispiel #1
0
    public static void SaveToDataPath <T>(string p_filename, object p_instance) where T : class
    {
        if (!Directory.Exists(SAVE_DATA_PATH))
        {
            Directory.CreateDirectory(SAVE_DATA_PATH);
        }

        EncryptedXmlSerializer.Save <T>(GetFormattedFilePath(p_filename), p_instance);
    }
Beispiel #2
0
    public static object LoadFromDataPath <T>(string p_filename) where T : class
    {
        if (!Directory.Exists(SAVE_DATA_PATH))
        {
            return(null);
        }

        return(EncryptedXmlSerializer.Load <T>(GetFormattedFilePath(p_filename)));
    }