TraktPlugin.TraktCache.SaveFileCache C# (CSharp) Méthode

SaveFileCache() static private méthode

static private SaveFileCache ( string file, string value ) : void
file string
value string
Résultat void
        internal static void SaveFileCache(string file, string value)
        {
            if ((file.Contains("{username}") && string.IsNullOrEmpty(TraktSettings.Username)) || value == null)
                return;

            // add username to filename
            string filename = file.Replace("{username}", TraktSettings.Username);

            TraktLogger.Debug("Saving file to disk. Filename = '{0}'", filename);

            try
            {
                Directory.CreateDirectory(Path.GetDirectoryName(filename));
                File.WriteAllText(filename, value, Encoding.UTF8);
            }
            catch (Exception e)
            {
                TraktLogger.Error(string.Format("Error saving file. Filename = '{0}', Error = '{1}'", filename, e.Message));
            }
        }
TraktCache