public override void Visit(RtArgument node)
        {
            if (node == null)
            {
                return;
            }
            Decorators(node);
            if (node.IsVariableParameters)
            {
                Write("...");
            }
            Visit(node.Identifier);

            // if a default value is used, then the parameter may be omitted as the default value is in place.
            if (Context == WriterContext.Interface && !node.Identifier.IsNullable && !string.IsNullOrEmpty(node.DefaultValue))
            {
                Write("?");
            }

            Write(": ");
            Visit(node.Type);
            if (Context != WriterContext.Interface && !string.IsNullOrEmpty(node.DefaultValue))
            {
                Write(" = ");
                Write(node.DefaultValue);
            }
        }
        public override void Visit(RtArgument node)
        {
            var reflectionAttachedRtArgument = node as ReflectionAttachedRtArgument;

            if (reflectionAttachedRtArgument != null && !reflectionAttachedRtArgument.Handled)
            {
                reflectionAttachedRtArgument.Handled = true;
                ReflectionParameter(reflectionAttachedRtArgument);
            }
        }
        public ReflectionAttachedRtArgument(RtArgument actual, ParameterInfo parameterInfo)
        {
            ParameterInfo = parameterInfo;

            this.Identifier           = actual.Identifier;
            this.DefaultValue         = actual.DefaultValue;
            this.IsVariableParameters = actual.IsVariableParameters;
            this.Type = actual.Type;
            foreach (var decorator in actual.Decorators)
            {
                this.Decorators.Add(decorator);
            }
        }
 public override void Visit(RtArgument node)
 {
     if (node == null)
     {
         return;
     }
     if (node.IsVariableParameters)
     {
         Write("...");
     }
     Visit(node.Identifier);
     Write(": ");
     Visit(node.Type);
     if (!string.IsNullOrEmpty(node.DefaultValue))
     {
         Write(" = ");
         Write(node.DefaultValue);
     }
 }
예제 #5
0
 public abstract void Visit(RtArgument node);
 public override void Visit(RtArgument node)
 {
 }
 public override RtArgument GenerateNode(ParameterInfo element, RtArgument result, TypeResolver resolver)
 {
     return(base.GenerateNode(element, result, resolver));
 }
예제 #8
0
 public abstract T Visit(RtArgument node);
예제 #9
0
 public RtTypeName ChangeFunctionParameterType(Type parameterType, RtTypeName rtTypeName, RtArgument rtArgument, ReflectionAttachedRtFunction rtFunction)
 {
     return(ChangeType(parameterType, rtTypeName));
 }
예제 #10
0
 public RtTypeName ChangeConstructorParameterType(Type parameterType, RtTypeName rtTypeName, RtArgument rtArgument, ReflectionAttachedRtConstructor rtConstructor)
 {
     return(ChangeType(parameterType, rtTypeName));
 }