コード例 #1
0
        /// <summary>
        /// Serializes a given match in it's own folder
        /// </summary>
        /// <param name="match"></param>
        public static void SerializeMatch(MatchModel match)
        {
            string workingDir = WorkingDir + DIR_MATCHES + match.ToString() + "\\";

            // Match doesn't have his own data folder
            if (!Directory.Exists(workingDir))
            {
                CreateMatchFolder(workingDir);
            }


            DownloadPhotos(match.Person.Photos, workingDir);
            DownloadInstagramPhotos(match.Instagram, workingDir);

            // Writes messages
            File.WriteAllText(workingDir + match.Person + MSGS + EXT,
                              JsonConvert.SerializeObject(match.Messages, Formatting.Indented));

            // Writes match data
            File.WriteAllText(workingDir + match.Person + EXT,
                              JsonConvert.SerializeObject(match, Formatting.Indented));
        }
コード例 #2
0
 /// <summary>
 /// Moves match to "Unmatched" dir
 /// </summary>
 /// <param name="match"></param>
 /// <returns></returns>
 public static bool MoveMatchToUnMatched(MatchModel match)
 {
     return(MoveToUnmatched(match.ToString(), DIR_UNMATCHED));
 }