private static string BuildExportUrl(ExportFileType fileType, int activityId, bool detailedHistory, bool original) { var queryString = HttpUtils.CreateQueryString(); queryString.Add("full", detailedHistory.ToString().ToLower()); queryString.Add("original", original.ToString().ToLower()); return(String.Format("http://connect.garmin.com/proxy/activity-service-1.2/{0}/activity/{1}?{2}", fileType.ToString().ToLower(), activityId, queryString)); }
private static string BuildExportUrl(ExportFileType fileType, string activityId) { switch (fileType) { case ExportFileType.Gpx: return(String.Format("https://connect.garmin.com/modern/proxy/download-service/export/{0}/activity/{1}", fileType.ToString().ToLower(), activityId)); case ExportFileType.Original: return(String.Format("https://connect.garmin.com/modern/proxy/download-service/files/activity/{0}", activityId)); // https://connect.garmin.com/modern/proxy/download-service/files/activity/3363902914 default: throw new ArgumentOutOfRangeException(nameof(fileType), fileType, null); } }
public void GenerateFile(string path, ExportFileType fileType) { switch (fileType) { case ExportFileType.TabSeparated: GenerateTabSeparatedFile(path, GetExportData().Select(t => t.Item3)); break; default: GenerateExcelFile(path, GetExportData().Select(t => t.Item3)); break; } Analytics.Track("Export", new Dictionary <string, string> { { "exportType", fileType.ToString() }, { "includeVoiceActors", IncludeVoiceActors.ToString() } }); }
private string BuildActivityFileName(int activityId, ExportFileType fileType) { string fileName = String.Format("Activity{0}.{1}", activityId, fileType.ToString().ToLower()); return(Path.Combine(OutputPath, fileName)); }
private static string GetExtension(ExportFileType exportFileType) { var attr = typeof(ExportFileType).GetField(exportFileType.ToString()).GetCustomAttributes(false).First(); return ((ExportFileAttribute)attr).Extension; }