当前位置: 首页>>代码示例>>C#>>正文


C# IServiceProvider.GetLogger方法代码示例

本文整理汇总了C#中IServiceProvider.GetLogger方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceProvider.GetLogger方法的具体用法?C# IServiceProvider.GetLogger怎么用?C# IServiceProvider.GetLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceProvider的用法示例。


在下文中一共展示了IServiceProvider.GetLogger方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XmlKeyManager

        /// <summary>
        /// Creates an <see cref="XmlKeyManager"/>.
        /// </summary>
        /// <param name="repository">The repository where keys are stored.</param>
        /// <param name="configuration">Configuration for newly-created keys.</param>
        /// <param name="services">A provider of optional services.</param>
        public XmlKeyManager(
            IXmlRepository repository,
            IAuthenticatedEncryptorConfiguration configuration,
            IServiceProvider services)
        {
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            KeyEncryptor = services.GetService<IXmlEncryptor>(); // optional
            KeyRepository = repository;

            _activator = services.GetActivator(); // returns non-null
            _authenticatedEncryptorConfiguration = configuration;
            _internalKeyManager = services.GetService<IInternalXmlKeyManager>() ?? this;
            _keyEscrowSink = services.GetKeyEscrowSink(); // not required
            _logger = services.GetLogger<XmlKeyManager>(); // not required
            TriggerAndResetCacheExpirationToken(suppressLogging: true);
        }
开发者ID:supermason,项目名称:DataProtection,代码行数:31,代码来源:XmlKeyManager.cs

示例2: DpapiXmlEncryptor

        /// <summary>
        /// Creates a <see cref="DpapiXmlEncryptor"/> given a protection scope and an <see cref="IServiceProvider"/>.
        /// </summary>
        /// <param name="protectToLocalMachine">'true' if the data should be decipherable by anybody on the local machine,
        /// 'false' if the data should only be decipherable by the current Windows user account.</param>
        /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
        public DpapiXmlEncryptor(bool protectToLocalMachine, IServiceProvider services)
        {
            CryptoUtil.AssertPlatformIsWindows();

            _protectToLocalMachine = protectToLocalMachine;
            _logger = services.GetLogger<DpapiXmlEncryptor>();
        }
开发者ID:hishamco,项目名称:DataProtection,代码行数:13,代码来源:DpapiXmlEncryptor.cs

示例3: DpapiNGXmlEncryptor

        /// <summary>
        /// Creates a new instance of a <see cref="DpapiNGXmlEncryptor"/>.
        /// </summary>
        /// <param name="protectionDescriptorRule">The rule string from which to create the protection descriptor.</param>
        /// <param name="flags">Flags controlling the creation of the protection descriptor.</param>
        /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
        public DpapiNGXmlEncryptor([NotNull] string protectionDescriptorRule, DpapiNGProtectionDescriptorFlags flags, IServiceProvider services)
        {
            CryptoUtil.AssertPlatformIsWindows8OrLater();

            int ntstatus = UnsafeNativeMethods.NCryptCreateProtectionDescriptor(protectionDescriptorRule, (uint)flags, out _protectionDescriptorHandle);
            UnsafeNativeMethods.ThrowExceptionForNCryptStatus(ntstatus);
            CryptoUtil.AssertSafeHandleIsValid(_protectionDescriptorHandle);

            _logger = services.GetLogger<DpapiNGXmlEncryptor>();
        }
开发者ID:hishamco,项目名称:DataProtection,代码行数:16,代码来源:DpapiNGXmlEncryptor.cs

示例4: CngCbcAuthenticatedEncryptorDescriptor

        public CngCbcAuthenticatedEncryptorDescriptor(CngCbcAuthenticatedEncryptionSettings settings, ISecret masterKey, IServiceProvider services)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            if (masterKey == null)
            {
                throw new ArgumentNullException(nameof(masterKey));
            }

            Settings = settings;
            MasterKey = masterKey;
            _log = services.GetLogger<CngCbcAuthenticatedEncryptorDescriptor>();
        }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:16,代码来源:CngCbcAuthenticatedEncryptorDescriptor.cs

示例5: ManagedAuthenticatedEncryptorDescriptor

        public ManagedAuthenticatedEncryptorDescriptor(ManagedAuthenticatedEncryptionOptions options, ISecret masterKey, IServiceProvider services)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (masterKey == null)
            {
                throw new ArgumentNullException(nameof(masterKey));
            }

            Options = options;
            MasterKey = masterKey;
            _log = services.GetLogger<ManagedAuthenticatedEncryptorDescriptor>();
        }
开发者ID:leloulight,项目名称:DataProtection,代码行数:16,代码来源:ManagedAuthenticatedEncryptorDescriptor.cs

示例6: DefaultKeyResolver

 public DefaultKeyResolver(TimeSpan keyPropagationWindow, TimeSpan maxServerToServerClockSkew, IServiceProvider services)
 {
     _keyPropagationWindow = keyPropagationWindow;
     _maxServerToServerClockSkew = maxServerToServerClockSkew;
     _logger = services.GetLogger<DefaultKeyResolver>();
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:6,代码来源:DefaultKeyResolver.cs

示例7: ManagedAuthenticatedEncryptorDescriptor

 public ManagedAuthenticatedEncryptorDescriptor([NotNull] ManagedAuthenticatedEncryptionOptions options, [NotNull] ISecret masterKey, IServiceProvider services)
 {
     Options = options;
     MasterKey = masterKey;
     _log = services.GetLogger<ManagedAuthenticatedEncryptorDescriptor>();
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:6,代码来源:ManagedAuthenticatedEncryptorDescriptor.cs

示例8: KeyRingBasedDataProtectionProvider

 public KeyRingBasedDataProtectionProvider(IKeyRingProvider keyRingProvider, IServiceProvider services)
 {
     _keyRingProvider = keyRingProvider;
     _logger = services.GetLogger<KeyRingBasedDataProtector>(); // note: for protector (not provider!) type, could be null
 }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:5,代码来源:KeyRingBasedDataProtectionProvider.cs

示例9: EncryptedXmlDecryptor

 public EncryptedXmlDecryptor(IServiceProvider services)
 {
     _logger = services.GetLogger<EncryptedXmlDecryptor>();
 }
开发者ID:leloulight,项目名称:DataProtection,代码行数:4,代码来源:EncryptedXmlDecryptor.core50.cs

示例10: CertificateXmlEncryptor

 internal CertificateXmlEncryptor(IServiceProvider services)
 {
     _encryptor = services?.GetService<IInternalCertificateXmlEncryptor>() ?? this;
     _logger = services.GetLogger<CertificateXmlEncryptor>();
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:5,代码来源:CertificateXmlEncryptor.cs

示例11: NullXmlEncryptor

 /// <summary>
 /// Creates a new instance of <see cref="NullXmlEncryptor"/>.
 /// </summary>
 /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
 public NullXmlEncryptor(IServiceProvider services)
 {
     _logger = services.GetLogger<NullXmlEncryptor>();
 }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:8,代码来源:NullXmlEncryptor.cs

示例12: DpapiNGXmlDecryptor

        /// <summary>
        /// Creates a new instance of a <see cref="DpapiNGXmlDecryptor"/>.
        /// </summary>
        /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
        public DpapiNGXmlDecryptor(IServiceProvider services)
        {
            CryptoUtil.AssertPlatformIsWindows8OrLater();

            _logger = services.GetLogger<DpapiNGXmlDecryptor>();
        }
开发者ID:supermason,项目名称:DataProtection,代码行数:10,代码来源:DpapiNGXmlDecryptor.cs


注:本文中的IServiceProvider.GetLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。