Esempio n. 1
0
        private object ResolveValue(BindingContext context, object instance, string segment)
        {
            object resolvedValue = new UndefinedBindingResult(segment, CompilationContext.Configuration);

            if (segment.StartsWith("@"))
            {
                var contextValue = context.GetContextVariable(segment.Substring(1));
                if (contextValue != null)
                {
                    resolvedValue = contextValue;
                }
            }
            else if (segment == "this" || segment == string.Empty)
            {
                resolvedValue = instance;
            }
            else
            {
                resolvedValue = AccessMember(instance, segment);
            }
            return(resolvedValue);
        }