예제 #1
0
 public void RemoveChild(Place child)
 {
     places.Remove(child);
     dirty = true;
 }
예제 #2
0
 public void AddChildPlace(Place child)
 {
     places.Add(child);
     dirty = true;
 }
 private void contextResults_ItemDoubleClicked(object sender, Place e)
 {
     Earth3d.MainWindow.GotoTarget(e, false, false);
 }
예제 #4
0
        public static Place FromIPlace(IPlace place)
        {
            Place newPlace = new Place();
            if (place.BackgroundImageSet != null)
            {
                newPlace.backgroundImageSetField = new PlaceBackgroundImageSet();
                newPlace.backgroundImageSetField.ImageSet = ImageSet.FromIImage(place.BackgroundImageSet);
            }
            if (place.StudyImageset != null)
            {
                newPlace.foregroundImageSetField = new PlaceForegroundImageSet();
                newPlace.foregroundImageSetField.ImageSet = ImageSet.FromIImage(place.StudyImageset);
            }
            newPlace.CamParams = place.CamParams;

            string names="";
            string delim = "";
            foreach (string name in place.Names)
            {
                names += delim;
                names += name;
                delim = ";";
            }
            newPlace.Name = names;
            newPlace.Classification = place.Classification;
            newPlace.classificationFieldSpecified = true;
            newPlace.Type  = place.Type;
            newPlace.Constellation = place.Constellation;
            newPlace.Magnitude = place.Magnitude;
            newPlace.Distance = place.Distance;
            newPlace.AngularSize = place.ZoomLevel;
            newPlace.anglularSizeFieldSpecified = true;
            newPlace.Url = place.Url;
            newPlace.Thumbnail = place.Thumbnail;
            newPlace.Target = place.Target;
            newPlace.Tag = place.Tag;
            if (place.Type == ImageSetType.Sky)
            {
                newPlace.raFieldSpecified = true;
                newPlace.decFieldSpecified = true;
            }
            else
            {
                newPlace.latFieldSpecified = true;
                newPlace.lngFieldSpecified = true;
            }
            return newPlace;
        }
        private void ShowOpenImageMenu(Place place)
        {
            if (contextMenu != null)
            {
                contextMenu.Dispose();
            }

            contextMenu = new ContextMenuStrip();

            var closeImageMenu = new ToolStripMenuItem(Language.GetLocalizedText(212, "Close"));
            var popertiesMenu = new ToolStripMenuItem(Language.GetLocalizedText(20, "Properties"));
            closeImageMenu.Click += closeImageMenu_Click;
            popertiesMenu.Click += popertiesMenu_Click;
            closeImageMenu.Tag = place;
            popertiesMenu.Tag = place;
            contextMenu.Items.Add(popertiesMenu);
            contextMenu.Items.Add(closeImageMenu);
            contextMenu.Show(Cursor.Position);
        }