Example #1
0
        private static Boolean ExitCurrentContext(
            DynContext DynLanContext,
            Exception ex)
        {
            DynLanState state = DynLanContext.CurrentState;

            state.CurrentLineID = Guid.Empty;

            Object result = null;

            if (state != null &&
                state.ContextType == DynLanContextType.CLASS)
            {
                result = state.Object;
            }

            // jeśli został tylko ostatni główny context
            if (DynLanContext.Stack.Count == 1)
            {
                DynLanContext.Result     = result;
                DynLanContext.IsFinished = true;
            }
            else
            {
                DynLanContext.PopContext(ex);
                if (DynLanContext.CurrentExpressionState != null)
                {
                    DynLanContext.CurrentExpressionState.PushValue(result);
                }
            }

            return(true);
        }
Example #2
0
        //////////////////////////////////////////////

        private static Boolean ExitCurrentContext(
            DynContext DynLanContext,
            Object Result,
            Exception ex)
        {
            DynLanState context = DynLanContext.CurrentState;

            context.CurrentLineID = Guid.Empty;

            // jeśli został tylko ostatni główny context
            if (DynLanContext.Stack.Count == 1)
            {
                DynLanContext.Result     = Result;
                DynLanContext.IsFinished = true;
            }
            else
            {
                DynLanContext.PopContext(ex);
                if (DynLanContext.CurrentExpressionState != null)
                {
                    DynLanContext.CurrentExpressionState.PushValue(Result);
                }
            }

            return(true);
        }