Ext.Net.DirectMethod.Invoke C# (CSharp) Method

Invoke() private method

private Invoke ( ) : object
return object
        public object Invoke()
        {
            return this.Invoke(null, HttpContext.Current, null);
        }

Same methods

DirectMethod::Invoke ( object target ) : object
DirectMethod::Invoke ( object target, HttpContext context, ParameterCollection args ) : object
DirectMethod::Invoke ( object target, ParameterCollection args ) : object

Usage Example

Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            DirectResponse responseObject = new DirectResponse(true);

            try
            {
                HandlerMethods handler    = HandlerMethods.GetHandlerMethods(context, context.Request.FilePath);
                string         methodName = HandlerMethods.GetMethodName(context);

                if (handler == null)
                {
                    throw new Exception("The Method '{0}' has not been defined.".FormatWith(context.Request.FilePath));
                }

                if (methodName.IsEmpty())
                {
                    throw new Exception("No methodName has been set in the configuration.");
                }

                DirectMethod directMethod = handler.GetStaticMethod(methodName);

                if (directMethod == null)
                {
                    throw new Exception("The static DirectMethod '{0}' has not been defined.".FormatWith(methodName));
                }

                responseObject.Result = directMethod.Invoke();
            }
            catch (Exception e)
            {
                if (HandlerMethods.RethrowException(context))
                {
                    throw e;
                }

                responseObject.Success      = false;
                responseObject.ErrorMessage = IsDebugging ? e.ToString() : e.Message;
            }

            context.Response.Cache.SetNoServerCaching();
            context.Response.Cache.SetMaxAge(TimeSpan.Zero);
            context.Response.Write(responseObject.ToString());
            context.Response.End();
        }
All Usage Examples Of Ext.Net.DirectMethod::Invoke