예제 #1
0
 protected virtual void OnLocationChanged(LocationChangedEventArgs e)
 {
     EventHandler<LocationChangedEventArgs> myEvent = ExternalDataEvent;
     if (myEvent != null)
     {
         myEvent(this, e);
     }
 }
예제 #2
0
파일: NavItemBase.cs 프로젝트: filar7/Ether
        private void OnLocationChanged(object sender, LocationChangedEventArgs args)
        {
            var shouldBeActiveNow = _absoluteUrls.Any(u => EqualsHrefExactlyOrIfTrailingSlashAdded(args.Location, u));

            if (shouldBeActiveNow != _isActive)
            {
                _isActive = shouldBeActiveNow;
                StateHasChanged();
            }
        }
예제 #3
0
        private async void CancelDialogs(object sender, LocationChangedEventArgs e)
        {
            foreach (var DialogReference in Dialogs.ToList())
            {
                DialogReference.Dismiss(DialogResult.Cancel());
            }

            Dialogs.Clear();
            await InvokeAsync(StateHasChanged);
        }
 private void OnLocationChanged(object sender, LocationChangedEventArgs e)
 {
     if (!_isTimeTraveling)
     {
         _dispatcher.Dispatch(new NavigationAction
         {
             Url = e.Location
         });
     }
 }
예제 #5
0
 private async void OnLocationChanged(object sender, LocationChangedEventArgs args)
 {
     if (!String.IsNullOrEmpty(_googleAnalyticsId))
     {
         await Task.Delay(1).ContinueWith(async t =>
         {
             await jsRuntime.InvokeVoidAsync("analyticsMethods.loadGoogleAnalytics", new Uri(args.Location).PathAndQuery, _googleAnalyticsId);
         });
     }
 }
        private async void OnLocationChanged(object sender, LocationChangedEventArgs args)
        {
            var relativeUri = new Uri(args.Location).PathAndQuery;

            await Task.Delay(1).ContinueWith(async t =>
            {
                await JSRuntime.InvokeAsync <string>(GoogleAnalyticsInterop.Navigate,
                                                     TrackingId, relativeUri);
            });
        }
예제 #7
0
        private async void CancelModals(object sender, LocationChangedEventArgs e)
        {
            foreach (var modalReference in Modals)
            {
                modalReference.Dismiss(ModalResult.Cancel());
            }

            Modals.Clear();
            await InvokeAsync(StateHasChanged);
        }
예제 #8
0
        async void OnLocationChanged(object sender, LocationChangedEventArgs e)
        {
            var data = await _tcs.Task;

            for (int i = 0; i < data.Count; i++)
            {
                data[i].IsDeleted = false;
            }
            _offlineData.Clear();
        }
예제 #9
0
 private void locationChanged(object sender, LocationChangedEventArgs e)
 {
     config.data.setOptionalColumnValue("Locator", DXpConfig.qth(e.coords));
     config.write();
     slCoords.Text = e.coords.ToString();
     slLoc.Text    = config.data.optionalColumns["Locator"].value;
     if (config.data.optionalColumns["RAFA"].value != null)
     {
         slLoc.Text += " RAFA " + config.data.optionalColumns["RAFA"].value;
     }
 }
 ///<summary>
 /// Updates UI with location data
 /// </summary>
 public void HandleLocationChanged(object sender, LocationChangedEventArgs e)
 {
     if (e != null)
     {
         location = e.Location;
         ISharedPreferences       prefs  = PreferenceManager.GetDefaultSharedPreferences(this);
         ISharedPreferencesEditor editor = prefs.Edit();
         editor.PutFloat("Altitude", Convert.ToSingle(location.Altitude));
         editor.PutFloat("Latitude", Convert.ToSingle(location.Latitude));
     }
 }
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender || (locationChangedEventArgsToReportOnAfterRenderAsync is not null))
            {
                var argsToReport = locationChangedEventArgsToReportOnAfterRenderAsync;
                locationChangedEventArgsToReportOnAfterRenderAsync = null;
                await HxGoogleTagManager.PushPageViewAsync(argsToReport);
            }

            await base.OnAfterRenderAsync(firstRender);
        }
        private async void OnLocationChanged(object sender, LocationChangedEventArgs e)
        {
            if (_isDisposed)
            {
                return;
            }

            var query = GetQuery();

            await SearchAsync(query);
        }
