Example #1
0
        private static void CreateRadarWindow()
        {
            if (_radarWindow == null)
            {
                Logger.Debug("Loading MapUI");

                _radarWindow = new MapWindow();

                DataModel.PropertyChanged += (sender, args) =>
                {
                    if (args.PropertyName == "IsRadarWindowVisible")
                    {
                        if (DataModel.IsRadarWindowVisible)
                        {
                            _radarWindow.Show();
                        }
                        else
                        {
                            _radarWindow.Hide();
                        }
                    }
                };

                _radarWindow.Closed += (a, b) =>
                {
                    DataModel.IsRadarWindowVisible = false;
                    _radarWindow = null;
                };
            }
        }
        public void OnGeoLocationUpdate(string latitude, string longitude)
        {
            currentCountdownUntilThrowingError.Abort();
            removeSelfFromAllEventHandlerList();
            Stations nearestStations = transport.GetStationsByLocation(latitude, longitude);

            mapWindow = new MapWindow(nearestStations.StationList);
            mapWindow.Show();
        }
        private void OnOpenMap()
        {
            var window = new MapWindow(_model.BleSystemConfiguration);

            _eventMapper.TransmitterSignalDiscovered +=
                s => window.HandleDiscoveryEvent(s.BleReceiver, s.Transmitter.MacAddress, s.Distance);
            _eventMapper.TransmitterPositionDiscovered += window.HandleTransmitterLocationEvent;
            window.Show();
        }
Example #4
0
        public void CalculateRoute()
        {
            if (ValidateLocations())
            {
                string from = SelectedGebruiker.Postcode + ", " + SelectedGebruiker.Huisnummer;
                string to   = this.PostCode + ", " + this.huisnummer;

                Window window = new MapWindow(from, to, SelectedGebruiker.Naam);
                window.Owner = Application.Current.MainWindow;
                window.Show();
            }
        }
Example #5
0
        // Creates a window that encloses a map console
        // of a specified height and width
        // and displays a centered window title
        // make sure it is added as a child of the UIManager
        // so it is updated and drawn
        public void CreateMapWindow(int width, int height, string title)
        {
            MapWindow = new MapWindow(width, height, title);

            // The MapWindow becomes a child console of the UIManager
            Children.Add(MapWindow);

            // Add the map console to it
            MapWindow.CreateMapConsole();

            // Without this, the window will never be visible on screen
            MapWindow.Show();
        }
Example #6
0
        public MainWindow()
        {
            InitializeComponent();

            var mapWindow = new MapWindow
            {
                DataContext = DataContext
            };

            mapWindow.Show();

            Closed += (s, e) => mapWindow.Close();
        }
Example #7
0
    static void Create()
    {
        // Get existing open window or if none, make a new one:
        MapWindow window = (MapWindow)EditorWindow.GetWindow(typeof(MapWindow));

        window.place = FindObjectOfType <SearchPlace>();
        if (window.place == null)
        {
            SearchPlace search = new GameObject("Searcher").AddComponent <SearchPlace>();
            window.place = search;
        }


        window.Init();
        window.Show();
    }
Example #8
0
 protected override bool DoShow(MenuScreen <PauseMenu> previous)
 {
     if (base.Owner._mapWindow.CanShow(base.Owner.currEnt))
     {
         MapWindow pooledWindow = OverlayWindow.GetPooledWindow <MapWindow>(base.Owner._mapWindow);
         pooledWindow.Show(base.Owner.currEnt, null, new EntityOverlayWindow.OnDoneFunc(this.ClickedBack), null);
         GuiSelectionHandler component = base.Owner.GetComponent <GuiSelectionHandler>();
         if (component != null)
         {
             component.enabled = false;
         }
         base.Owner.mapWindow = pooledWindow;
     }
     else
     {
         Debug.LogWarning("No map for " + Utility.GetCurrentSceneName());
         base.SwitchToBack();
     }
     return(false);
 }
Example #9
0
        /// <summary>
        /// Evento ao clicar no botão de exibição em mapa
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnShowInMap_Click(object sender, RoutedEventArgs e)
        {
            //Verificando se ha um cliente selecionado para exibição
            if (dgUsuarios.SelectedItems.Count > 0)
            {
                //Verificando conexao com internet
                if (!isNetWorkConnection())
                {
                    MessageBox.Show(
                        "Você precisa estar conectado a internet para usar esse recurso!",
                        "Erro de Conexão!",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error
                        );
                    return;
                }

                //Recuperando dados do cliente selecionado
                Employe source  = dgUsuarios.SelectedItem as Employe;
                Employe employe = dao.GetEmployeData(source.id);

                //Construindo string de endereço employe
                string location = $"{employe.adress.street}, {employe.adress.number} {employe.adress.neighborhood}, {employe.adress.city}-{employe.adress.UF}";

                //Enviando dados e iniciando exibição em mapa
                MapWindow window = new MapWindow(location);
                window.Show();
            }
            else
            {
                MessageBox.Show(
                    "Selecione um registro para visualizar no mapa!",
                    "Aviso!",
                    MessageBoxButton.OK,
                    MessageBoxImage.Warning
                    );
            }
        }
Example #10
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MapWindow window = new MapWindow();

            window.Show();
        }
Example #11
0
        private static void CreateRadarWindow()
        {
            if (_radarWindow == null)
            {
                Logger.Debug("Loading MapUI");

                _radarWindow = new MapWindow();

                DataModel.PropertyChanged += (sender, args) =>
                {
                    if (args.PropertyName == "IsRadarWindowVisible")
                    {
                        if (DataModel.IsRadarWindowVisible)
                        {
                            _radarWindow.Show();
                        }
                        else
                        {
                            _radarWindow.Hide();
                        }
                    }
                };

                _radarWindow.Closed += (a, b) =>
                {
                    DataModel.IsRadarWindowVisible = false;
                    _radarWindow = null;
                };

            }
        }
        private void mapButton_Click(object sender, RoutedEventArgs e)
        {
            if (mapWindow == null)
            {
                mapButton.IsEnabled = false;

                mapWindow = new MapWindow();
                mapWindow.Closing += new System.ComponentModel.CancelEventHandler(mapWindow_Closing);
                mapWindow.Show();

                // we do it after "Show" to ensure that we override default mapper and that the Draw is enabled:
                mapWindow.mapperViewControl1.CurrentMapper = mapperVicinity;
                mapWindow.mapperViewControl1.CurrentRoutePlanner = routePlanner;
            }
        }