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


C# GeoPositionStatusChangedEventArgs类代码示例

本文整理汇总了C#中GeoPositionStatusChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# GeoPositionStatusChangedEventArgs类的具体用法?C# GeoPositionStatusChangedEventArgs怎么用?C# GeoPositionStatusChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OnLocationFailed

 protected void OnLocationFailed(object sender, GeoPositionStatusChangedEventArgs e)
 {
     ShowLocationFailedMessage();
     this.isPhoneLocationServicesAvailbale = false;
     DeviceLocationInfo.Current.LocationFailed -= OnLocationFailed;
     RefreshList();
 }
开发者ID:valdisiljuconoks,项目名称:ATMFinder,代码行数:7,代码来源:MainPage.xaml.cs

示例2: geolocator_StatusChanged

        void geolocator_StatusChanged(object sender, GeoPositionStatusChangedEventArgs args)
        {
            string status = "";

            switch (args.Status)
            {
                case GeoPositionStatus.Disabled:
                    // the application does not have the right capability or the location master switch is off
                    status = "Disabled";
                    break;
                case GeoPositionStatus.Initializing:
                    // the geolocator started the tracking operation
                    status = "initializing";
                    break;
                case GeoPositionStatus.NoData:
                    // the location service was not able to acquire the location
                    status = "no data";
                    break;
                case GeoPositionStatus.Ready:
                    // the location service is generating geopositions as specified by the tracking parameters
                    status = "Ready";
                    break;
                default:
                    status = "N/A";
                    break;
            }

            statusBox.Text = status;
        }
开发者ID:ZeynepCamurdan,项目名称:maps-samples,代码行数:29,代码来源:MainPage.xaml.cs

示例3: gcw_StatusChanged

        private void gcw_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            //throw new NotImplementedException();
            if (e.Status == GeoPositionStatus.Ready)
            {
                GeoCoordinate coord = gcw.Position.Location;
                String CurLatLocation = coord.Latitude.ToString("0.000");
                String CurLonLocation = coord.Longitude.ToString("0.000");
                latitude.Text = "Latitude: " + CurLatLocation;
                longitude.Text = "Longitude: " + CurLonLocation;
                //After you have the location, stop the service to conserve power
                gcw.Stop();

                //Open Web Browser to navigate to Google Map using the current location from GPS;
                WebBrowserTask WebBrowserTask = new WebBrowserTask();
                WebBrowserTask.Uri = new Uri("http://maps.google.com/maps?q=" + CurLatLocation + "," +
                    CurLonLocation);
                WebBrowserTask.Show();

            }
            if (e.Status == GeoPositionStatus.Disabled || e.Status == GeoPositionStatus.NoData)
            {
                latitude.Text = "GPS Disabled";
                longitude.Text = "Please turn on your Location Service (GPS) in the system setting.";
                gcw.Stop();
            }
        }
开发者ID:EGartin,项目名称:AurariaCampusAppSE,代码行数:27,代码来源:GPSLocation.xaml.cs

示例4: StatusChangedHandler

        private void StatusChangedHandler(object sender, GeoPositionStatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case GeoPositionStatus.Disabled:
                    if (gcw.Permission == GeoPositionPermission.Denied)
                        status = "Permission denied";
                    else
                        status = "GPS is not supported";

                    MessageBox.Show(status);
                    break;

                case GeoPositionStatus.Initializing:
                    break;

                case GeoPositionStatus.NoData:
                    status = "Cannot retrieve data";
                    MessageBox.Show(status);
                    break;

                case GeoPositionStatus.Ready:
                    status = "Data retrieved";
                    break;

                default:
                    break;
            }
        }
开发者ID:abcfantasy,项目名称:Hack4Europe2012,代码行数:29,代码来源:GPS.cs