예제 #13
0
 private void NavigationManager_LocationChanged(object sender, LocationChangedEventArgs e)
 {
     if (Configuration.ClearAfterNavigation)
     {
         Clear();
     }
     else
     {
         ShownSnackbars.Where(s => s.State.Options.CloseAfterNavigation).ToList().ForEach(s => Remove(s));
     }
 }
예제 #14
0
        private void LocationChanged(object aSender, LocationChangedEventArgs aLocationChangedEventArgs)
        {
            string absoluteUri = NavigationManager.ToAbsoluteUri(aLocationChangedEventArgs.Location).ToString();

            if (RouteState.Route != absoluteUri)
            {
                Mediator.Send(new RouteState.ChangeRouteAction {
                    NewRoute = absoluteUri
                });
            }
        }
        void LocationChanged(object sender, LocationChangedEventArgs e)
        {
            var newRelativePath = navigationManager.ToBaseRelativePath(navigationManager.Uri).ToLower();

            if ((currentRelativePath.StartsWith("en", StringComparison.OrdinalIgnoreCase) && newRelativePath.StartsWith("fr", StringComparison.OrdinalIgnoreCase)) ||
                (currentRelativePath.StartsWith("fr", StringComparison.OrdinalIgnoreCase) && newRelativePath.StartsWith("en", StringComparison.OrdinalIgnoreCase)))
            {
                navigationManager.NavigateTo(navigationManager.Uri, true);
                return;
            }
        }
예제 #16
0
        private void OnLocationChanged(object sender, LocationChangedEventArgs e)
        {
            var href   = UriHelper.BaseUri + To;
            var active = e?.Location.AreTheSameUrls(href) ?? false;

            if (this.Active != active)
            {
                this.Active = active;
            }
            StateHasChanged();
        }
예제 #17
0
        private void OnLocationChanged(object sender, LocationChangedEventArgs e)
        {
            IsCollapseShown = false;

            IsFluid = NavigationManager.Uri == "";
            if (NavigationManager.Uri.Contains("/editor/", StringComparison.InvariantCultureIgnoreCase))
            {
                IsFluid = false;
            }
            InvokeAsync(StateHasChanged);
        }
예제 #18
0
 /// <summary>
 /// Locations the changed event handler.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.AgencyModule.LocationChangedEventArgs"/> instance containing the event data.</param>
 public void LocationChangedEventHandler(LocationChangedEventArgs obj)
 {
     Deployment.Current.Dispatcher.BeginInvoke(
         () =>
     {
         var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();
         requestDispatcher.Add(new GetDtoRequest <LocationSummaryDto> {
             Key = obj.LocationKey
         });
         requestDispatcher.ProcessRequests(HandleGetLocationSummaryDtoCompleted, HandleGetLocationSummaryDtoException);
     });
 }
예제 #19
0
    private async void Navigation_LocationChanged(object?sender, LocationChangedEventArgs e)
    {
        if (OnAuthorizing != null)
        {
            var auth = await OnAuthorizing(e.Location);

            if (!auth)
            {
                Navigation.NavigateTo(NotAuthorizeUrl, true);
            }
        }
    }
예제 #20
0
 /// <inheritdoc/>
 async Task IHxGoogleTagManager.PushPageViewAsync(LocationChangedEventArgs args)
 {
     if (args is null)
     {
         // App firstRender
         await PushPageViewAsync();
     }
     else
     {
         await PushPageViewCoreAsync(args.Location, new Dictionary <string, string>() { { "isNavigationIntercepted", args.IsNavigationIntercepted.ToString() } });
     }
 }
