예제 #1
0
 public MixinConfigurationScope(MixinConfiguration previousContext)
 {
     _previousContext = previousContext;
 }
 /// <summary>
 /// Sets the active mixin configuration configuration for the current thread.
 /// </summary>
 /// <param name="configuration">The configuration to be set, can be <see langword="null"/>.</param>
 public static void SetActiveConfiguration(MixinConfiguration configuration)
 {
     s_activeConfiguration.SetCurrent(configuration);
 }
예제 #3
0
 /// <summary>
 /// Returns a <see cref="MixinConfigurationBuilder"/> object to build a new <see cref="MixinConfiguration"/> which inherits data from a
 /// <paramref name="parentConfiguration"/>. This method indirectly creates a copy of the <paramref name="parentConfiguration"/>. Use
 /// <see cref="BuildNew"/> to avoid the costs of copying.
 /// </summary>
 /// <param name="parentConfiguration">A <see cref="MixinConfiguration"/> whose data should be inherited from the built
 /// <see cref="MixinConfiguration"/>.</param>
 /// <returns>A <see cref="MixinConfigurationBuilder"/> for building a new <see cref="MixinConfiguration"/> with a fluent interface.</returns>
 /// <remarks>
 /// <para>
 /// Use this method to build a new <see cref="MixinConfiguration"/> while taking over the class-mixin bindings from an existing
 /// <see cref="MixinConfiguration"/> object.
 /// </para>
 /// <para>
 /// If you want to temporarily make the built
 /// <see cref="MixinConfiguration"/> the <see cref="ActiveConfiguration"/>, call the builder's <see cref="MixinConfigurationBuilder.EnterScope"/>
 /// method from within a <c>using</c> statement.
 /// </para>
 /// </remarks>
 public static MixinConfigurationBuilder BuildFrom(MixinConfiguration parentConfiguration)
 {
     ArgumentUtility.CheckNotNull("parentConfiguration", parentConfiguration);
     return(new MixinConfigurationBuilder(parentConfiguration));
 }
 /// <summary>
 /// Sets the master <see cref="MixinConfiguration"/>. The master configuration is the default <see cref="MixinConfiguration"/> used whenever a
 /// thread first accesses its <see cref="ActiveConfiguration"/>. If the master configuration is set to <see langword="null" />, the next call
 /// to <see cref="GetMasterConfiguration"/> (or the next thread first accessing its <see cref="ActiveConfiguration"/>) will trigger a new
 /// default configuration to be built.
 /// </summary>
 /// <param name="newMasterConfiguration">The <see cref="MixinConfiguration"/> to be used as the new master configuration.</param>
 /// <remarks>
 /// Changes made to the master configuration will affect any thread accessing its mixin configuration for the
 /// first time after this method has been called.
 /// </remarks>
 /// <seealso cref="GetMasterConfiguration"/>
 public static void SetMasterConfiguration(MixinConfiguration newMasterConfiguration)
 {
     s_masterConfiguration.Value = newMasterConfiguration;
 }