Ejemplo n.º 1
0
 public CsvHelperReader(IServiceProvider?serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
 /// <summary>
 /// Retrieves an instance of <see cref="ILogger"/> given the type name <typeparamref name="T"/>.
 /// This is equivalent to <see cref="LoggerFactoryExtensions.CreateLogger{T}(ILoggerFactory)"/>.
 /// </summary>
 /// <returns>
 /// An <see cref="ILogger"/> instance, or null if <paramref name="services"/> is null or the
 /// <see cref="IServiceProvider"/> cannot produce an <see cref="ILoggerFactory"/>.
 /// </returns>
 public static ILogger GetLogger <T>(this IServiceProvider?services)
 {
     return(GetLogger(services, typeof(T)));
 }
Ejemplo n.º 3
0
 public OeBatchParser(Uri baseUri, IEdmModel edmModel, IServiceProvider?serviceProvider = null)
 {
     _baseUri         = baseUri;
     _edmModel        = edmModel;
     _serviceProvider = serviceProvider;
 }
 protected TriggeredDbContext(IServiceProvider?serviceProvider)
     : this(new DbContextOptions <DbContext>(), serviceProvider)
 {
 }
 public void SetTriggerServiceProvider(IServiceProvider?serviceProvider)
 => _triggerServiceProvider = serviceProvider;
Ejemplo n.º 6
0
 internal PageConventionCollection(IServiceProvider?serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
Ejemplo n.º 7
0
 public LibraryViewModel(IServiceProvider?serviceProvider) : base(serviceProvider)
 {
 }
Ejemplo n.º 8
0
 internal virtual Task HandleMessage(IServiceProvider?provider, byte[] message)
 {
     return(Task.CompletedTask);
 }
Ejemplo n.º 9
0
 public ImageShapeViewModel(IServiceProvider?serviceProvider) : base(serviceProvider, typeof(ImageShapeViewModel))
 {
 }
 public ArgbColorViewModel(IServiceProvider?serviceProvider) : base(serviceProvider)
 {
 }
Ejemplo n.º 11
0
 public CopyGitLinkPackage()
 {
     ServiceProvider = this;
 }
Ejemplo n.º 12
0
 public UsingValueServiceProvider(IServiceProvider provider)
 {
     this._Provider    = provider ?? throw new ArgumentNullException(nameof(provider));
     this.CurrentState = State.Init;
     this._Value       = default;
 }
Ejemplo n.º 13
0
 public ShapeFactory(IServiceProvider?serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
Ejemplo n.º 14
0
        public static async Task SerializeAsync(OeQueryContext queryContext, IAsyncEnumerator <Object?> asyncEnumerator,
                                                String contentType, Stream stream, OeEntryFactory entryFactory, IServiceProvider?serviceProvider, CancellationToken cancellationToken)
        {
            var settings = new ODataMessageWriterSettings()
            {
                BaseUri = queryContext.ODataUri.ServiceRoot,
                EnableMessageStreamDisposal = false,
                ODataUri    = queryContext.ODataUri,
                Validations = ValidationKinds.ThrowOnDuplicatePropertyNames,
                Version     = ODataVersion.V4
            };

            if (serviceProvider != null)
            {
                serviceProvider = new ServiceProvider(serviceProvider, settings);
            }

            IODataResponseMessage responseMessage = new Infrastructure.OeInMemoryMessage(stream, contentType, serviceProvider);

            using (ODataMessageWriter messageWriter = new ODataMessageWriter(responseMessage, settings, queryContext.EdmModel))
            {
                ODataUtils.SetHeadersForPayload(messageWriter, ODataPayloadKind.ResourceSet);
                ODataWriter writer = await messageWriter.CreateODataResourceSetWriterAsync(entryFactory.EntitySet, entryFactory.EdmEntityType);

                var odataWriter = new OeODataWriter(queryContext, writer, cancellationToken);
                await odataWriter.WriteAsync(entryFactory, asyncEnumerator).ConfigureAwait(false);
            }
        }
Ejemplo n.º 15
0
 public PngSkiaSharpWriter(IServiceProvider?serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
Ejemplo n.º 16
0
        public NotificationBuilder(IToastOptions options, INotificationReceiver notificationReceiver, IPermission permission, IServiceProvider?serviceProvider)
        {
            this.options = options;
            this.notificationReceiver = notificationReceiver;
            this.permission           = permission;
            this.serviceProvider      = serviceProvider;
            this.Notification         = new UNMutableNotificationContent();
            this.attachments          = new List <UNNotificationAttachment>();
            if (options.Sound != null)
            {
                Notification.Sound = options.Sound;
            }

            this.UseConfigurationFrom <IIosNotificationExtension>(serviceProvider);
            this.UseConfigurationFrom <IPlatformSpecificExtension>(serviceProvider);
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Creates a new instance of an <see cref="EncryptedXmlDecryptor"/>.
 /// </summary>
 /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
 public EncryptedXmlDecryptor(IServiceProvider?services)
 {
     _decryptor = services?.GetService <IInternalEncryptedXmlDecryptor>() ?? this;
     _options   = services?.GetService <IOptions <XmlKeyDecryptionOptions> >()?.Value;
 }
Ejemplo n.º 18
0
 private T ResolveService <T>(IServiceProvider?serviceProvider, T defaultValue)
 {
     return((T?)serviceProvider?.GetService(typeof(T)) ?? defaultValue);
 }
Ejemplo n.º 19
0
 public static void Initialize(IAzureFunctionsApi azureFunctionsApi, IGitHubApiV3 gitHubApiV3, IGitHubGraphQLApi gitHubGraphQLApi) =>
 _serviceProviderHolder = CreateContainer(azureFunctionsApi, gitHubApiV3, gitHubGraphQLApi);
Ejemplo n.º 20
0
 public ArcShapeViewModel(IServiceProvider?serviceProvider) : base(serviceProvider, typeof(ArcShapeViewModel))
 {
 }
Ejemplo n.º 21
0
 public LineToolViewModel(IServiceProvider?serviceProvider) : base(serviceProvider)
 {
 }
Ejemplo n.º 22
0
        /// <summary>
        /// Creates a new instance of a <see cref="DpapiXmlDecryptor"/>.
        /// </summary>
        /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
        public DpapiXmlDecryptor(IServiceProvider?services)
        {
            CryptoUtil.AssertPlatformIsWindows();

            _logger = services.GetLogger <DpapiXmlDecryptor>();
        }
 protected TriggeredDbContext(DbContextOptions options, IServiceProvider?serviceProvider)
     : base(options)
 {
     _triggerServiceProvider = serviceProvider;
 }
 public static TServiceTypeBase GetService <TServiceTypeBase>(this IServiceProvider?serviceProvider, Type serviceType) where TServiceTypeBase : class =>
 serviceProvider?.GetService(serviceType) as TServiceTypeBase;
Ejemplo n.º 25
0
 /// <summary>
 ///     Sets the <see cref="IServiceProvider" /> from which application services will be obtained. This
 ///     is done automatically when using 'AddDbContext', so it is rare that this method needs to be called.
 /// </summary>
 /// <param name="serviceProvider"> The service provider to be used. </param>
 /// <returns> The same builder instance so that multiple calls can be chained. </returns>
 public new virtual DbContextOptionsBuilder <TContext> UseApplicationServiceProvider(IServiceProvider?serviceProvider)
 => (DbContextOptionsBuilder <TContext>)base.UseApplicationServiceProvider(serviceProvider);
Ejemplo n.º 26
0
 /// <summary>
 ///  Initializes a new instance of the <see cref='EventsTab'/> class.
 /// </summary>
 public EventsTab(IServiceProvider?sp) => _serviceProvider = sp;
 /// <summary>
 /// Retrieves an instance of <see cref="ILogger"/> given the type name <paramref name="type"/>.
 /// This is equivalent to <see cref="LoggerFactoryExtensions.CreateLogger{T}(ILoggerFactory)"/>.
 /// </summary>
 /// <returns>
 /// An <see cref="ILogger"/> instance, or null if <paramref name="services"/> is null or the
 /// <see cref="IServiceProvider"/> cannot produce an <see cref="ILoggerFactory"/>.
 /// </returns>
 public static ILogger GetLogger(this IServiceProvider?services, Type type)
 {
     // Compiler won't allow us to use static types as the type parameter
     // for the call to CreateLogger<T>, so we'll duplicate its logic here.
     return(services?.GetService <ILoggerFactory>()?.CreateLogger(type.FullName !) ?? NullLogger.Instance);
 }
Ejemplo n.º 28
0
 public SkiaSharpRendererViewModel(IServiceProvider?serviceProvider)
     : base(serviceProvider, new SkiaSharpDrawNodeFactory())
 {
 }
Ejemplo n.º 29
0
 public OeParser(Uri baseUri, IEdmModel edmModel, Query.OeModelBoundProvider?modelBoundProvider, IServiceProvider?serviceProvider = null)
 {
     BaseUri            = baseUri;
     EdmModel           = edmModel;
     ModelBoundProvider = modelBoundProvider;
     _serviceProvider   = serviceProvider;
 }
 public void InitializeServiceProperties()
 {
     this.serviceProvider = ContainerBindings.GetServiceProvider(this.scenarioContext);
     this.tenantStore     = this.serviceProvider.GetRequiredService <ITenantStore>();
 }