예제 #21
0
        void gps_LocationChanged(object sender, LocationChangedEventArgs args)
        {
            position = args.Position;

            // call the UpdateData method via the updateDataHandler so that we
            // update the UI on the UI thread
            try
            {
                Invoke(UpdateGpsDataHandler);
            }
            catch { }
        }
예제 #22
0
        private void OnLocationChanged(object sender, LocationChangedEventArgs args)
        {
            // We could just re-render always, but for this component we know the
            // only relevant state change is to the _isActive property.
            var shouldBeActiveNow = ShouldMatch(args.Location);

            if (shouldBeActiveNow != isActive)
            {
                isActive = shouldBeActiveNow;
                renderHandle.Render(Render);
            }
        }
예제 #23
0
        private async void CancelModals(object sender, LocationChangedEventArgs e)
        {
            foreach (var modalReference in Modals.ToList())
            {
                await JSRuntime.InvokeVoidAsync("BlazoredModal.deactivateFocusTrap", modalReference.Id, modalReference.ModalInstanceRef.Options.DisableBodyReposition);

                modalReference.Dismiss(ModalResult.Cancel());
            }

            Modals.Clear();
            await InvokeAsync(StateHasChanged);
        }
        private void HandleLocationChanged(object sender, LocationChangedEventArgs e)
        {
            _logger.LogDebug($"{nameof(PermaLinkWatcherService)} - {nameof(HandleLocationChanged)}: navigation happened new URL: {e.Location}");
            var match = _poundRegex.Match(e.Location);

            if (match.Success && match.Groups.Count == 2)
            {
                var perma = match.Groups[1].Value;
                _logger.LogDebug($"{nameof(PermaLinkWatcherService)} - {nameof(HandleLocationChanged)}: PermaLink found: {perma}");
                _scrollHandler.ScrollToElementByNameAsync(perma);
            }
        }
예제 #25
0
        private async void OnLocationChanged(object sender, LocationChangedEventArgs args)
        {
            try
            {
                var relativeUri = new Uri(args.Location).PathAndQuery;

                await JSRuntime.InvokeAsync <string>(GoogleAnalyticsInterop.Navigate,
                                                     TrackingId, relativeUri);
            }
            catch (Exception)
            {
            }
        }
예제 #26
0
 private void OnLocationChanged(object?sender, LocationChangedEventArgs e)
 {
     if (!_canHandleActive || _childSetActive)
     {
         return;
     }
     IsActive = false;
     if (NavigationManager.Uri == NavigationManager.BaseUri + Url?.TrimStart('/'))
     {
         IsActive = true;
     }
     StateHasChanged();
 }
예제 #27
0
파일: NavLink.cs 프로젝트: pa-at/aspnetcore
    private void OnLocationChanged(object?sender, LocationChangedEventArgs args)
    {
        // We could just re-render always, but for this component we know the
        // only relevant state change is to the _isActive property.
        var shouldBeActiveNow = ShouldMatch(args.Location);

        if (shouldBeActiveNow != _isActive)
        {
            _isActive = shouldBeActiveNow;
            UpdateCssClass();
            StateHasChanged();
        }
    }
예제 #28
0
        public void OnLocationChanged(object sender, LocationChangedEventArgs e)
        {
            var active = e?.Location.MatchActiveRoute(UriHelper.BaseUri + Href) ?? false;

            if (active != IsActive)
            {
                if (DropDown != null)
                {
                    DropDown.Active = active;
                }
                IsActive = active;
            }
        }
예제 #29
0
 private void Listener_LocationChanged(object sender, LocationChangedEventArgs e)
 {
     if (this.LoationGetCallback != null)
     {
         var loc = e.Location;
         this.LoationGetCallback.Invoke(this, new LocationGetCallbackEventArgs()
         {
             Lat = loc.Latitude,
             Lnt = loc.Longitude
         });
     }
     this.LM.RemoveUpdates((LocationListener)sender);
 }
