Beispiel #1
0
 public static void Copy(IUserWaypointData src, IUserWaypointData dest)
 {
     dest.ID           = src.ID;
     dest.Description  = src.Description;
     dest.GeocacheCode = src.GeocacheCode;
     dest.Lat          = src.Lat;
     dest.Lon          = src.Lon;
     dest.Date         = src.Date;
 }
Beispiel #2
0
 public static void Copy(IUserWaypointData src, IUserWaypointData dest)
 {
     dest.ID = src.ID;
     dest.Description = src.Description;
     dest.GeocacheCode = src.GeocacheCode;
     dest.Lat = src.Lat;
     dest.Lon = src.Lon;
     dest.Date = src.Date;
 }
Beispiel #3
0
        private void createRecord(Storage.Database db, IUserWaypointData data)
        {
            using (MemoryStream ms = new MemoryStream(DataBuffer))
            using (BinaryWriter bw = new BinaryWriter(ms))
            {
                ms.Position = 0;

                ms.Position = 150;
                bw.Write(Utils.Conversion.DateTimeToLong(data.Date)); //150
                bw.Write(data.Lat); //158
                bw.Write(data.Lon); //166
                ms.Position = 200;
                bw.Write(data.GeocacheCode);
                ms.Position = 220;
                bw.Write(data.Description);

                RecordInfo = db.RequestUserWaypointRecord(data.ID, data.GeocacheCode ?? "", DataBuffer, ms.Position, 50);
            }
        }
Beispiel #4
0
        private void createRecord(Storage.Database db, IUserWaypointData data)
        {
            using (MemoryStream ms = new MemoryStream(DataBuffer))
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    ms.Position = 0;

                    ms.Position = 150;
                    bw.Write(Utils.Conversion.DateTimeToLong(data.Date)); //150
                    bw.Write(data.Lat);                                   //158
                    bw.Write(data.Lon);                                   //166
                    ms.Position = 200;
                    bw.Write(data.GeocacheCode);
                    ms.Position = 220;
                    bw.Write(data.Description);

                    RecordInfo = db.RequestUserWaypointRecord(data.ID, data.GeocacheCode ?? "", DataBuffer, ms.Position, 50);
                }
        }
Beispiel #5
0
        //new record to be stored
        public UserWaypoint(Storage.Database db, IUserWaypointData data)
            : base(null)
        {
            _id = data.ID;
            using (MemoryStream ms = new MemoryStream(_buffer))
            using (BinaryWriter bw = new BinaryWriter(ms))
            {
                ms.Position = 0;
                //todo: add string length checks!!!

                ms.Position = 150;
                bw.Write(data.Date.ToFileTime()); //150
                bw.Write(data.Lat); //158
                bw.Write(data.Lon); //166
                ms.Position = 200;
                bw.Write(data.GeocacheCode); 
                ms.Position = 220;
                bw.Write(data.Description);

                RecordInfo = db.RequestUserWaypointRecord(data.ID, _buffer, ms.Position, 50);
            }
            db.UserWaypointCollection.Add(this);
        }
Beispiel #6
0
 //new record to be stored
 public UserWaypoint(Storage.Database db, IUserWaypointData data)
     : this(null)
 {
     createRecord(db, data);
     db.UserWaypointCollection.Add(this);
 }
Beispiel #7
0
 //new record to be stored
 public UserWaypoint(Storage.Database db, IUserWaypointData data)
     : this(null)
 {
     createRecord(db, data);
     db.UserWaypointCollection.Add(this);
 }