Example #1
0
            protected override bool call(AutoCSer.WebView.CallBase call, ref AutoCSer.UnmanagedStream responseStream)
            {
                switch (call.CallMethodIndex)
                {
                    #region LOOP Methods
                    #region NOT IsAjaxLoad
                    #region NOT IsAsynchronous
                case @MethodIndex:
                {
                    #region IF MethodParameters.Length
                    @ParameterTypeName parameter = new @ParameterTypeName();
                    #region IF Attribute.IsFirstParameter
                    #region IF IsFristParameterValueType
                    if (call.ParseParameter(ref parameter /*PUSH:FristParameter*/.@ValueTypeParameterName /*PUSH:FristParameter*/))
                    #endregion IF IsFristParameterValueType
                    #region NOT IsFristParameterValueType
                    {
                        if (call.ParseParameterAny(ref parameter /*PUSH:FristParameter*/.@ParameterName /*PUSH:FristParameter*/))
                        #endregion NOT IsFristParameterValueType
                        #endregion IF Attribute.IsFirstParameter
                        #region NOT Attribute.IsFirstParameter
                        {
                            if (call.ParseParameter(ref parameter))
                            #endregion NOT Attribute.IsFirstParameter
                            #endregion IF MethodParameters.Length
                            {
                                @WebCallMethodType.FullName value = (@WebCallMethodType.FullName) /*NOTE*/ (object) /*NOTE*/ call;
                                value./*PUSH:Method*/ @MethodName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ parameter.@ParameterName /*AT:ParameterJoin*//*LOOP:MethodParameters*/);
                                repsonseCall(value, ref responseStream);
                                return(true);
                            }
                        }
                    }
                }
                    #region IF MethodParameters.Length
                    return(false);

                    #endregion IF MethodParameters.Length
                    #endregion NOT IsAsynchronous
                    #endregion NOT IsAjaxLoad
                    #endregion LOOP Methods
                default: return(false);
                }
            }
Example #2
0
            /// <summary>
            /// AJAX调用
            /// </summary>
            /// <param name="callIndex"></param>
            /// <param name="loader"></param>
            protected override void callAjax(int callIndex, fastCSharp.code.cSharp.ajax.loader loader)
            {
                switch (callIndex)
                {
                    #region LOOP Methods
                case @MethodIndex:
                {
                    @WebViewMethodType.FullName view = /*IF:TypeAttribute.IsPool*/ fastCSharp.typePool <@WebViewMethodType.FullName> .Pop() ?? /*IF:TypeAttribute.IsPool*/ new @WebViewMethodType.FullName();

                    #region IF IsParameter
                    @ParameterTypeName parameter = new @ParameterTypeName();
                    #endregion IF IsParameter
                    fastCSharp.net.tcp.http.response response = loader.Load(view /*IF:IsInputParameter*/, ref parameter /*IF:IsInputParameter*//*PUSH:TypeAttribute*/, @IsPool /*PUSH:TypeAttribute*/);
                    if (response != null)
                    {
                        int responseIdentity = view.ResponseIdentity;
                        #region IF IsAsynchronousCallback
                        @AsyncIndexName callback = typePool <@AsyncIndexName> .Pop() ?? new @AsyncIndexName();

                        #region IF IsParameter
                        callback.Parameter = parameter;
                        #endregion IF IsParameter
                        view./*PUSH:Method*/ @MethodGenericName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ parameter.@ParameterName, /*LOOP:MethodParameters*/ callback.Get(view, response));
                        #endregion IF IsAsynchronousCallback
                        #region NOT IsAsynchronousCallback
                        try
                        {
                            /*IF:MethodIsReturn*/
                            parameter.@ReturnName = /*NOTE*/ (@MethodReturnType.GenericParameterType.FullName) /*NOTE*//*IF:MethodIsReturn*/ view./*PUSH:Method*/ @MethodGenericName/*PUSH:Method*/ (/*LOOP:MethodParameters*//*AT:ParameterRef*/ parameter.@ParameterName /*AT:ParameterJoin*//*LOOP:MethodParameters*/);
                        }
                        finally
                        {
                            #region IF IsOutputParameter
                            if (responseIdentity == view.ResponseIdentity)
                            {
                                view.AjaxResponse(ref parameter, ref response);
                            }
                            else
                            {
                                view.AjaxResponse(ref response);
                            }
                            #endregion IF IsOutputParameter
                            #region NOT IsOutputParameter
                            view.AjaxResponse(ref response);
                            #endregion NOT IsOutputParameter
                        }
                        #endregion NOT IsAsynchronousCallback
                    }
                }
                    return;

                    #endregion LOOP Methods
                    #region LOOP ViewMethods
                case @MethodIndex /*NOTE*/ + 1 /*NOTE*/: loader.LoadView(/*IF:Attribute.IsPool*/ fastCSharp.typePool <@WebViewMethodType.FullName> .Pop() ?? /*IF:Attribute.IsPool*/ new @WebViewMethodType.FullName() /*PUSH:Attribute*/, @IsPool /*PUSH:Attribute*/); return;

                    #endregion LOOP ViewMethods
                    #region NOT IsPubError
                case @MethodCount - 1: pubError(loader); return;

                    #endregion NOT IsPubError
                }
            }