当前位置: 首页>>代码示例>>C#>>正文


C# Activity.GetInfo方法代码示例

本文整理汇总了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();
        }
开发者ID:pawel-stolka,项目名称:Activities,代码行数:61,代码来源:Program.cs


注:本文中的Activity.GetInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。