コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:GenerateFallbackNameRegister`1"/> class with a given
 /// fallback mechanism and generator function.
 /// </summary>
 /// <param name="fallback">The fallback mechanism that must be used before the system aims to
 /// generate a new instance.</param>
 /// <param name="generator">The generator, that must generate new instances .</param>
 public GenerateFallbackNameRegister(DNameRegisterFallback<T> fallback, Func<string,T> generator)
     : base(fallback)
 {
     this.Generator = generator;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:FallbackNameRegister`1"/> class with a specified fallback mechanism.
 /// </summary>
 /// <param name="fallback">A function that generates an object when a specific name cannot be found, optional, by
 /// default <c>null</c> (no fallback).</param>
 /// <remarks>
 /// <para>If the given <paramref name="fallback"/> is not effective, no fallback mechanism is used.</para>
 /// </remarks>
 public FallbackNameRegister(DNameRegisterFallback <T> fallback = null)
 {
     this.Fallback = fallback;
 }