Exemplo n.º 1
0
 public CtorArgTypeResolver(ComplexExpressionBase Expression, SerializationContext Context, Type[] DefinedParameters)
 {
     if (Expression == null)
     {
         throw new ArgumentNullException("Expression");
     }
     _expression        = Expression;
     _definedParameters = DefinedParameters ?? new Type[0];
     _context           = Context;
 }
Exemplo n.º 2
0
 public void VisitComplexBase(ComplexExpressionBase expression)
 {
     if (_refID.Top == JsonPath.Root)
     {
         if (expression.Parent != null)
         {
             throw new ArgumentException("Reference for this passed to object that is not at the root", "refID");
         }
     }
     else
     {
         // have to assume that the parent checked that we were the right reference
         // should only get here if we have a parent, if no parent we're not valid
         if (expression.Parent == null)
             throw new ArgumentException("Invalid reference", "refID");
     }
     // it is this object, check if we need to go further
     _refID = _refID.ChildReference();
     if (_refID.IsEmpty) {
         _expr = expression;
     }
 }
Exemplo n.º 3
0
 public CtorArgTypeResolver(ComplexExpressionBase Expression, SerializationContext Context)
     : this(Expression, Context, new Type[0])
 {
 }
 public void VisitComplex(ComplexExpressionBase ComplexExpression)
 {
     foreach (Expression expr in ComplexExpression.ConstructorArguments)
         Visit(expr);
 }