Beispiel #1
0
        public OnEnterLeaveResult Jump(IdContainer JumpTo, JumpMode Mode = JumpMode.Enter)
        {
            var Common  = Container.GetCommonContainer(JumpTo);
            var TryComm = Container.GetParent <Command>(x =>
                                                        x.Type == CommandType.Try && x.FinallyScope != null, Common);

            if (TryComm != null)
            {
                Container   = TryComm.FinallyScope;
                FinallyJump = new JumpDestination(JumpTo, Mode);
                return(OnEnterLeaveResult.EnterNew);
            }
            else
            {
                Container = JumpTo;
                if (Mode == JumpMode.Enter)
                {
                    return(OnEnterLeaveResult.EnterNew);
                }
                else if (Mode == JumpMode.Leave)
                {
                    return(OnEnterLeaveResult.LeaveNew);
                }
                else
                {
                    throw new ArgumentOutOfRangeException("Mode");
                }
            }
        }
Beispiel #2
0
 public OnEnterLeaveResult Jump(JumpDestination JumpDst)
 {
     return(Jump(JumpDst.Container, JumpDst.Mode));
 }