これらのインターフェイスは、HttpContextによって単純に使用されます。キービットされた状態で
set
{
this._handler = value;
this.RequiresSessionState = false;
this.ReadOnlySessionState = false;
this.InAspCompatMode = false;
if (this._handler != null)
{
if (this._handler is IRequiresSessionState)
{
this.RequiresSessionState = true;
}
if (this._handler is IReadOnlySessionState)
{
this.ReadOnlySessionState = true;
}
Page page = this._handler as Page;
if ((page != null) && page.IsInAspCompatMode)
{
this.InAspCompatMode = true;
}
}
}
:あなたは、リフレクタでそのハンドラのプロパティを見れば、あなたは次のように表示されます
if (this._handler is IReadOnlySessionState)
{
this.ReadOnlySessionState = true;
}
他の人は、彼らがするのHttpContextが使用するマーカー・インターフェースであると述べてきたようにそれが持つべき能力を確立する。
IHttpHandlerのProcessRequestは、HttpContextを取ります。したがって、2つの間の関係です。
@Moulde:あなたが参照しているインタフェースの完全な名前を教えてください。それは 'System.Web.ISessionHandler'ですか? –