﻿// Decompiled with JetBrains decompiler
// Type: System.Runtime.Remoting.Contexts.IContextPropertyActivator
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 255ABCDF-D9D6-4E3D-BAD4-F74D4CE3D7A8
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;
using System.Security;

namespace System.Runtime.Remoting.Contexts
{
  /// <summary>
  /// Indicates that the implementing property is interested in participating in activation and might not have provided a message sink.
  /// </summary>
  [ComVisible(true)]
  public interface IContextPropertyActivator
  {
    /// <summary>
    /// Indicates whether it is all right to activate the object type indicated in the <paramref name="msg"/> parameter.
    /// </summary>
    /// 
    /// <returns>
    /// A Boolean value indicating whether the requested type can be activated.
    /// </returns>
    /// <param name="msg">An <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage"/>. </param>
    [SecurityCritical]
    bool IsOKToActivate(IConstructionCallMessage msg);

    /// <summary>
    /// Called on each client context property that has this interface, before the construction request leaves the client.
    /// </summary>
    /// <param name="msg">An <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage"/>. </param>
    [SecurityCritical]
    void CollectFromClientContext(IConstructionCallMessage msg);

    /// <summary>
    /// Called on each client context property that has this interface, when the construction request returns to the client from the server.
    /// </summary>
    /// 
    /// <returns>
    /// true if successful; otherwise, false.
    /// </returns>
    /// <param name="msg">An <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage"/>. </param>
    [SecurityCritical]
    bool DeliverClientContextToServerContext(IConstructionCallMessage msg);

    /// <summary>
    /// Called on each server context property that has this interface, before the construction response leaves the server for the client.
    /// </summary>
    /// <param name="msg">An <see cref="T:System.Runtime.Remoting.Activation.IConstructionReturnMessage"/>. </param>
    [SecurityCritical]
    void CollectFromServerContext(IConstructionReturnMessage msg);

    /// <summary>
    /// Called on each client context property that has this interface, when the construction request returns to the client from the server.
    /// </summary>
    /// 
    /// <returns>
    /// true if successful; otherwise, false.
    /// </returns>
    /// <param name="msg">An <see cref="T:System.Runtime.Remoting.Activation.IConstructionReturnMessage"/>. </param>
    [SecurityCritical]
    bool DeliverServerContextToClientContext(IConstructionReturnMessage msg);
  }
}