예제 #30
0
        /// <summary>
        /// Loading data if a page path has been changed for the same (generic/template) page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        protected virtual async Task OnLocationChanged(object sender, LocationChangedEventArgs args)
        {
            if (CommonParams.Router.IsPathChangedOnCurrentPage())
            {
                needStub = true;
                StateHasChanged();

                await DataRequest();

                needStub = false;
                StateHasChanged();
            }
        }
예제 #31
0
        private void ViewModelNode_LocationChanged(object sender, LocationChangedEventArgs e)
        {
            var node = sender as Node;

            if (node != null)
            {
                var chain = new TransactionFramework.TransactionChain();

                CommitLocation(node, e.Location, ref chain);

                MapManager.ExecuteTransaction(chain);
            }
        }
예제 #32
0
        ///<summary>
        /// Updates UI with location data
        /// </summary>
        public void HandleLocationChanged(object sender, LocationChangedEventArgs e)
        {
            Android.Locations.Location location = e.Location;
            Log.Debug (logTag, "Foreground updating");

            // these events are on a background thread, need to update on the UI thread
            RunOnUiThread (() => {
                latText.Text = String.Format ("Latitude: {0}", location.Latitude);
                longText.Text = String.Format ("Longitude: {0}", location.Longitude);
                altText.Text = String.Format ("Altitude: {0}", location.Altitude);
                speedText.Text = String.Format ("Speed: {0}", location.Speed);
                accText.Text = String.Format ("Accuracy: {0}", location.Accuracy);
                bearText.Text = String.Format ("Bearing: {0}", location.Bearing);
            });
        }
예제 #33
0
        public void HandleLocationChanged(object sender, LocationChangedEventArgs e)
        {
            Android.Locations.Location location = e.Location;
            Toast.MakeText(this, "Location updated to " + location.Latitude + ", " + location.Longitude, ToastLength.Short).Show ();

            //check the proximity to the offender location
            if (testLongitudeValue != 0.0 && testLatitudeValue != 0.0)
            {
                Location offenderLocation = new Location(Provider);
                offenderLocation.Longitude = testLongitudeValue;
                offenderLocation.Latitude = testLatitudeValue;
                float meters = location.DistanceTo(offenderLocation);

                if (!insideRadius && (meters < 100)) {
                    insideRadius = true;
                    SendNotification ();
                }
                else if (insideRadius && (meters > 100))
                {
                    insideRadius = false;
                }
                //Toast.MakeText(this, "Distance = " + meters.ToString() + " meters", ToastLength.Short).Show ();
            }
        }
 void OnFreeFormPanelLocationChanged(object sender, LocationChangedEventArgs e)
 {
     Debug.Assert(sender is UIElement, "Sender should be of type UIElement");
     Connector movedConnector = sender as Connector;
     if (movedConnector != null)
     {
         //ViewState is undoable only when a user gesture moves a connector. If the FreeFormPanel routes a connector,
         //the change is not undoable.
         bool isUndoableViewState = false;
         ModelItem connectorModelItem = StateContainerEditor.GetConnectorModelItem(movedConnector);
         PointCollection existingViewState = this.ViewStateService.RetrieveViewState(connectorModelItem, ConnectorLocationViewStateKey) as PointCollection;
         if (existingViewState != null && existingViewState.Count > 0 && movedConnector.Points.Count > 0
             && existingViewState[0].Equals(movedConnector.Points[0]) && existingViewState[existingViewState.Count - 1].Equals(movedConnector.Points[movedConnector.Points.Count - 1]))
         {
             isUndoableViewState = true;
         }
         StoreConnectorLocationViewState(movedConnector, isUndoableViewState);
     }
     else
     {
         //This is called only when a shape without ViewState is auto-layout'd by the FreeFormPanel.
         WorkflowViewElement view = sender as WorkflowViewElement;
         if (view != null)
         {
             StoreShapeLocationViewState(view, e.NewLocation);
         }
     }
 }
