Service implementation for segments in the Strava API
Inheritance: BaseService, ISegmentService
Exemple #1
0
        private void ImportEffortsFromStrava()
        {
            efforts = new List<Models.Effort>();
            var originalCulture = Utils.SetStravaCultureAndReturnCurrentCulture();
            try
            {
                SegmentService serv = new SegmentService(StravaWebClientObj);
                Stravan.Segment segmentinfo = serv.Show(segmentID);

                GetEfforts(serv);
                AthleteUpdate.UpdateAthlete();
                SaveEfforts();
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = originalCulture;
            }
        }
Exemple #2
0
        private void GetEfforts(SegmentService serv)
        {
            SegmentEfforts stravaEfforts;
            int offset = 0;
            do
            {
                stravaEfforts = serv.Efforts(segmentID, offset: offset);

                if (BreakAtOffset > 0 && offset > BreakAtOffset)
                    break;

            } while (GetEffortsLoop(ref stravaEfforts, ref offset));
        }