Пример #1
0
 /// <summary>
 /// Instantiates the model.
 /// </summary>
 /// <param name="manager">The class that manages the Contentful configuration for the application.</param>
 /// <param name="client">The client used to communicate with the Contentful API.</param>
 public SettingsModel(IContentfulOptionsManager manager, IContentfulClient client)
 {
     Options    = manager.Options;
     _client    = client;
     _manager   = manager;
     AppOptions = new SelectedOptions
     {
         SpaceId       = Options.SpaceId,
         UsePreviewApi = Options.UsePreviewApi,
         AccessToken   = Options.DeliveryApiKey,
         PreviewToken  = Options.PreviewApiKey
     };
 }
Пример #2
0
 /// <summary>
 /// Instantiate the view component.
 /// </summary>
 /// <param name="httpClient">The httpclient to use for a separate call to the Contentful API.</param>
 /// <param name="optionsManager">The class that manages the Contentful configuration for the application.</param>
 public EntryStateViewComponent(HttpClient httpClient, IContentfulOptionsManager optionsManager)
 {
     _httpClient = httpClient;
     _options    = optionsManager.Options;
 }
Пример #3
0
 /// <summary>
 /// Instantiates the view component.
 /// </summary>
 /// <param name="optionsManager">The class that manages the Contentful configuration for the application.</param>
 public EditorialFeaturesViewComponent(IContentfulOptionsManager optionsManager)
 {
     _options = optionsManager.Options;
 }
Пример #4
0
        /// <summary>
        /// Initializes a new <see cref="Deeplinker"/>.
        /// </summary>
        /// <param name="next">The next request delegate in the chain of middleware.</param>
        /// <param name="manager">The <see cref="IContentfulOptionsManager"/> used to read the current options.</param>

        public Deeplinker(RequestDelegate next, IContentfulOptionsManager manager)
        {
            _next    = next;
            _manager = manager;
        }