Esempio n. 1
0
        public bool TryGetBreakLabel(out LabelInfo label)
        {
            if (BreakLabel != null)
            {
                label = BreakLabel;
                return(true);
            }

            if (Parent != null)
            {
                return(Parent.TryGetBreakLabel(out label));
            }

            label = null;
            return(false);
        }
Esempio n. 2
0
        public bool TryGetContinueLabel(out LabelInfo label)
        {
            if (ContinueLabel != null)
            {
                label = ContinueLabel;
                return(true);
            }

            if (Parent != null)
            {
                return(Parent.TryGetContinueLabel(out label));
            }

            label = null;
            return(false);
        }
Esempio n. 3
0
        public bool TryGetLabel(Expression expression, out LabelInfo label)
        {
            if (SwitchLabels == null || (label = SwitchLabels.SingleOrDefault(x => x.Key.GetHashCode() == expression.GetHashCode()).Value) == null)
            {
                if (Parent == null)
                {
                    label = null;
                    return(false);
                }

                if (!Parent.TryGetLabel(expression, out label))
                {
                    return(false);
                }
            }

            return(true);
        }