protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { switch (callIndex) { default: return(false); } }
protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { switch (callIndex) { case 0: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.Web.Ajax.Example ajax = (AutoCSer.Web.Ajax.Example)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.GetCode(inputParameter.file); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); case 1: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.Web.Ajax.TestCase ajax = (AutoCSer.Web.Ajax.TestCase)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.GetCode(inputParameter.file); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); default: return(false); } }
protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { switch (callIndex) { case 0: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.TestCase.WebPerformance.Ajax.Call ajax = (AutoCSer.TestCase.WebPerformance.Ajax.Call)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.Add(inputParameter.left, inputParameter.right); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); case 1: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.TestCase.WebPerformance.Ajax.Call ajax = (AutoCSer.TestCase.WebPerformance.Ajax.Call)page; _p2 outputParameter = new _p2 { }; _a1 returnCallbak = new _a1 { Ajax = ajax, Parameter = outputParameter }; ajax.Xor(inputParameter.left, inputParameter.right, returnCallbak.Callback); return(true); } } return(false); default: return(false); } }
/// <summary> /// /// </summary> /// <param name="callIndex"></param> /// <param name="page"></param> /// <returns></returns> protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { return(false); }
internal bool CallAjax(AutoCSer.WebView.AjaxBase page) { return(callAjax(page.MethodInfo.MethodIndex, page)); }
/// <summary> /// AJAX 调用 /// </summary> /// <param name="callIndex"></param> /// <param name="page"></param> /// <returns></returns> protected virtual bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { throw new InvalidOperationException(); }
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); } }