コード例 #1
0
        //ONLY USE FOR TESTING THE DB SCHEMA!  RESULTING OBJECT WILL NOT HAVE VALID PROPERTY VALUES!
        internal static GpsPoint FromTrackLog(TrackLog trackLog)
        {
            if (trackLog == null)
                throw new ArgumentNullException("trackLog");

            //May throw an exception, but should never return null
            var gpsPoint = FromFeature(MobileUtilities.CreateNewFeature(FeatureSource));
            gpsPoint.TrackLog = trackLog;
            return gpsPoint;
        }
コード例 #2
0
 internal static GpsPoint FromGpsConnection(TrackLog trackLog, GpsConnection gpsConnection)
 {
     if (trackLog == null)
         throw new ArgumentNullException("trackLog");
     if (gpsConnection == null)
         throw new ArgumentNullException("gpsConnection");
     #if !TESTINGWITHOUTGPS
     if (!gpsConnection.IsOpen)
         throw new InvalidOperationException("GPS connection is closed");
     #endif
     //May throw an exception, but should never return null
     var gpsPoint = FromFeature(MobileUtilities.CreateNewFeature(FeatureSource));
     gpsPoint.TrackLog = trackLog;
     gpsPoint.LoadAttributes(gpsConnection);
     return gpsPoint;
 }
コード例 #3
0
 private static TrackLog FromFeature(Feature feature)
 {
     if (feature == null)
         return null;
     if (!feature.IsEditing)
         feature.StartEditing();
     feature.Geometry = new Polyline();
     var trackLog = new TrackLog { Feature = feature };
     trackLog.LoadAttributes();
     TrackLogs[trackLog.Guid] = trackLog;
     return trackLog;
 }
コード例 #4
0
 private void LoadAttributes(TrackLog templateTrackLog)
 {
     Vessel = templateTrackLog.Vessel;
     DataRecorder = templateTrackLog.DataRecorder;
     Observer1 = templateTrackLog.Observer1;
     Observer2 = templateTrackLog.Observer2;
     ProtocolId = templateTrackLog.ProtocolId;
     Weather = templateTrackLog.Weather;
     Visibility = templateTrackLog.Visibility;
     Beaufort = templateTrackLog.Beaufort;
     OnTransect = templateTrackLog.OnTransect;
 }
コード例 #5
0
        internal static TrackLog FromTrackLog(TrackLog oldTrackLog)
        {
            if (oldTrackLog == null)
                throw new ArgumentNullException("oldTrackLog");

            TrackLog trackLog = FromTransect(oldTrackLog.Transect);
            trackLog.LoadAttributes(oldTrackLog);
            return trackLog;
        }