Ejemplo n.º 1
0
        private static void CheckEventPlace(GDMCustomEvent aEvent)
        {
            GDMPlace place = aEvent.FindTag(GEDCOMTagName.PLAC, 0) as GDMPlace;

            if (place == null)
            {
                return;
            }

            GDMPointer placeLocation = place.FindTag(GEDCOMTagName._LOC, 0) as GDMPointer;

            if (placeLocation == null)
            {
                return;
            }

            if (placeLocation.XRef != "" && placeLocation.Value == null)
            {
                placeLocation.XRef = "";
            }

            if (place.StringValue != "")
            {
                GDMLocationRecord loc = placeLocation.Value as GDMLocationRecord;
                if (loc != null && place.StringValue != loc.LocationName)
                {
                    place.StringValue = loc.LocationName;
                }
            }
        }
Ejemplo n.º 2
0
        private void AddPlace(GDMPlace place, GDMCustomEvent placeEvent)
        {
            try {
                GDMLocationRecord locRec    = place.Location.Value as GDMLocationRecord;
                string            placeName = (locRec != null) ? locRec.LocationName : place.StringValue;

                ITVNode  node = fView.FindTreeNode(placeName);
                MapPlace mapPlace;

                if (node == null)
                {
                    mapPlace      = new MapPlace();
                    mapPlace.Name = placeName;
                    fPlaces.Add(mapPlace);

                    node = fView.PlacesTree.AddNode(fBaseRoot, placeName, mapPlace);

                    if (locRec == null)
                    {
                        PlacesCache.Instance.GetPlacePoints(placeName, mapPlace.Points);
                    }
                    else
                    {
                        GeoPoint pt = new GeoPoint(locRec.Map.Lati, locRec.Map.Long, placeName);
                        mapPlace.Points.Add(pt);
                    }

                    int num = mapPlace.Points.Count;
                    for (int i = 0; i < num; i++)
                    {
                        GeoPoint pt      = mapPlace.Points[i];
                        string   ptTitle = pt.Hint + string.Format(" [{0:0.000000}, {1:0.000000}]", pt.Latitude, pt.Longitude);
                        fView.PlacesTree.AddNode(node, ptTitle, pt);
                    }
                }
                else
                {
                    mapPlace = (node.Tag as MapPlace);
                }

                mapPlace.PlaceRefs.Add(new PlaceRef(placeEvent));
            } catch (Exception ex) {
                Logger.LogWrite("MapsViewerWin.AddPlace(): " + ex.Message);
            }
        }
Ejemplo n.º 3
0
        private static void CheckEventPlace(GDMCustomEvent evt)
        {
            GDMPlace   place         = evt.Place;
            GDMPointer placeLocation = place.Location;

            if (placeLocation.XRef != "" && placeLocation.Value == null)
            {
                placeLocation.XRef = "";
            }

            if (place.StringValue != "")
            {
                GDMLocationRecord locRec = placeLocation.Value as GDMLocationRecord;
                if (locRec != null && place.StringValue != locRec.LocationName)
                {
                    place.StringValue = locRec.LocationName;
                }
            }
        }
Ejemplo n.º 4
0
        private void CheckEventPlace(GDMPlace place)
        {
            GDMPointer        placeLocation = place.Location;
            GDMLocationRecord locRec        = fTree.GetPtrValue <GDMLocationRecord>(placeLocation);

            if (placeLocation.XRef != "" && locRec == null)
            {
                placeLocation.XRef = "";
            }

            if (place.StringValue != "")
            {
                if (locRec != null && place.StringValue != locRec.LocationName)
                {
                    place.StringValue = locRec.LocationName;
                }
            }

            CheckTagWithNotes(place);
        }
Ejemplo n.º 5
0
        private static void CheckEventPlace(GDMTree tree, GEDCOMFormat format, GDMPlace place)
        {
            GDMPointer placeLocation = place.Location;

            if (placeLocation.XRef != "" && placeLocation.Value == null)
            {
                placeLocation.XRef = "";
            }

            if (place.StringValue != "")
            {
                GDMLocationRecord locRec = placeLocation.Value as GDMLocationRecord;
                if (locRec != null && place.StringValue != locRec.LocationName)
                {
                    place.StringValue = locRec.LocationName;
                }
            }

            CheckTagWithNotes(tree, format, place);
        }