public void ExecuteFunction(WxeUserControl userControl, WxeFunction subFunction, Control sender, bool usesEventTarget) { ArgumentUtility.CheckNotNull("userControl", userControl); ArgumentUtility.CheckNotNull("subFunction", subFunction); ArgumentUtility.CheckNotNull("sender", sender); IWxePage wxePage = userControl.WxePage; _wxeHandler = wxePage.WxeHandler; _userControlExecutor = new UserControlExecutor(this, userControl, subFunction, sender, usesEventTarget); IReplaceableControl replaceableControl = userControl; replaceableControl.Replacer.Controls.Clear(); wxePage.SaveAllState(); Execute(); }
public static String Call(Remotion.Web.ExecutionEngine.IWxePage currentPage, Remotion.Web.ExecutionEngine.WxeUserControl currentUserControl, System.Web.UI.Control sender, String InArg, ref String InOutArg) { AutoUserControlFunction function; if ((currentPage.IsReturningPostBack == false)) { function = new AutoUserControlFunction(InArg, InOutArg); function.ExceptionHandler.SetCatchExceptionTypes(typeof(System.Exception)); Remotion.Web.ExecutionEngine.WxeUserControl actualUserControl; actualUserControl = ((Remotion.Web.ExecutionEngine.WxeUserControl)(currentPage.FindControl(currentUserControl.PermanentUniqueID))); actualUserControl.ExecuteFunction(function, sender, null); throw new System.Exception("(Unreachable code)"); } else { function = ((AutoUserControlFunction)(currentPage.ReturningFunction)); if ((function.ExceptionHandler.Exception != null)) { throw function.ExceptionHandler.Exception; } InOutArg = function.InOutArg; return(function.ReturnValue); } }