本文整理汇总了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();
}
示例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;
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例6: _watcher_StatusChanged
void _watcher_StatusChanged(object sender,
GeoPositionStatusChangedEventArgs e)
{
if (e.Status == GeoPositionStatus.Disabled
|| _watcher.Permission == GeoPositionPermission.Denied)
Dispose();
}
示例7: locationWatcher_StatusChanged
static void locationWatcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
if (StatusChanged != null)
{
StatusChanged(sender, e);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例14: OnLocationFailed
public void OnLocationFailed(GeoPositionStatusChangedEventArgs e)
{
var handler = LocationFailed;
if (handler != null)
{
handler(this, e);
}
}
示例15: WatcherStatusChanged
void WatcherStatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
if (e.Status == GeoPositionStatus.Ready)
{
_watcher.Stop();
SetLocalLocation(_watcher.Position.Location);
}
}