Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static void Debug(params object[] objects)
 {
     HostLogger.Debug(new object[] { "Script: " }.Concat(objects).ToArray());
 }
Exemplo n.º 3
0
 public static void Information(params object[] objects)
 {
     HostLogger.Information(new object[] { "Script: " }.Concat(objects).ToArray());
 }