如何将独立存储应用于以下程序中的文本块。通过在此链接中查看这些图像,您可以清楚地了解我想要做的是“如何使用 Sqlite 在数据库中保存值? ”我需要日期(今天的日期 - 不包含在代码中),时间(TimeLabel.文本),步速(paceLabel.Text),距离(distanceLabel.Text)要从下面的程序中隔离存储,以将它们发布到列表框中。任何可以让我很好地将值存储在隔离存储中的链接(简短答案)以发布在列表框中也被接受和赞赏。提前谢谢你。
//location tracker
public partial class Mog : PhoneApplicationPage
{
// private Geo
// _watcher = new Geolocator(GeoPositionAccuracy.High);
private GeoCoordinateWatcher _watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
private MapPolyline _line;
private DispatcherTimer _timer = new DispatcherTimer();
private long _startTime;
public Mog()
{
InitializeComponent();
_line = new MapPolyline();
_line.StrokeColor = Colors.Red;
_line.StrokeThickness = 5;
Map.MapElements.Add(_line);
_watcher.Start();
_timer.Start();
_startTime = System.Environment.TickCount;
_watcher.PositionChanged += Watcher_PositionChanged;
_timer.Interval = TimeSpan.FromSeconds(1);
_timer.Tick += Timer_Tick;
}
private double _kilometres;
private double calories;
private long _previousPositionChangeTick;
private void Watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
{
//IsolatedStorageSettings milli = IsolatedStorageSettings.ApplicationSettings;
var coord = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);
if (_line.Path.Count > 0)
{
var calories = caloriesLabel.Text;
var previousPoint = _line.Path.Last();
var distance = coord.GetDistanceTo(previousPoint);
var millisPerKilometer = (1000.0 / distance) * (System.Environment.TickCount - _previousPositionChangeTick);
_kilometres += distance / 1000.0;
paceLabel.Text = TimeSpan.FromMilliseconds(millisPerKilometer).ToString(@"mm\:ss");
distanceLabel.Text = string.Format("{0:f2} km", _kilometres);
caloriesLabel.Text = string.Format("{0:f0}", _kilometres * 65);
PositionHandler handler = new PositionHandler();
var heading = handler.CalculateBearing(new Position(previousPoint), new Position(coord));
Map.SetView(coord, Map.ZoomLevel, heading, MapAnimationKind.Parabolic);
}
else
{
Map.Center = coord;
}
_line.Path.Add(coord);
_previousPositionChangeTick = System.Environment.TickCount;
}
}