Ejemplo n.º 1
0
        private string ProcessExpression(StringBuilder expressionBuffer, ViewDataContainer ViewData)
        {
            if (expressionBuffer.Length > 0)
            {
                string expression = expressionBuffer.ToString();
                expressionBuffer.Clear();

                string[] parts = expression.Split(':');
                string   value = ViewData.Get(parts[parts.Length - 1]);
                if (string.IsNullOrEmpty(value))
                {
                    return("");
                }
                for (int i = parts.Length - 2; i >= 0; i--)
                {
                    value = PerformExpressionMethod(parts[i], value);
                }
                return(value);
            }
            else
            {
                throw new Exception("View contained an empty expression.");
            }
        }
Ejemplo n.º 2
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     result = ViewData.Get(binder.Name);
     return(true);
 }