Skip to content

Commit

Permalink
XML docs for ProxyGenerationOptions & its mutating members
Browse files Browse the repository at this point in the history
  • Loading branch information
stakx committed Aug 12, 2019
1 parent f29ee09 commit 808ef99
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/Castle.Core/DynamicProxy/ProxyGenerationOptions.cs
Expand Up @@ -28,6 +28,14 @@ namespace Castle.DynamicProxy
using Castle.Core.Internal;
using Castle.DynamicProxy.Internal;

/// <summary>
/// <see cref="ProxyGenerationOptions"/> allows customization of the behavior of proxies created by
/// an <see cref="IProxyGenerator"/> (or proxy types generated by an <see cref="IProxyBuilder"/>).
/// <para>
/// You should not modify an instance of <see cref="ProxyGenerationOptions"/> once it has been
/// used to create a proxy (or proxy type).
/// </para>
/// </summary>
#if FEATURE_SERIALIZATION
[Serializable]
#endif
Expand Down Expand Up @@ -103,12 +111,45 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
}
#endif

/// <summary>
/// Gets or sets the <see cref="IProxyGenerationHook"/> that should be used during proxy type
/// generation. Defaults to an instance of <see cref="AllMethodsHook"/>.
/// <para>
/// You should not modify this property once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
public IProxyGenerationHook Hook { get; set; }

/// <summary>
/// Gets or sets the <see cref="IInterceptorSelector"/> that should be used by created proxies
/// to determine which interceptors to use for an interception. If set to <see langword="null"/>
/// (which is the default), created proxies will not use any selector.
/// <para>
/// You should not modify this property once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
public IInterceptorSelector Selector { get; set; }

/// <summary>
/// Gets or sets the class type from which generated interface proxy types will be derived.
/// Defaults to <c><see langword="typeof"/>(<see langword="object"/>)</c>.
/// <para>
/// You should not modify this property once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
public Type BaseTypeForInterfaceProxy { get; set; }

/// <summary>
/// Gets the collection of additional custom attributes that will be put on generated proxy types.
/// This collection is initially empty.
/// <para>
/// You should not modify this collection once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
public IList<CustomAttributeInfo> AdditionalAttributes
{
get { return additionalAttributes; }
Expand All @@ -130,6 +171,10 @@ public MixinData MixinData
/// Adds a delegate type to the list of mixins that will be added to generated proxies.
/// That is, generated proxies will have a `Invoke` method with a signature matching that
/// of the specified <paramref name="delegateType"/>.
/// <para>
/// You should not call this method once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
/// <param name="delegateType">The delegate type whose `Invoke` method should be reproduced in generated proxies.</param>
/// <exception cref="ArgumentNullException"><paramref name="delegateType"/> is <see langword="null"/>.</exception>
Expand All @@ -146,6 +191,10 @@ public void AddDelegateTypeMixin(Type delegateType)
/// Adds a delegate to be mixed into generated proxies. The <paramref name="delegate"/>
/// will act as the target for calls to a `Invoke` method with a signature matching that
/// of the delegate.
/// <para>
/// You should not call this method once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
/// <param name="delegate">The delegate that should act as the target for calls to `Invoke` methods with a matching signature.</param>
/// <exception cref="ArgumentNullException"><paramref name="delegate"/> is <see langword="null"/>.</exception>
Expand All @@ -156,6 +205,17 @@ public void AddDelegateMixin(Delegate @delegate)
AddMixinImpl(@delegate);
}

/// <summary>
/// Mixes the interfaces implemented by the specified <paramref name="instance"/> object into
/// created proxies, and uses <paramref name="instance"/> as the target for these mixed-in interfaces.
/// <para>
/// You should not call this method once this <see cref="ProxyGenerationOptions"/> instance
/// has been used to create a proxy.
/// </para>
/// </summary>
/// <param name="instance">The object that should act as the target for all of its implemented interfaces' methods.</param>
/// <exception cref="ArgumentNullException"><paramref name="instance"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException"><paramref name="instance"/> is an instance of <see cref="Type"/>.</exception>
public void AddMixinInstance(object instance)
{
if (instance == null) throw new ArgumentNullException(nameof(instance));
Expand Down

0 comments on commit 808ef99

Please sign in to comment.