Пример #1
0
        private bool ProcessExpression(SymbolTable symbolTable)
        {
            // TODO: If there are performance problems, we could find a faster way to detect expressions than doing a full parse
            var tokenSequence = new TokenSequence(XValue);

            if (tokenSequence.RequiresProcessing)
            {
                if (tokenSequence.RequiresTemplateArguments)
                {
                    var templateInstance = TemplateInstance;
                    if (templateInstance == null || templateInstance.Template == null)
                    {
                        return false;
                    }

                    XValue = tokenSequence.Process(symbolTable, templateInstance.ArgumentDictionary);
                }
                else
                {
                    XValue = tokenSequence.Process(symbolTable, null);
                }
            }

            return true;
        }
Пример #2
0
        private static bool BindExpression(ParserContext context, XObject xmlObject, string xmlValue, PropertyInfo boundProperty)
        {
            var tokenSequence = new TokenSequence(xmlValue);
            if (tokenSequence.RequiresProcessing)
            {
                DelayedBind(context, xmlObject, xmlValue, boundProperty);
                return true;
            }

            return false;
        }