Example #1
0
 public void LocationTest()
 {
     CornerMenu.CornerMenuLocation expected = CornerMenu.CornerMenuLocation.BottomRight;
     CornerMenu target = new CornerMenu(expected);
     CornerMenu.CornerMenuLocation actual;
     target.Location = expected;
     actual = target.Location;
     Assert.AreEqual(expected, actual);
 }
Example #2
0
 /// <summary>
 /// Show the Map Layers Manager Panel
 /// </summary>
 /// <param name="location">Location of the originating corner menu</param>
 public void ShowMapLayersManagerPanel(CornerMenu.CornerMenuLocation location)
 {
     switch (location)
     {
         case CornerMenu.CornerMenuLocation.TopLeft:
             BackgroundMapLayer.Instance.ShowMapLayersManagerPanel(new Point(350, 700), 90.0);
             break;
         case CornerMenu.CornerMenuLocation.TopRight:
             BackgroundMapLayer.Instance.ShowMapLayersManagerPanel(new Point(350, 700), 90.0);
             break;
         case CornerMenu.CornerMenuLocation.BottomLeft:
             BackgroundMapLayer.Instance.ShowMapLayersManagerPanel(new Point(350, 700), 270.0);
             break;
         case CornerMenu.CornerMenuLocation.BottomRight:
             BackgroundMapLayer.Instance.ShowMapLayersManagerPanel(new Point(350, 700), 270.0);
             break;
     }
 }
Example #3
0
 /// <summary>
 /// This brings out a BookmarkListFrame with the same orientation
 /// of the touch finger.  The location of the list is close to the
 /// activating corner function menu.       
 /// </summary>
 /// <param name="orientation">Orientation of the List box</param>
 /// <param name="location">location of the originating corner menu</param>
 public void showListBox(double orientation, CornerMenu.CornerMenuLocation location)
 {
     switch (location)
     {
         case CornerMenu.CornerMenuLocation.TopLeft:
             BackgroundMapLayer.Instance.AddBookmarkListFrame(new Point(200, 850), orientation);
             break;
         case CornerMenu.CornerMenuLocation.TopRight:
             BackgroundMapLayer.Instance.AddBookmarkListFrame(new Point(200, 200), orientation);
             break;
         case CornerMenu.CornerMenuLocation.BottomLeft:
             BackgroundMapLayer.Instance.AddBookmarkListFrame(new Point(550, 850), orientation);
             break;
         case CornerMenu.CornerMenuLocation.BottomRight:
             BackgroundMapLayer.Instance.AddBookmarkListFrame(new Point(550, 200), orientation);
             break;
     }
 }
Example #4
0
        /// <summary>
        /// Show the Exit dialog
        /// </summary>
        /// <param name="orientation">Orientation of the exit dialog</param>
        /// <param name="location">location of the originating corner menu</param>
        public void showExitMenu(double orientation, CornerMenu.CornerMenuLocation location)
        {
            // FIX ME: fix the orientation of the exit confirmation dialog

            switch (location)
            {
                case CornerMenu.CornerMenuLocation.TopLeft:
                    //ExitDialogUpperLeft.RenderTransform = new RotateTransform(orientation);
                    ExitDialogUpperLeft.Visibility = Visibility.Visible;
                    break;
                case CornerMenu.CornerMenuLocation.TopRight:
                    //ExitDialogUpperRight.RenderTransform = new RotateTransform(orientation);
                    ExitDialogUpperRight.Visibility = Visibility.Visible;
                    break;
                case CornerMenu.CornerMenuLocation.BottomLeft:
                    //ExitDialogBottomLeft.RenderTransform = new RotateTransform(orientation);
                    ExitDialogBottomLeft.Visibility = Visibility.Visible;
                    break;
                case CornerMenu.CornerMenuLocation.BottomRight:
                    //ExitDialogBottomRight.RenderTransform = new RotateTransform(orientation);
                    ExitDialogBottomRight.Visibility = Visibility.Visible;
                    break;
            }
        }
Example #5
0
        /// <summary>
        /// Creates the Corner menus according to the properties set in the manager
        /// </summary>
        public void CreateCornerMenus()
        {
            if (MenuType == CornerMenuType.NoCornerMenus) return;

            var offset = -150;

            // Bottom Left Corner menu
            FunctionMenuBottomLeft = new CornerMenu(CornerMenu.CornerMenuLocation.BottomLeft);
            InterfaceLayoutRoot.Children.Add(FunctionMenuBottomLeft);
            Canvas.SetLeft(FunctionMenuBottomLeft, offset);
            Canvas.SetBottom(FunctionMenuBottomLeft, offset);
            Canvas.SetZIndex(FunctionMenuBottomLeft, 10);

            FunctionMenuBottomLeft.LayoutTransform = new RotateTransform(90);

            // Upper Right Corner menu
            FunctionMenuUpperRight = new CornerMenu(CornerMenu.CornerMenuLocation.TopRight);
            InterfaceLayoutRoot.Children.Add(FunctionMenuUpperRight);
            Canvas.SetTop(FunctionMenuUpperRight, offset);
            Canvas.SetRight(FunctionMenuUpperRight, offset);
            Canvas.SetZIndex(FunctionMenuUpperRight, 10);

            FunctionMenuUpperRight.LayoutTransform = new RotateTransform(-90);

            FunctionMenuUpperLeft = null;
            FunctionMenuBottomRight = null;
            if (MenuType == CornerMenuType.FourCornerMenus)
            {
                // Upper Left Corner menu
                FunctionMenuUpperLeft = new CornerMenu(CornerMenu.CornerMenuLocation.TopLeft);
                InterfaceLayoutRoot.Children.Add(FunctionMenuUpperLeft);
                Canvas.SetTop(FunctionMenuUpperLeft, offset);
                Canvas.SetLeft(FunctionMenuUpperLeft, offset);
                Canvas.SetZIndex(FunctionMenuUpperLeft, 10);

                FunctionMenuUpperLeft.LayoutTransform = new RotateTransform(180);

                // Bottom Right Corner menu
                FunctionMenuBottomRight = new CornerMenu(CornerMenu.CornerMenuLocation.BottomRight);
                InterfaceLayoutRoot.Children.Add(FunctionMenuBottomRight);
                Canvas.SetBottom(FunctionMenuBottomRight, offset);
                Canvas.SetRight(FunctionMenuBottomRight, offset);
                Canvas.SetZIndex(FunctionMenuBottomRight, 10);
            }
        }
Example #6
0
 public void CornerMenuConstructorTest()
 {
     CornerMenu.CornerMenuLocation menuLocation = new CornerMenu.CornerMenuLocation(); // TODO: Initialize to an appropriate value
     CornerMenu target = new CornerMenu(menuLocation);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }