本文整理汇总了C#中Activity.GetInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Activity.GetInfo方法的具体用法?C# Activity.GetInfo怎么用?C# Activity.GetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity.GetInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Activity act = new Activity();
var filesInDir = Directory.GetFiles(dir);
List<Files> fileList = new List<Files>();
int i = 0;
foreach (var file in filesInDir)
{
fileList.Add(
new Files(i, file)
);
var path = fileList[i].Path;
//var activity = new Activity();
var infoList = act.GetInfo(path);
var dateInfo = infoList[0].Id; //activity.LapList[0].StartTime;
var shownPath = path.Replace(@"F:\___PORZĄDKI___Dysk_D\.Net Libraries\tcx\", "");
Console.WriteLine(fileList[i].Index + " - " + dateInfo);
i++;
}
Console.WriteLine("Which file you want to know better (nr)? ;");
int answer = Convert.ToInt32(Console.ReadLine());
string chosenPath = fileList[answer].Path;
var visiblePath = chosenPath.Replace(@"F:\___PORZĄDKI___Dysk_D\.Net Libraries\tcx\", "");
//var fullPath = chosenPath;
Console.WriteLine(chosenPath);
var activityList = act.GetInfo(exampleFile);//chosenPath);
foreach (var item in activityList)
{
Console.WriteLine("sport: {0}",item.Sport);
Console.WriteLine("id: {0}",item.Id);
var laps = item.LapList;
int j = 1;
foreach (var el in laps)
{
Console.WriteLine("- {0} km", j);
Console.WriteLine(" start: {0}", el.StartTime.ToLongTimeString());
//Console.WriteLine(" total sec: {0}", el.TotalSeconds);
Console.WriteLine(" distance: {0:F2}", el.Distance);
//Console.WriteLine(" calories: {0}", el.Calories);
Console.WriteLine(" avg HR: {0}", el.AvgHR);
Console.WriteLine(" max HR: {0}", el.MaxHR);
Console.WriteLine(" avg speed: {0:F2} km/h", el.AvgSpeed);
Console.WriteLine(" avg speed: {0:F2} m/s", 0.27778 * el.AvgSpeed);
Console.WriteLine();
j++;
//foreach (var track in tracks)
//{
// Console.WriteLine(track.);
//}
}
}
Console.ReadKey();
}