Esempio n. 1
0
 private void Visit(BinaryExpression expr)
 {
     result.Append("(");
     Visit(expr.Left);
     result.Append(" " + OperatorAttribute.GetOperator(expr) + " ");
     Visit(expr.Right);
     result.Append(")");
 }
        public void OnImportsSatisfied()
        {
            // This method is called when all Imports have been resolved.
            // Right now, we've a collection of resolved instances; using these instances,
            // we'll populate our dictionary which contains the types that correspond with each symbol.

            _expressions.Clear();

            foreach (var e in _expressionImports)
            {
                var symbol = OperatorAttribute.GetOperator(e);

                if (symbol != String.Empty)
                {
                    if (_expressions.ContainsKey(symbol) == false)
                    {
                        _expressions.Add(symbol, e.GetType());
                    }
                }
            }
        }
Esempio n. 3
0
 private void Visit(UnaryExpression expr)
 {
     Visit(expr.Operand);
     result.Append(OperatorAttribute.GetOperator(expr));
 }