參誼欺參和購囚旗鷹?
AjaxMethodAttribute[] customAttributes = (AjaxMethodAttribute[]) processorArray [i].Method.GetCustomAttributes(typeof(AjaxMethodAttribute), true);
if (customAttributes.Length > 0)
{
if (customAttributes[0].RequireSessionState == HttpSessionStateRequirement.Read)
{
if (! customAttributes[0].UseAsyncProcessing)
{
return new AjaxSyncHttpHandlerSessionReadOnly(processorArray[i]);
}
return new AjaxAsyncHttpHandlerSessionReadOnly(processorArray[i]);
}
if (customAttributes[0].RequireSessionState == HttpSessionStateRequirement.ReadWrite)
{
if (! customAttributes[0].UseAsyncProcessing)
{
return new AjaxSyncHttpHandlerSession(processorArray[i]);
}
return new AjaxAsyncHttpHandlerSession(processorArray[i]);
}
}
廣吭碕弼旗鷹何蛍?隼朔購廣窃AjaxSyncHttpHandlerSessionReadOnly才 AjaxSyncHttpHandlerSession?厘断心宸曾倖窃頁孤啄議?
public class AjaxSyncHttpHandlerSessionReadOnly : AjaxSyncHttpHandler, IReadOnlySessionState, IRequiresSessionState
{
public AjaxSyncHttpHandlerSessionReadOnly(IAjaxProcessor p) : base(p)
{
}
}
public class AjaxSyncHttpHandlerSession : AjaxSyncHttpHandler, IRequiresSessionState
{
public AjaxSyncHttpHandlerSession(IAjaxProcessor p) : base(p)
{
}
}
伯伯菜园系列 之 “接口”白菜(7)
时间:2011-08-18 博客园 农民伯伯
看到没有?!他分别继承了这两个接口,而普通的只是实现了IHttpHander接口,也就是能不能使用 Session关键就在到底有没有继承这两个接口之一。但是我们使用Session仍然是从 HttpContext. |