Ejemplo n.º 1
0
        protected virtual void Dispose(Boolean disposing)
        {
            if (!m_disposed)
            {
                if (disposing)
                {
                    if (m_watcher != null)
                    {
                        m_watcher.Dispose();
                        m_watcher = null;
                    }
                }

                m_disposed = true;
            }
        }
Ejemplo n.º 2
0
        public GeoCoordinateWatcher(GeoPositionAccuracy desiredAccuracy)
        {
            m_desiredAccuracy = desiredAccuracy;

            m_watcher = new GeoCoordinateWatcherInternal(desiredAccuracy);

            if (SynchronizationContext.Current == null)
            {
                //
                // Create a SynchronizationContext if there isn't one on calling thread
                //
                m_synchronizationContext = new SynchronizationContext();
            }
            else
            {
                m_synchronizationContext = SynchronizationContext.Current;
            }

            m_watcher.StatusChanged     += new EventHandler <GeoPositionStatusChangedEventArgs>(OnInternalStatusChanged);
            m_watcher.PermissionChanged += new EventHandler <GeoPermissionChangedEventArgs>(OnInternalPermissionChanged);
            m_watcher.PositionChanged   += new EventHandler <GeoPositionChangedEventArgs <GeoCoordinate> >(OnInternalLocationChanged);
        }