예제 #1
0
        public static MobiContext GetCurrent(HttpContext httpContext)
        {
            try
            {
                lock (httpContext.Request)
                {
                    MobiContext mobiContext = httpContext.Items[MobiHttpContextItemKey] as MobiContext;
                    if (mobiContext != null)
                    {
                        return(mobiContext as MobiContext);
                    }

                    mobiContext = new MobiContext(httpContext, ServiceCallbackApplication.GetRuntime(httpContext));
                    httpContext.Items[MobiHttpContextItemKey] = mobiContext;
                    return(mobiContext);
                }
            }
            catch (Exception e)
            {
                MobiContext mobiContext = httpContext.Items[MobiHttpContextItemKey] as MobiContext;
                if (mobiContext != null)
                {
                    return(mobiContext as MobiContext);
                }

                mobiContext = new MobiContext(httpContext, ServiceCallbackApplication.GetRuntime(httpContext));
                httpContext.Items[MobiHttpContextItemKey] = mobiContext;
                return(mobiContext);
            }
        }
예제 #2
0
 public static IRuntime GetRuntime(HttpApplication application)
 {
     return(ServiceCallbackApplication.GetRuntime(application.Application));
 }
예제 #3
0
 public static IRuntime GetRuntime(HttpContext context)
 {
     return(ServiceCallbackApplication.GetRuntime(context.Application));
 }