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


C# CLLocation.Dispose方法代码示例

本文整理汇总了C#中CLLocation.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# CLLocation.Dispose方法的具体用法?C# CLLocation.Dispose怎么用?C# CLLocation.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLLocation的用法示例。


在下文中一共展示了CLLocation.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getAllBusStops

 //Caution: If radius is too large results will be HUGE!
 //radius in meters
 public IEnumerable<BusStop> getAllBusStops(CLLocation aboutLoc, double radius)
 {
     List<BusStop> stops = new List<BusStop>(30);
     using (LumenWorks.Framework.IO.Csv.CsvReader csv = new LumenWorks.Framework.IO.Csv.CsvReader(getReader("stops.txt"),true)) {
         while (csv.ReadNextRecord()){
             CLLocation loc = new CLLocation(double.Parse(csv["stop_lat"]), double.Parse(csv["stop_lon"]));
             if (loc.DistanceFrom(aboutLoc)<=radius)
                 stops.Add(new BusStop(csv["stop_name"],int.Parse(csv["stop_id"]), loc));
             loc.Dispose();
         }
         return stops;
     }
 }
开发者ID:jboolean,项目名称:RIT-Bus,代码行数:15,代码来源:BusDB_GTFS.cs

示例2: getClosestStop

 public BusStop? getClosestStop(CLLocation aboutLoc)
 {
     int closestId = -1;
     double closestDist=double.MaxValue;
     using (CsvReader csv = new CsvReader(getReader("stops.txt"),true)) {
         while (csv.ReadNextRecord()){
             CLLocation loc = new CLLocation(double.Parse(csv["stop_lat"]), double.Parse(csv["stop_lon"]));
             if (loc.DistanceFrom(aboutLoc)<=closestDist)
                 closestId=int.Parse(csv["stop_id"]);
             loc.Dispose();
         }
     }
     return (closestId==-1)?null:getStopInfo(closestId);
 }
开发者ID:jboolean,项目名称:RIT-Bus,代码行数:14,代码来源:BusDB_GTFS.cs

示例3: UpdatePosition

        private void UpdatePosition(CLLocation location)
        {
            Position p = (this.position == null) ? new Position() : new Position(this.position);

            if (location.HorizontalAccuracy > -1)
            {
                p.Accuracy = location.HorizontalAccuracy;
                p.Latitude = location.Coordinate.Latitude;
                p.Longitude = location.Coordinate.Longitude;
            }

            if (location.VerticalAccuracy > -1)
            {
                p.Altitude = location.Altitude;
                p.AltitudeAccuracy = location.VerticalAccuracy;
            }

            if (location.Speed > -1)
                p.Speed = location.Speed;

            //p.Timestamp = new DateTimeOffset(location.Timestamp);

            this.position = p;

            OnPositionChanged(new PositionEventArgs(p));

            location.Dispose();
        }
开发者ID:jakkaj,项目名称:Xamling-Core,代码行数:28,代码来源:GeoLocator.cs


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