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


C# CLLocationManager.RespondsToSelector方法代码示例

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


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

示例1: Geolocator

        /// <summary>
        /// Initializes a new instance of the <see cref="Geolocator"/> class.
        /// </summary>
        public Geolocator()
        {
            _manager = GetManager();
            _manager.AuthorizationChanged += OnAuthorizationChanged;
            _manager.Failed += OnFailed;

            if (_manager.RespondsToSelector(new Selector("requestWhenInUseAuthorization")))
            {
                _manager.RequestWhenInUseAuthorization();
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0))
            {
                _manager.LocationsUpdated += OnLocationsUpdated;
            }
            else
            {
                _manager.UpdatedLocation += OnUpdatedLocation;
            }

            _manager.UpdatedHeading += OnUpdatedHeading;
        }
开发者ID:elschihyi,项目名称:Tap5050Buyer,代码行数:25,代码来源:Geolocator.cs

示例2: FinishedLaunching

        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            MapServices.ProvideAPIKey ("AIzaSyA8WOvgGyHaw3rgkeYuUIqkIxhmW9Hrdjc");

            locationManager = new CLLocationManager ();
            locationManager.Delegate = new locationManagerDelegate ();
            locationManager.DesiredAccuracy = CLLocation.AccuracyBest;

            locationManager.RequestAlwaysAuthorization ();

            if (locationManager.RespondsToSelector (new Selector ("requestWhenInUseAuthorization")))
            {
                locationManager.RequestWhenInUseAuthorization ();
            }
            if (CLLocationManager.LocationServicesEnabled) {
                locationManager.StartUpdatingLocation ();
            }

            ProgressHUD.Shared.HudForegroundColor = UIColor.Gray;
            ProgressHUD.Shared.Ring.Color = UIColor.FromRGB(44/255f,146/255f,208/255f);
            ProgressHUD.Shared.HudForegroundColor = UIColor.FromRGB(44/255f,146/255f,208/255f);

            UIApplication.SharedApplication.SetStatusBarStyle (UIStatusBarStyle.LightContent, true);

            this.Window = new UIWindow (UIScreen.MainScreen.Bounds);
            UINavigationController navigation = new UINavigationController(new StartingScreen());
            navigation.NavigationBar.TintColor = UIColor.White;
            navigation.NavigationBar.BarTintColor = UIColor.FromRGB(44/255f,146/255f,208/255f);
            navigation.NavigationBar.BarStyle = UIBarStyle.Black;
            navigation.SetNavigationBarHidden (true,true);

            this.Window.RootViewController = navigation;
            this.Window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:ppkdo,项目名称:sipper,代码行数:36,代码来源:AppDelegate.cs

示例3: ShowActualLocationPermissionAlert

        void ShowActualLocationPermissionAlert()
        {
            _locationManager = new CLLocationManager ();
            _locationManager.Delegate = new LocationManagerDelegate (this);

            if (_locationAuthorizationType == ClusterLocationAuthorizationType.Always &&
                _locationManager.RespondsToSelector (new Selector ("requestAlwaysAuthorization")))
            {
                _locationManager.RequestAlwaysAuthorization ();
            }
            else if (_locationAuthorizationType == ClusterLocationAuthorizationType.WhenInUse &&
                     _locationManager.RespondsToSelector (new Selector ("requestWhenInUseAuthorization")))
            {
                _locationManager.RequestWhenInUseAuthorization ();
            }

            _locationManager.StartUpdatingLocation ();
        }
开发者ID:CutFlame,项目名称:ClusterPrePermissions,代码行数:18,代码来源:ClusterPrePermissions.cs


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