Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="locationDialogFactory">The location dialog factory service.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 internal LocationDialog(
     ILocationDialogFactory locationDialogFactory,
     IFavoritesManager favoritesManager,
     LocationResourceManager resourceManager = null) : base(resourceManager)
 {
     SetField.NotNull(out this.locationDialogFactory, nameof(locationDialogFactory), locationDialogFactory);
     SetField.NotNull(out this.favoritesManager, nameof(favoritesManager), favoritesManager);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocationCardBuilder"/> class.
        /// </summary>
        /// <param name="apiKey">The geo spatial API key.</param>
        public LocationCardBuilder(string apiKey, LocationResourceManager resourceManager)
        {
            SetField.NotNull(out this.apiKey, nameof(apiKey), apiKey);
            SetField.NotNull(out this.resourceManager, nameof(resourceManager), resourceManager);

            if (!string.IsNullOrEmpty(this.apiKey) && this.apiKey.Length > 60)
            {
                useAzureMaps = false;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 /// <param name="channelId">The channel identifier.</param>
 /// <param name="prompt">The prompt posted to the user when dialog starts.</param>
 /// <param name="options">The location options used to customize the experience.</param>
 /// <param name="requiredFields">The location required fields.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 public LocationDialog(
     string apiKey,
     string channelId,
     string prompt,
     LocationOptions options = LocationOptions.None,
     LocationRequiredFields requiredFields   = LocationRequiredFields.None,
     LocationResourceManager resourceManager = null)
     : this(apiKey, channelId, prompt, new BingGeoSpatialService(), options, requiredFields, resourceManager)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 /// <param name="channelId">The channel identifier.</param>
 /// <param name="prompt">The prompt posted to the user when dialog starts.</param>
 /// <param name="options">The location options used to customize the experience.</param>
 /// <param name="requiredFields">The location required fields.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 public LocationDialog(
     string apiKey,
     string channelId,
     string prompt,
     LocationOptions options = LocationOptions.None,
     LocationRequiredFields requiredFields   = LocationRequiredFields.None,
     LocationResourceManager resourceManager = null)
     : this(new LocationDialogFactory(apiKey, channelId, prompt, new GoogleGeocodingService(apiKey), options, requiredFields, resourceManager), new FavoritesManager(), resourceManager)
 {
     this.options = options;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 /// <param name="channelId">The channel identifier.</param>
 /// <param name="prompt">The prompt posted to the user when dialog starts.</param>
 /// <param name="options">The location options used to customize the experience.</param>
 /// <param name="requiredFields">The location required fields.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 public LocationDialog(
     string apiKey,
     string channelId,
     string prompt,
     LocationOptions options = LocationOptions.None,
     LocationRequiredFields requiredFields   = LocationRequiredFields.None,
     LocationResourceManager resourceManager = null)
     : this(new LocationDialogFactory(apiKey, channelId, prompt, ((!string.IsNullOrEmpty(apiKey) && apiKey.Length <= 60) ? (IGeoSpatialService) new AzureMapsSpatialService(apiKey) : new BingGeoSpatialService(apiKey)), options, requiredFields, resourceManager), new FavoritesManager(), resourceManager)
 {
     this.options = options;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 /// <param name="channelId">The channel identifier.</param>
 /// <param name="prompt">The prompt posted to the user when dialog starts.</param>
 /// <param name="options">The location options used to customize the experience.</param>
 /// <param name="requiredFields">The location required fields.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 /// <param name="announceDirectionsToUser">Flag to announce directions for the captured address.</param>
 /// <param name="destination">The destination address to use for turn by turn directions</param>
 public LocationDialog(
     string apiKey,
     string channelId,
     string prompt,
     LocationOptions options = LocationOptions.None,
     LocationRequiredFields requiredFields   = LocationRequiredFields.None,
     LocationResourceManager resourceManager = null, bool announceDirectionsToUser = false, string destination = "")
     : this(apiKey, channelId, prompt, new BingGeoSpatialService(), options, requiredFields, resourceManager)
 {
     announceDirections = announceDirectionsToUser;
     addressDestination = destination;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationDialog"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 /// <param name="channelId">The channel identifier.</param>
 /// <param name="prompt">The prompt posted to the user when dialog starts.</param>
 /// <param name="geoSpatialService">The geo spatial location service.</param>
 /// <param name="options">The location options used to customize the experience.</param>
 /// <param name="requiredFields">The location required fields.</param>
 /// <param name="resourceManager">The location resource manager.</param>
 internal LocationDialog(
     string apiKey,
     string channelId,
     string prompt,
     IGeoSpatialService geoSpatialService,
     LocationOptions options = LocationOptions.None,
     LocationRequiredFields requiredFields   = LocationRequiredFields.None,
     LocationResourceManager resourceManager = null) : base(resourceManager)
 {
     SetField.NotNull(out this.apiKey, nameof(apiKey), apiKey);
     SetField.NotNull(out this.prompt, nameof(prompt), prompt);
     SetField.NotNull(out this.channelId, nameof(channelId), channelId);
     SetField.NotNull(out this.geoSpatialService, nameof(geoSpatialService), geoSpatialService);
     this.options        = options;
     this.requiredFields = requiredFields;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationCardBuilder"/> class.
 /// </summary>
 /// <param name="apiKey">The geo spatial API key.</param>
 public LocationCardBuilder(string apiKey, LocationResourceManager resourceManager)
 {
     SetField.NotNull(out this.apiKey, nameof(apiKey), apiKey);
     SetField.NotNull(out this.resourceManager, nameof(resourceManager), resourceManager);
 }