Ejemplo n.º 1
0
        public void SetupContoursControl(Map map, SkyhunterCanvas canvas)
        {
            MyMap = map;
            skyHunterCanvas = canvas;

            //binding the checkboxes to the map
            DataContext = map;

            /*
             *
            Binding annotationBinding = new Binding("Visibility"); // Visibility is the property on the foreign object...
            annotationBinding.Source = MyCanvas.AnnotationController;
            annotationBinding.Converter = new VisibilityToBoolConverter();
            ShowAnnotationControl.SetBinding(SurfaceCheckBox.IsCheckedProperty, annotationBinding);
             *
             * */

            Binding pointVisibilityBinding = new Binding("Visible");
            pointVisibilityBinding.Source = (MyMap.Layers["PointAnnotations"] as Layer);
            PointAnnotations.SetBinding(SurfaceCheckBox.IsCheckedProperty, pointVisibilityBinding);
            PointAnnotations.IsChecked = false;
            PointAnnotations.Visibility = Visibility.Hidden;

            Binding lineVisibilityBinding = new Binding("Visible");
            lineVisibilityBinding.Source = (MyMap.Layers["LineAnnotations"] as Layer);
            LineAnnotations.SetBinding(SurfaceCheckBox.IsCheckedProperty, lineVisibilityBinding);
            LineAnnotations.Visibility = Visibility.Hidden;

            Binding polyVisibilityBinding = new Binding("Visible");
            polyVisibilityBinding.Source = (MyMap.Layers["PolygonAnnotations"] as Layer);
            PolygonAnnotations.SetBinding(SurfaceCheckBox.IsCheckedProperty, polyVisibilityBinding);
            PolygonAnnotations.IsChecked = false;
            PolygonAnnotations.Visibility = Visibility.Hidden;
        }
Ejemplo n.º 2
0
        public void SetupAnnotationControl(Map map, SkyhunterCanvas canvas)
        {
            MyMap = map;
            MyCanvas = canvas;
            CreateFeatureLayers();
            AddMapLayers();
            //SetupEditor();
            InitDrawObject();

            //binding the checkboxes to the map
            DataContext = map;

            //Binding lineVisibilityBinding = new Binding("Visible");
            //lineVisibilityBinding.Source = (MyMap.Layers["LineAnnotations"] as Layer);
            //LineAnnotations.SetBinding(SurfaceCheckBox.IsCheckedProperty, lineVisibilityBinding);

            //Binding polyVisibilityBinding = new Binding("Visible");
            //polyVisibilityBinding.Source = (MyMap.Layers["PolygonAnnotations"] as Layer);
            //PolygonAnnotations.SetBinding(SurfaceCheckBox.IsCheckedProperty, polyVisibilityBinding);
            //PolygonAnnotations.IsChecked = false;
        }
Ejemplo n.º 3
0
 public void SetupMenuButton(SkyhunterCanvas canvas, MenuLocation location)
 {
     switch (location)
     {
         case MenuLocation.Top:
             this.Orientation = 180.0;
             this.Center = new Point(canvas.CanvasWidth / 2, this.ActualHeight / 2);
             break;
         case MenuLocation.Right:
             this.Orientation = 270.0;
             this.Center = new Point(canvas.CanvasWidth - this.ActualHeight / 2, canvas.CanvasHeight / 2);
             break;
         case MenuLocation.Bottom:
             this.Orientation = 0.0;
             this.Center = new Point(canvas.CanvasWidth / 2, canvas.CanvasHeight - this.ActualHeight / 2);
             break;
         case MenuLocation.Left:
             this.Orientation = 90.0;
             this.Center = new Point(this.ActualHeight / 2, canvas.CanvasHeight / 2);
             break;
     }
 }
Ejemplo n.º 4
0
 public ContoursControl(Map map, SkyhunterCanvas canvas)
 {
     InitializeComponent();
     SetupContoursControl( map,  canvas);
 }
Ejemplo n.º 5
0
 public AnnotationControl(Map m, SkyhunterCanvas sc)
 {
     InitializeComponent();
     SetupAnnotationControl( m,  sc);
 }
Ejemplo n.º 6
0
 public SeismicLineDrawer(Map map, SkyhunterCanvas canv, IAIntAirAct intAirAct)
 {
     InitializeComponent();
     SetupSeismicLineDrawer( map,  canv, intAirAct);
 }
Ejemplo n.º 7
0
        public void SetupSeismicLineDrawer(Map map, SkyhunterCanvas canv, IAIntAirAct intAirAct)
        {
            this.intAirAct = intAirAct;

            intAirAct.Route(IARoute.Get("/seismicimages/slice.jpg"), delegate(IARequest request, IAResponse response)
            {
                response.ContentType = "image/jpeg";
                response.Body = File.ReadAllBytes(Environment.CurrentDirectory + "/new.jpg");
            });

            ShowsActivationEffects = false;

            // to turn off drop shadow
            this.ApplyTemplate();
            Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome ssc;
            ssc = this.Template.FindName("shadow", this) as Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome;
            ssc.Visibility = Visibility.Hidden;

            MyCanvas = canv;
            MyMap = map;

            MyGraphicsLayer = new GraphicsLayer();
            MyGraphicsLayer.ID = "SeismicLineMarkers";
            map.Layers.Add(MyGraphicsLayer);
            GenerateNewSymbols();
        }
Ejemplo n.º 8
0
        public void SetupMenu(SkyhunterCanvas canvas, MenuLocation location, MenuButtonControl externalButton)
        {
            MyCanvas = canvas;
            MyLocation = location;
            ExternalButton = externalButton;

            ExternalButton.MyButton.Click += SurfaceButton_Click;

            //disable shadow
            ApplyTemplate();
            this.Background = new SolidColorBrush(Colors.Transparent);
            this.BorderBrush = new SolidColorBrush(Colors.Transparent);
            ShowsActivationEffects = false;
            Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome ssc;
            ssc = (Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome)this.Template.FindName("shadow", this);
            ssc.Visibility = Visibility.Hidden;

            switch (location)
            {
                case MenuLocation.Top:
                    this.Orientation = 180.0;
                    this.Center = new Point(canvas.CanvasWidth / 2, this.ActualHeight / 2);
                    break;
                case MenuLocation.Right:
                    this.Orientation = 270.0;
                    this.Center = new Point(canvas.CanvasWidth - this.ActualHeight / 2, canvas.CanvasHeight / 2);
                    break;
                case MenuLocation.Bottom:
                    this.Orientation = 0.0;
                    this.Center = new Point(canvas.CanvasWidth / 2, canvas.CanvasHeight - this.ActualHeight / 2);
                    break;
                case MenuLocation.Left:
                    this.Orientation = 90.0;
                    this.Center = new Point(this.ActualHeight / 2, canvas.CanvasHeight / 2);
                    break;
            }

            IsOpen = false;
        }
Ejemplo n.º 9
0
 public Menu(SkyhunterCanvas canvas, MenuLocation location, MenuButtonControl externalButton)
 {
     InitializeComponent();
     Loaded += OnLoaded;
     SetupMenu(canvas, location, externalButton);
 }