コード例 #1
0
    /// <summary>
    /// 构造一个 <see cref="DrawingExtensionBuilder"/>。
    /// </summary>
    /// <exception cref="ArgumentNullException">
    /// <paramref name="parentBuilder"/> 为空。
    /// </exception>
    /// <param name="parentBuilder">给定的父级 <see cref="IExtensionBuilder"/>。</param>
    public DrawingExtensionBuilder(IExtensionBuilder parentBuilder)
        : base(parentBuilder)
    {
        // Drawers
        ServiceCharacteristics.AddSingleton <ISavingDrawer>();
        ServiceCharacteristics.AddSingleton <IScalingDrawer>();
        ServiceCharacteristics.AddSingleton <IWatermarkDrawer>();

        // Verification
        ServiceCharacteristics.AddScope <ICaptchaGenerator>();
    }
コード例 #2
0
    /// <summary>
    /// 构造一个 <see cref="CoreExtensionBuilder"/>。
    /// </summary>
    /// <exception cref="ArgumentNullException">
    /// <paramref name="services"/> 为空。
    /// </exception>
    /// <param name="services">给定的 <see cref="IServiceCollection"/>。</param>
    public CoreExtensionBuilder(IServiceCollection services)
        : base(services)
    {
        // Cryptography
        ServiceCharacteristics.AddSingleton <IAlgorithmParameterGenerator>();
        ServiceCharacteristics.AddSingleton <IAsymmetricAlgorithm>();
        ServiceCharacteristics.AddSingleton <ISymmetricAlgorithm>();

        // Plugins
        ServiceCharacteristics.AddSingleton <IPluginResolver>();

        // Storage
        ServiceCharacteristics.AddSingleton <IStorableFileManager>();
        ServiceCharacteristics.AddSingleton <IWebFilePermission>();
        ServiceCharacteristics.AddSingleton <IWebStorableFileTransfer>();
    }
コード例 #3
0
    /// <summary>
    /// 构造一个 <see cref="DataExtensionBuilder"/>。
    /// </summary>
    /// <exception cref="ArgumentNullException">
    /// <paramref name="parentBuilder"/> 为空。
    /// </exception>
    /// <param name="parentBuilder">给定的父级 <see cref="IExtensionBuilder"/>。</param>
    public DataExtensionBuilder(IExtensionBuilder parentBuilder)
        : base(parentBuilder)
    {
        ServiceCharacteristics.AddSingleton <IIdGeneratorFactory>();
        ServiceCharacteristics.AddSingleton <IAuditingManager>();

        // Accessing
        ServiceCharacteristics.AddScope <IAccessorManager>();
        ServiceCharacteristics.AddScope <IAccessorMigrator>();
        ServiceCharacteristics.AddScope <IAccessorResolver>();

        ServiceCharacteristics.AddScope <IAccessorSeeder>(addImplementationType: true);
        ServiceCharacteristics.AddScope <IAccessorInitializer>();

        // Sharding
        ServiceCharacteristics.AddSingleton <IShardingManager>();

        // Storing
        ServiceCharacteristics.AddScope(typeof(IStore <>));

        // ValueConversion
        ServiceCharacteristics.AddSingleton <IEncryptionConverterFactory>();
    }