@@ -44,9 +44,11 @@ namespace GeneXus.Http
4444 using GeneXus . Notifications ;
4545 using Web . Security ;
4646 using System . Web . SessionState ;
47+ using GeneXus . Mock ;
48+ using GeneXus . Data . NTier ;
4749#endif
4850
49-
51+
5052
5153#if NETCORE
5254 public abstract class GXHttpHandler : GXBaseObject , IHttpHandler
@@ -278,6 +280,61 @@ private bool IsFullAjaxRequest(HttpContext httpContext)
278280 public virtual void initialize ( ) { throw new Exception ( "The method or operation is not implemented." ) ; }
279281 public virtual void cleanup ( ) { }
280282 virtual public bool UploadEnabled ( ) { return false ; }
283+
284+ protected virtual void ExecuteEx ( )
285+ {
286+ ExecutePrivate ( ) ;
287+ }
288+ protected virtual void ExecutePrivate ( )
289+ {
290+
291+ }
292+ protected virtual void ExecutePrivateCatch ( object stateInfo )
293+ {
294+ try
295+ {
296+ ( ( GXHttpHandler ) stateInfo ) . ExecutePrivate ( ) ;
297+ }
298+ catch ( Exception e )
299+ {
300+ GXUtil . SaveToEventLog ( "Design" , e ) ;
301+ Console . WriteLine ( e . ToString ( ) ) ;
302+ }
303+ }
304+ protected void SubmitImpl ( )
305+ {
306+ GxContext submitContext = new GxContext ( ) ;
307+ DataStoreUtil . LoadDataStores ( submitContext ) ;
308+ IsMain = true ;
309+ submitContext . SetSubmitInitialConfig ( context ) ;
310+ this . context = submitContext ;
311+ initialize ( ) ;
312+ Submit ( ExecutePrivateCatch , this ) ;
313+ }
314+ protected virtual void CloseCursors ( )
315+ {
316+
317+ }
318+ protected void Submit ( Action < object > executeMethod , object state )
319+ {
320+ ThreadUtil . Submit ( PropagateCulture ( new WaitCallback ( executeMethod ) ) , state ) ;
321+ }
322+ public static WaitCallback PropagateCulture ( WaitCallback action )
323+ {
324+ var currentCulture = Thread . CurrentThread . CurrentCulture ;
325+ GXLogging . Debug ( log , "Submit PropagateCulture " + currentCulture ) ;
326+ var currentUiCulture = Thread . CurrentThread . CurrentUICulture ;
327+ return ( x ) =>
328+ {
329+ Thread . CurrentThread . CurrentCulture = currentCulture ;
330+ Thread . CurrentThread . CurrentUICulture = currentUiCulture ;
331+ action ( x ) ;
332+ } ;
333+ }
334+ protected virtual string [ ] GetParameters ( )
335+ {
336+ return null ;
337+ }
281338#endif
282339 public virtual bool SupportAjaxEvent ( ) { return false ; }
283340 public virtual String AjaxOnSessionTimeout ( ) { return "Ignore" ; }
0 commit comments