예제 #35
0
        /// <summary>
        /// collects the marketdata from a external tool
        /// </summary>
        public Int32 ImportMarketData()
        {
            Int32 DataCount = 0;

            try
            {
                DataCount = ImportPrices();

                // something has changed -> fire event
                var EA = new LocationChangedEventArgs() { Changed       = enExternalDataEvents.DataCollected,
                                                          Amount        = DataCount};
                ExternalDataEvent.Raise(this, EA);

                return DataCount;
            }
            catch (Exception ex)
            {
                throw new Exception("Error while collecting market data from external tool", ex);
            }
        }
예제 #36
0
        /// <summary>
        /// confirms the last retrieved location
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Confirm()
        {
            DialogResult MBResult           = System.Windows.Forms.DialogResult.OK;
            String OldSystemString          = "";
            String OldLocationString        = "";
            enExternalDataEvents ChangedIs  = enExternalDataEvents.None;

            try
            {
                if(!Program.actualCondition.System.Equals(m_RetrievedSystem))
                {
                    MBResult = MessageBox.Show("The retrieved system do not correspond to the system from the logfile!\n" +
                                               "Confirm even so ?", "Unexpected system",
                                               MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
                }

                if(MBResult == System.Windows.Forms.DialogResult.OK)
                {
                    if(!Program.actualCondition.System.Equals(m_RetrievedSystem) ||
                       !Program.actualCondition.Location.Equals(m_RetrievedStation))
                    {
                        OldSystemString     = Program.actualCondition.System;
                        OldLocationString   = Program.actualCondition.Location;

                        ChangedIs = enExternalDataEvents.Landed;

                        if(!Program.actualCondition.System.Equals(m_RetrievedSystem))
                            ChangedIs |= enExternalDataEvents.System;

                        if(!Program.actualCondition.Location.Equals(m_RetrievedStation))
                            ChangedIs |= enExternalDataEvents.Location;
                    }

                    Program.actualCondition.System   = m_RetrievedSystem;
                    Program.actualCondition.Location = m_RetrievedStation;

                    if(ChangedIs != enExternalDataEvents.None)
                    {
                        // something has changed -> fire events
                        var LI = new LocationInfoEventArgs() { System        = Program.actualCondition.System,
                                                               Location      = Program.actualCondition.Location};
                        LocationInfo.Raise(this, LI);

                        var EA = new LocationChangedEventArgs() { System        = Program.actualCondition.System,
                                                                  Location      = Program.actualCondition.Location,
                                                                  OldSystem     = OldSystemString,
                                                                  OldLocation   = OldLocationString,
                                                                  Changed       = ChangedIs};
                        ExternalDataEvent.Raise(this, EA);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error while confirming retrieved location", ex);
            }
        }
예제 #37
0
		private void OnRefreshLocation(Object sender, LocationChangedEventArgs e)
		{
			if (engine != null)
				engine.RefreshLocation (locListener.Latitude, locListener.Longitude, locListener.Altitude, locListener.Accuracy);
		}
예제 #38
0
        /// <summary>
        /// processing the collected informations
        /// </summary>
        /// <param name="LoggedEvents"></param>
        private void processingLocationInfo(List<LogEvent> LoggedEvents)
        {
            //Boolean SystemHasChanged   = false;
            //Boolean LocationHasChanged = false;
            String OldSystemString;
            String OldLocationString;
            String foundSystemString;
            String foundLocationString;
            enLogEvents EventFlags = enLogEvents.None;
            Point3Dbl usePosition = null;

            try
            {
                if(LoggedEvents.Count() > 0)
                { 
                    // order by date
                    LoggedEvents = LoggedEvents.OrderBy(x => x.Time).ToList();

                    // scan sequence
                    foreach (LogEvent Event in LoggedEvents)
                    {
                        OldSystemString     = Program.actualCondition.System;
                        OldLocationString   = Program.actualCondition.Location;
                        EventFlags          = enLogEvents.None;
                        usePosition         = null;
                        foundSystemString   = "";
                        foundLocationString = "";

                        switch (Event.EventType)
                        {
                            case enLogEvents.Jump:
                                // after a jump we are no longer on a station

                                if(!m_InitialJumpFound)
                                { 
                                    // it's only the "startjump" of ED, not really a jump
                                    m_InitialJumpFound = true;
                                    Program.DBCon.setIniValue(DB_GROUPNAME, "InitialJumpFound", m_InitialJumpFound.ToString());
                                }
                                else
                                { 
                                    if(!String.IsNullOrEmpty(OldLocationString))
                                    { 
                                        EventFlags |= enLogEvents.Location;
                                        foundLocationString  = Event.Value;
                                    }
                                    
                                    EventFlags |= enLogEvents.Jump;

                                    Debug.Print("log - scanning : jump found");
                                }
                                break;

                            case enLogEvents.System:
                                // a new system is everytime valid, check if the system has changed
                                if((Event.Value != "") && (!Event.Value.Equals(OldSystemString, StringComparison.InvariantCultureIgnoreCase)))
                                { 
                                    EventFlags |= enLogEvents.System;
                                    foundSystemString  = Event.Value;
                                    usePosition = Event.Position;

                                    // after a jump we are no longer on a station
                                    if(!String.IsNullOrEmpty(OldLocationString))
                                    { 
                                        EventFlags |= enLogEvents.Location;
                                        foundLocationString  = "";
                                    }
                                    Debug.Print("log - scanning : system found : " + Event.Value);
                                }
                                break;

                            case enLogEvents.Location:
                                // a new station is everytime valid, check if the station has changed
                                if((Event.Value != "") && (!Event.Value.Equals(OldLocationString, StringComparison.InvariantCultureIgnoreCase)))
                                { 
                                    EventFlags |= enLogEvents.Location;
                                    foundLocationString  = Event.Value;
                                }
                                Debug.Print("log - scanning : location found : " + Event.Value);
                                break;

                        }    

                        if(EventFlags != enLogEvents.None)
                        {
                            // something has changed -> fire events

                            var LI = new LocationInfoEventArgs() { System        = foundSystemString,  
                                                                   Location      = foundLocationString,
                                                                   Position      = usePosition};
                            LocationInfo.Raise(this, LI);


                            var EA = new LocationChangedEventArgs() { System        = foundSystemString,  
                                                                      Location      = foundLocationString,
                                                                      OldSystem     = OldSystemString,  
                                                                      OldLocation   = OldLocationString,
                                                                      Changed       = EventFlags,
                                                                      Position      = usePosition, 
                                                                      TimeStamp     = Event.Time};
                            LocationChanged.Raise(this, EA);
                        }

                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error while processing location info", ex);
            }
        }
예제 #39
0
 private void OnLocationChanged(object sender, LocationChangedEventArgs args)
 {
     PositionChanged?.Invoke(this, new CustomPositionChangedEventArgs(args.Location.Speed));
 }
예제 #40
0
        private void navigator_LocationChanged(object sender, LocationChangedEventArgs<Pointer> e)
        {
            if (e.Source == this)
                return;

            Navigate(e.NewLocation);
        }
예제 #41
0
		private void LocationDatabase_LocationCountChanged(object sender, LocationChangedEventArgs e)
		{
			lblUpdateNumLocations.Text = mLocDb.Locations.Count.ToString("#,0");
		}
예제 #42
0
		private void LocationDatabase_FavoritesListChanged(object sender, LocationChangedEventArgs e)
		{
			if (mSettingsLoaded)
				UpdateFavoritesList();
		}
예제 #43
0
        internal void RaiseTestEvent()
        {

            try
            {
                String newSystem;

                if (Program.actualCondition.System == "Eravate")
                    newSystem = "Pai Huldr";
                else
                    newSystem = "Eravate";

                Program.actualCondition.System      = newSystem;
                Program.actualCondition.Location    = "";

                var LI = new LocationInfoEventArgs() { System        = Program.actualCondition.System,  
                                                       Location      = Program.actualCondition.Location};
                LocationInfo.Raise(this, LI);


                var EA = new LocationChangedEventArgs() { System        = Program.actualCondition.System,  
                                                          Location      = Program.actualCondition.Location,
                                                          OldSystem     = Program.actualCondition.System,  
                                                          OldLocation   = Program.actualCondition.Location,
                                                          Changed       = enLogEvents.Jump | enLogEvents.System};
                LocationChanged.Raise(this, EA);
            }
            catch (Exception ex)
            {
                throw new Exception("Error in RaiseEvent", ex);
            }
        }
 /// <summary>
 /// Called when the current location on the location service has changed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="Catel.MVVM.Services.LocationChangedEventArgs"/> instance containing the event data.</param>
 private void OnCurrentLocationChanged(object sender, LocationChangedEventArgs e)
 {
     // Only update if there is a new location, otherwise assume that the user wants to see the last position
     if (e.Location != null)
     {
         MapCenter = new GeoCoordinate(e.Location.Latitude, e.Location.Longitude, e.Location.Altitude);
     }
 }
예제 #45
0
 /// <summary>
 /// Filters the location changed events.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.AgencyModule.LocationChangedEventArgs"/> instance containing the event data.</param>
 /// <returns>A <see cref="System.Boolean"/></returns>
 public bool FilterLocationChangedEvents( LocationChangedEventArgs obj )
 {
     return _locationSummaryDto != null && _locationSummaryDto.Key == obj.LocationKey;
 }
예제 #46
0
 /// <summary>
 /// Locations the changed event handler.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.AgencyModule.LocationChangedEventArgs"/> instance containing the event data.</param>
 public void LocationChangedEventHandler( LocationChangedEventArgs obj )
 {
     Deployment.Current.Dispatcher.BeginInvoke (
         () =>
             {
                 var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher ();
                 requestDispatcher.Add ( new GetDtoRequest<LocationSummaryDto> { Key = obj.LocationKey } );
                 requestDispatcher.ProcessRequests ( HandleGetLocationSummaryDtoCompleted, HandleGetLocationSummaryDtoException );
             } );
 }
예제 #47
0
 void table_LocationChanged(object sender, LocationChangedEventArgs e)
 {
     if (AppConf.Ins.views_tbkey.ContainsKey(formConf.Editedtable))
     {
         EntityInfo entity = AppConf.Ins.views_tbkey[formConf.Editedtable];
         entity.X = Int32.Parse(e.Location.X.ToString());
         entity.Y = Int32.Parse(e.Location.Y.ToString());
     }
 }
예제 #48
0
		/// <summary>
		/// Is called, when an location changed event occures.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		private void OnRefreshLocation(Object sender, LocationChangedEventArgs e)
		{
			if (engine != null && (engine.Latitude != MainApp.Instance.GPS.Latitude || engine.Longitude != MainApp.Instance.GPS.Longitude || engine.Altitude != MainApp.Instance.GPS.Altitude || engine.Accuracy != MainApp.Instance.GPS.Accuracy))
				engine.RefreshLocation (MainApp.Instance.GPS.Latitude, MainApp.Instance.GPS.Longitude, MainApp.Instance.GPS.Altitude, MainApp.Instance.GPS.Accuracy);
		}
예제 #49
0
		public void OnLocationChanged(object sender, LocationChangedEventArgs e)
		{
			var textCoordText = FindViewById<TextView> (Resource.Id.textCoordText);
			textCoordText.Text = e.Location.HasAccuracy ? GetString (Resource.String.main_active_location) : GetString (Resource.String.main_last_known_location);

			var textCoords = FindViewById<TextView> (Resource.Id.textCoords);
			double latSign = e.Location.Latitude >= 0 ? 1 : -1;
			double latDegrees = Math.Floor (Math.Abs (e.Location.Latitude));
			double latMinutes = (Math.Abs (e.Location.Latitude) - latDegrees) * 60;
			double lonSign = e.Location.Longitude >= 0 ? 1 : -1;
			double lonDegrees = Math.Floor (Math.Abs (e.Location.Longitude));
			double lonMinutes = (Math.Abs (e.Location.Longitude) - lonDegrees) * 60;
			textCoords.Text = (latSign > 0 ? "N" : "S") + String.Format (" {0}° {1:00.000} ", latDegrees, latMinutes) + (lonSign > 0 ? "E" : "W") + String.Format (" {0}° {1:00.000}", lonDegrees, lonMinutes);

			var textAccuracy = FindViewById<TextView> (Resource.Id.textAccuracy);
			textAccuracy.Text = String.Format ("{0:0} m", e.Location.Accuracy);
		}
예제 #50
0
        /// <summary>
        /// collects the marketdata from a external tool
        /// </summary>
        public Boolean getMarketData(out String System, out String Station, out String Info, out String ErrorInfo, out Int32 DataCount)
        {
            Boolean DataOk = false;
            String Datafile;
            Boolean retValue = false;

            try
            {
                System      = "";
                Station     = "";
                Info        = "";
                ErrorInfo   = "";
                DataCount   = 0;
                DataOk      = CheckDataFile(out Datafile);

                if(!DataOk)
                    if(getData(enExternalDataFunction.getMarketdata, out System, out Station, out Info, out ErrorInfo))
                        DataOk = CheckDataFile(out Datafile);

                if(DataOk)
                {
                    DataCount = Program.Data.ImportPricesFromCSVFile(Datafile);

                    // something has changed -> fire event
                    var EA = new LocationChangedEventArgs() { System        = Program.actualCondition.System,
                                                              Location      = Program.actualCondition.Location,
                                                              OldSystem     = Program.actualCondition.System,
                                                              OldLocation   = Program.actualCondition.Location,
                                                              Changed       = enExternalDataEvents.DataCollected,
                                                              Amount        = DataCount};
                    ExternalDataEvent.Raise(this, EA);

                    retValue = true;
                }

                return retValue;
            }
            catch (Exception ex)
            {
                throw new Exception("Error while collecting market data from external tool", ex);
            }
        }
예제 #51
0
        void gps_LocationChanged(object sender, LocationChangedEventArgs args)
        {
            position = args.Position;

            // call the UpdateData method via the updateDataHandler so that we
            // update the UI on the UI thread
            try
            {
                Invoke(UpdateGpsDataHandler);
            }
            catch { }
        }
예제 #52
0
        private void navigator_LocationChanged(object sender, LocationChangedEventArgs<Pointer> e)
        {
            if (e.Source != this)
            {
                if (e.Type == LocationChangeType.Major || navHistory.IsEmpty)
                {
                    navHistory.Add(e.NewLocation);
                }
                else
                {
                    navHistory.Current = e.NewLocation;
                }
            }

            btnNavigateBackward.Enabled = navHistory.CanMove(-1);
            mnuViewNavigateBackward.Enabled = navHistory.CanMove(-1);

            btnNavigateForward.Enabled = navHistory.CanMove(1);
            mnuViewNavigateForward.Enabled = navHistory.CanMove(1);
        }
예제 #53
0
 void OnLocationChanged(Object sender, LocationChangedEventArgs e)
 {
     if (LocationChanged != null)
     {
         LocationChanged(sender, e);
     }
 }