public async Task<Photo> GetOriginalTagsTask(Photo photo) { var extraParams = new Dictionary<string, string> { {ParameterNames.PhotoId, photo.Id}, {ParameterNames.Secret, photo.Secret} }; var photoResponse = (Dictionary<string, object>) await _oAuthManager.MakeAuthenticatedRequestAsync(Methods.PhotosGetInfo, extraParams); // Override the internal tags with the original ones photo.Tags = string.Join(", ", photoResponse.ExtractOriginalTags()); return photo; }
private static void WriteMetaDataFile(Photo photo, string targetFileName, Preferences preferences) { Dictionary<string, string> metadata = preferences.Metadata.ToDictionary(metadatum => metadatum, metadatum => photo.GetType() .GetProperty(metadatum) .GetValue(photo, null) .ToString()); if (metadata.Count > 0) File.WriteAllText(string.Format("{0}.json", targetFileName), metadata.ToJson(), Encoding.Unicode); }