示例5: gps_StatusChanged

        void gps_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            
            switch (e.Status)
            {
                case GeoPositionStatus.Initializing:
                   
                    break;

                case GeoPositionStatus.Ready:
                   
                    try
                    {
                
                       // x = gps.Position.Location.Latitude;
                       // y = gps.Position.Location.Longitude;
                    }
                    catch
                    {
                        MessageBox.Show("No encontramos tu ubicacion pero te situamos en providencia ;) ");
               
                    }
                   
                    
                    break;

                case GeoPositionStatus.NoData:
                    Console.WriteLine("No podemos saber tu ubicacion, colocamos la ultima conocida");
                    break;

                case GeoPositionStatus.Disabled:
                    Console.WriteLine("Has desabilitado el GPS, para volver al mapa debes activarlo");
                    break;
            }   
        }
开发者ID:jacevedo,项目名称:Windows-Phone,代码行数:35,代码来源:MainPage.xaml.cs

示例6: _watcher_StatusChanged

 void _watcher_StatusChanged(object sender,
     GeoPositionStatusChangedEventArgs e)
 {
     if (e.Status == GeoPositionStatus.Disabled
         || _watcher.Permission == GeoPositionPermission.Denied)
         Dispose();
 }
开发者ID:Kelin-Hong,项目名称:JobHub_WP,代码行数:7,代码来源:ImmediateLocation.cs

示例7: locationWatcher_StatusChanged

 static void locationWatcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
 {
     if (StatusChanged != null)
     {
         StatusChanged(sender, e);
     }
 }
开发者ID:Reagankm,项目名称:onebusaway-windows-phone,代码行数:7,代码来源:LocationTracker.cs

示例8: watcher_StatusChanged

 void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case GeoPositionStatus.Disabled:
             // The location service is disabled or unsupported.
             // Alert the user
             StatusTextBlock.Text = "Location is unsupported on this device";
             break;
         case GeoPositionStatus.Initializing:
             // The location service is initializing.
             // Disable the Start Location button
             StatusTextBlock.Text = "Initializing location service";
             break;
         case GeoPositionStatus.NoData:
             // The location service is working, but it cannot get location data
             // Alert the user and enable the Stop Location button
             StatusTextBlock.Text = "Data unavailable";
             break;
         case GeoPositionStatus.Ready:
             // The location service is working and is receiving location data
             // Show the current position and enable the Stop Location button
             StatusTextBlock.Text = "Ready - retrieving data";
             break;
     }
 }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:26,代码来源:ShowGPSLocation.xaml.cs

示例9: MyStatusChanged

        private void MyStatusChanged(GeoPositionStatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case GeoPositionStatus.Disabled:
                    txtGpsEnabled.Text = "Disabled";
                    //Stop the Location Service to conserve battery power.
                    watcher.Stop();
                    break;

                case GeoPositionStatus.Initializing:
                    // The Location Service is initializing.
                    txtGpsEnabled.Text = "Enabled";
                    //Stop the Location Service to conserve battery power.
                    watcher.Stop();
                    break;

                case GeoPositionStatus.NoData:
                    // The Location Service is working, but it cannot get location data.
                    txtGpsEnabled.Text = "Enabled";
                    //Stop the Location Service to conserve battery power.
                    watcher.Stop();
                    break;

                case GeoPositionStatus.Ready:
                    // The Location Service is working and is receiving location data.
                    txtGpsEnabled.Text = "Enabled";
                    //Stop the Location Service to conserve battery power.
                    watcher.Stop();
                    break;
            }
        }
开发者ID:deleolowoyo,项目名称:Job-Compass,代码行数:32,代码来源:SettingsView.xaml.cs

示例10: OnStatusChanged

        private void OnStatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case GeoPositionStatus.NoData:
                case GeoPositionStatus.Disabled:
                    Permission = MvxLocationPermission.Denied;
                    var errorCode = _geoWatcher.Permission == GeoPositionPermission.Denied
                                        ? MvxLocationErrorCode.PermissionDenied
                                        : MvxLocationErrorCode.PositionUnavailable;
                    SendError(errorCode);
                    break;

                case GeoPositionStatus.Initializing:
                case GeoPositionStatus.Ready:
                    Permission = MvxLocationPermission.Granted;
                    // not an error - so ignored
                    break;

                default:
                    // other codes ignored
                    // TODO do other codes affect Permission?
                    break;
            }
        }
