コード例 #1
0
 /// <summary>
 /// Clear the AerialWithLabels imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void LabelsCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.AerialWithLabels)
     {
         Imagery = ImagerySet.Unknown;
     }
 }
コード例 #2
0
 /// <summary>
 /// Clear the Road imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void RoadCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.Road)
     {
         Imagery = ImagerySet.Unknown;
     }
 }
コード例 #3
0
 /// <summary>
 /// Clear the Aerial imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void AerialCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.Aerial)
     {
         Imagery = ImagerySet.Unknown;
     }
 }
コード例 #4
0
        // Constructor
        public TripService(NotificationFlagType notificationTypes)
        {
            NotifyData = new NotificationData();

            NotificationFlag = notificationTypes;

            IsRawBound = false;

            Imagery = ImagerySet.Unknown;

            UpdateStatus("Starting...");

            HttpChannel = EstablishChannel();
        }
コード例 #5
0
        /// <summary>
        /// Contact the Tile web service to subscribe to a notification
        /// </summary>
        /// <param name="baseAddress">The base Uri of the service</param>
        /// <param name="stopId">The stop to notify on arrival</param>
        /// <param name="tripId">The trip to track</param>
        /// <param name="notify">The number of minutes before arrival to trigger a notification</param>
        /// <param name="imagery">The imagery set to use</param>
        /// <param name="subscription">The Uri for the channel from the notification service</param>
        private void SubscribeToTripService(Uri baseAddress, string stopId, string tripId, int notify, ImagerySet imagery, Uri subscription)
        {
            //
            // The Transit Tile Service REST request format (Note: "unregister" also exists with same format)
            //

            var UriFormat = "stop/{0}/register?trip={1}&notify={2}&type={3}&imageryset={4}&uri={5}";

            var CallUri = String.Format(UriFormat, stopId, tripId, notify.ToString(), NotificationFlag.ToString().Replace(" ", ""),
                imagery, subscription.AbsoluteUri);

            var Client = new WebClient();
            Client.DownloadStringCompleted += (s, e) =>
            {
                if (e.Error == null)
                {
                    UpdateStatus("Registration succeeded");
                }
                else
                {
                    UpdateStatus("Registration failed: " + e.Error.Message);
                    throw e.Error;
                }
            };

            Client.DownloadStringAsync(new Uri(baseAddress, CallUri));
        }
コード例 #6
0
 /// <summary>
 /// Clear the Road imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void RoadCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.Road)
         Imagery = ImagerySet.Unknown;
 }
コード例 #7
0
 /// <summary>
 /// Set the Road imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void RoadCheckBox_Checked()
 {
     Imagery = ImagerySet.Road;
 }
コード例 #8
0
 /// <summary>
 /// Clear the AerialWithLabels imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void LabelsCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.AerialWithLabels)
         Imagery = ImagerySet.Unknown;
 }
コード例 #9
0
 /// <summary>
 /// Set the AerialWithLabels imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void LabelsCheckBox_Checked()
 {
     Imagery = ImagerySet.AerialWithLabels;
 }
コード例 #10
0
 /// <summary>
 /// Clear the Aerial imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 public void AerialCheckBox_Unchecked()
 {
     if (Imagery == ImagerySet.Aerial)
         Imagery = ImagerySet.Unknown;
 }
コード例 #11
0
 /// <summary>
 /// Set the Aerial imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void AerialCheckBox_Checked()
 {
     Imagery = ImagerySet.Aerial;
 }
コード例 #12
0
        // Constructor
        public TripService(NotificationFlagType notificationTypes)
        {
            NotifyData = new NotificationData();

            NotificationFlag = notificationTypes;

            IsRawBound = false;

            Imagery = ImagerySet.Unknown;

            UpdateStatus("Starting...");

            HttpChannel = EstablishChannel();
        }
コード例 #13
0
        /// <summary>
        /// Contact the Tile web service to subscribe to a notification
        /// </summary>
        /// <param name="baseAddress">The base Uri of the service</param>
        /// <param name="stopId">The stop to notify on arrival</param>
        /// <param name="tripId">The trip to track</param>
        /// <param name="notify">The number of minutes before arrival to trigger a notification</param>
        /// <param name="imagery">The imagery set to use</param>
        /// <param name="subscription">The Uri for the channel from the notification service</param>
        private void SubscribeToTripService(Uri baseAddress, string stopId, string tripId, int notify, ImagerySet imagery, Uri subscription)
        {
            //
            // The Transit Tile Service REST request format (Note: "unregister" also exists with same format)
            //

            var UriFormat = "stop/{0}/register?trip={1}&notify={2}&type={3}&imageryset={4}&uri={5}";

            var CallUri = String.Format(UriFormat, stopId, tripId, notify.ToString(), NotificationFlag.ToString().Replace(" ", ""),
                                        imagery, subscription.AbsoluteUri);

            var Client = new WebClient();

            Client.DownloadStringCompleted += (s, e) =>
            {
                if (e.Error == null)
                {
                    UpdateStatus("Registration succeeded");
                }
                else
                {
                    UpdateStatus("Registration failed: " + e.Error.Message);
                    throw e.Error;
                }
            };

            Client.DownloadStringAsync(new Uri(baseAddress, CallUri));
        }
コード例 #14
0
 /// <summary>
 /// Set the Road imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void RoadCheckBox_Checked()
 {
     Imagery = ImagerySet.Road;
 }
コード例 #15
0
 /// <summary>
 /// Set the AerialWithLabels imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void LabelsCheckBox_Checked()
 {
     Imagery = ImagerySet.AerialWithLabels;
 }
コード例 #16
0
 /// <summary>
 /// Set the Aerial imagery set
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 /// <remarks>Only one imagery checkbox can be set</remarks>
 public void AerialCheckBox_Checked()
 {
     Imagery = ImagerySet.Aerial;
 }