public static bool Save(ProfileFile profile) { string content = ToJson(profile); try { if (File.Exists(profile.FilePath)) { string backupPath = profile.FilePath + ".bak"; if (File.Exists(backupPath)) { File.Delete(backupPath); } File.Move(profile.FilePath, backupPath); } File.WriteAllText(profile.FilePath, content); } catch (Exception exception) { Logger.LogException(exception); return(false); } return(true); }
public static void Debug(params object[] objects) { HostLogger.Debug(new object[] { "Script: " }.Concat(objects).ToArray()); }
public static void Information(params object[] objects) { HostLogger.Information(new object[] { "Script: " }.Concat(objects).ToArray()); }