开发者ID:cyrilcathala,项目名称:MvvmCross-Plugins,代码行数:25,代码来源:MvxWindowsPhoneLocationWatcher.cs

示例11: watcher_StatusChanged

 private void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case GeoPositionStatus.Disabled:
             // The Location Service is disabled or unsupported.
             // Check to see if the user has disabled the Location Service.
             if (watcher.Permission == GeoPositionPermission.Denied)
             {
                 // The user has disabled the Location Service on their device.
                 statusString = "You have disabled Location Service.";
             }
             else
             {
                 statusString = "Location Service is not functioning on this device.";
             }
             break;
         case GeoPositionStatus.Initializing:
             statusString = "Location Service is retrieving data...";
             // The Location Service is initializing.
             break;
         case GeoPositionStatus.NoData:
             // The Location Service is working, but it cannot get location data.
             statusString = "Location data is not available.";
             break;
         case GeoPositionStatus.Ready:
             // The Location Service is working and is receiving location data.
             statusString = "Location data is available.";
             break;
     }
 }
开发者ID:mikejan,项目名称:EntacikGorc,代码行数:31,代码来源:LocationManager.cs

示例12: MyStatusChanged

        void MyStatusChanged(GeoPositionStatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case GeoPositionStatus.Disabled:
                    // The location service is disabled or unsupported.
                    // Alert the user
                    //"location is unsupported on this device";
                    break;
                case GeoPositionStatus.Initializing:
                    // The location service is initializing.
                    // Disable the Start Location button
                    //"initializing location service," + accuracyText;
                    break;
                case GeoPositionStatus.NoData:
                    // The location service is working, but it cannot get location data
                    // Alert the user and enable the Stop Location button
                    //"data unavailable," + accuracyText;
                    break;
                case GeoPositionStatus.Ready:
                    // The location service is working and is receiving location data
                    // Show the current position and enable the Stop Location button
                    //"receiving data, " + accuracyText;
                    break;

            }
        }
开发者ID:C4Help,项目名称:AllProjects,代码行数:27,代码来源:Stores.xaml.cs

示例13: watcher_StatusChanged

        void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case GeoPositionStatus.Disabled:
                    // The Location Service is disabled or unsupported.
                    // Check to see whether the user has disabled the Location Service.
                    if (this.watcher.Permission == GeoPositionPermission.Denied)
                    {
                        // The user has disabled the Location Service on their device.
                        Utilities.CrossThreadMessageBox("You have disabled location services on this device.");
                    }
                    else
                    {
                        Utilities.CrossThreadMessageBox("Location is not functioning on this device.");
                    }
                    break;

                case GeoPositionStatus.NoData:
                    // The Location Service is working, but it cannot get location data.
                    Utilities.CrossThreadMessageBox("Location data is not available.");
                    break;

                case GeoPositionStatus.Ready:
                    Debug.WriteLine("GeoPositionStatus.Ready");

                    this.ready = true;

                    this.watcher_PositionChanged(this, this.latestEventArgs);

                    break;
            }
        }
开发者ID:bradser,项目名称:BuddyTest,代码行数:33,代码来源:LocationTracker.cs

示例14: OnLocationFailed

 public void OnLocationFailed(GeoPositionStatusChangedEventArgs e)
 {
     var handler = LocationFailed;
     if (handler != null)
     {
         handler(this, e);
     }
 }
开发者ID:valdisiljuconoks,项目名称:ATMFinder,代码行数:8,代码来源:DeviceLocationInfo.cs

示例15: WatcherStatusChanged

 void WatcherStatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
 {
     if (e.Status == GeoPositionStatus.Ready)
     {
         _watcher.Stop();
         SetLocalLocation(_watcher.Position.Location);
     }
 }
开发者ID:douglaszuniga,项目名称:Reportero-Digital,代码行数:8,代码来源:GeoLocationManager.cs


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