Beispiel #1
0
 public void Callback(AutoCSer.Net.TcpServer.ReturnValue <@MethodReturnType.FullName> value)
 {
     @WebAjaxMethodType.FullName ajax = System.Threading.Interlocked.Exchange(ref Ajax, null);
     if (ajax != null)
     {
         Parameter.Return = value.Value;
         response(ajax, value.Type);
     }
 }
Beispiel #2
0
            protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page)
            {
                switch (callIndex)
                {
                    #region LOOP Methods
                case @MethodIndex:
                {
                    #region IF InputParameterIndex
                    @InputParameterTypeName inputParameter = new @InputParameterTypeName();
                    if (page.ParseParameter(ref inputParameter))
                    #endregion IF InputParameterIndex
                    {
                        @WebAjaxMethodType.FullName ajax = (@WebAjaxMethodType.FullName)page;
                        #region IF OutputParameterIndex
                        @OutputParameterTypeName outputParameter = new @OutputParameterTypeName {         /*LOOP:MethodParameters*//*IF:IsRef*/
                            @ParameterName = inputParameter.@ParameterName,                               /*IF:IsRef*//*LOOP:MethodParameters*/
                        };
                        #endregion IF OutputParameterIndex
                        #region IF IsAsynchronousCallback
                        #region IF MethodIsReturn
                        @AsyncIndexName returnCallbak = new @AsyncIndexName {
                            Ajax = ajax, Parameter = outputParameter
                        };
                        ajax./*PUSH:Method*/ @MethodName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ inputParameter.@ParameterName, /*LOOP:MethodParameters*//*NOTE*/ (Action <AutoCSer.Net.TcpServer.ReturnValue <@MethodReturnType.FullName> >) /*NOTE*/ returnCallbak.Callback);
                        #endregion IF MethodIsReturn
                        #region NOT MethodIsReturn
                        #region IF IsPoolType
                        AjaxCallbackPool <@WebAjaxMethodType.FullName /*IF:OutputParameterIndex*/, @OutputParameterTypeName /*IF:OutputParameterIndex*/> callbackPool = new AjaxCallbackPool <@WebAjaxMethodType.FullName /*IF:OutputParameterIndex*/, @OutputParameterTypeName /*IF:OutputParameterIndex*/> {
                            Ajax = ajax /*IF:OutputParameterIndex*/, Parameter = outputParameter                                                                                                                                                                                                                                                                                    /*IF:OutputParameterIndex*/
                        };
                        ajax./*PUSH:Method*/ @MethodName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ inputParameter.@ParameterName, /*LOOP:MethodParameters*//*NOTE*/ (Action <AutoCSer.Net.TcpServer.ReturnValue>) /*NOTE*/ callbackPool.Callback);
                        #endregion IF IsPoolType
                        #region NOT IsPoolType
                        AjaxCallback /*IF:OutputParameterIndex*/ <@OutputParameterTypeName> /*IF:OutputParameterIndex*/ callback = new AjaxCallback /*IF:OutputParameterIndex*/ <@OutputParameterTypeName> /*IF:OutputParameterIndex*/ {
                            Ajax = /*NOTE*/ (AutoCSer.WebView.Ajax)(object) /*NOTE*/ ajax /*IF:OutputParameterIndex*/, Parameter = outputParameter                                                                                                                                                                                                           /*IF:OutputParameterIndex*/
                        };
                        ajax./*PUSH:Method*/ @MethodName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ inputParameter.@ParameterName, /*LOOP:MethodParameters*//*NOTE*/ (Action <AutoCSer.Net.TcpServer.ReturnValue>) /*NOTE*/ callback.Callback);
                        #endregion NOT IsPoolType
                        #endregion NOT MethodIsReturn
                        #endregion IF IsAsynchronousCallback
                        #region NOT IsAsynchronousCallback
                        try
                        {
                            /*IF:MethodIsReturn*/
                            outputParameter.Return = /*NOTE*/ (@MethodReturnType.FullName) /*NOTE*//*IF:MethodIsReturn*/ ajax./*PUSH:Method*/ @MethodName/*PUSH:Method*/ (/*LOOP:InputParameters*//*AT:ParameterRef*//*IF:MethodParameter.IsOut*//*PUSH:InputParameter*/ outputParameter.@ParameterName /*PUSH:InputParameter*//*IF:MethodParameter.IsOut*//*NOTE*/, /*NOTE*//*NOT:MethodParameter.IsOut*//*PUSH:Parameter*/ inputParameter.@ParameterName /*PUSH:Parameter*//*NOT:MethodParameter.IsOut*//*PUSH:Parameter*//*AT:ParameterJoin*//*PUSH:Parameter*//*LOOP:InputParameters*/);
                            #region LOOP OutputParameters
                            #region NOT InputMethodParameter.IsOut
                            /*PUSH:Parameter*/
                            outputParameter.@ParameterName /*PUSH:Parameter*/ = inputParameter./*PUSH:InputParameter*/ @ParameterName /*PUSH:InputParameter*/;
                            #endregion NOT InputMethodParameter.IsOut
                            #endregion LOOP OutputParameters
                        }
                        finally { responseAjax(ajax /*IF:OutputParameterIndex*/, ref outputParameter /*IF:OutputParameterIndex*/); }
                        #endregion NOT IsAsynchronousCallback
                        return(true);
                    }
                }
                    return(false);

                    #endregion LOOP Methods
                default: return(false);
                }
            }