Exemplo n.º 1
0
 internal Parameter(ParameterBuilder builder, Method method)
 {
     Debug.Assert(builder != null);
     Debug.Assert(builder.Position >= 0);
     Debug.Assert(method != null);
     
     _name = builder.Name;
     _parameterType = builder.ParameterType;
     _position = builder.Position;
     _isParamArray = builder.IsParamArray;
     _method = method;
 }
Exemplo n.º 2
0
 public void Init()
 {
     _methodBuilder = (new ServiceClassBuilder()).DefineMethod();
     _builder = _methodBuilder.DefineParameter();
 }
Exemplo n.º 3
0
 public ParameterBuilder DefineParameter()
 {
     ParameterBuilder builder = new ParameterBuilder(this);
     ParameterList.Add(builder);
     return builder;
 }
        private static void BuildParameter(ParameterBuilder builder, ParameterInfo parameter)
        {
            Debug.Assert(parameter != null);
            Debug.Assert(builder != null);

            builder.Name = parameter.Name;
            builder.ParameterType = parameter.ParameterType;
            builder.Position = parameter.Position;
            builder.IsParamArray = parameter.IsDefined(typeof(ParamArrayAttribute), true);

            //
            // Build via attributes.
            //

            object[] attributes = parameter.GetCustomAttributes(typeof(IParameterReflector), true);
            foreach (IParameterReflector reflector in attributes)
                reflector.Build(builder, parameter);
        }
Exemplo n.º 5
0
 public void Init()
 {
     _methodBuilder = (new ServiceClassBuilder()).DefineMethod();
     _builder       = _methodBuilder.DefineParameter();
 }
Exemplo n.º 6
0
 public ParameterBuilder DefineParameter()
 {
     ParameterBuilder builder = new ParameterBuilder(this);
     builder.Position = ParameterList.Count;
     ParameterList.Add(builder);
     return builder;
 }
Exemplo n.º 7
0
        internal static void BuildParameter(ParameterBuilder builder, ParameterInfo parameter)
        {
            Debug.Assert(parameter != null);
            Debug.Assert(builder != null);

            //
            // Build...
            //

            builder.Name = parameter.Name;
            builder.ParameterType = parameter.ParameterType;
            builder.IsParamArray = parameter.IsDefined(typeof(ParamArrayAttribute), true);

            //
            // Modify...
            //

            object[] modifiers = GetCustomAttributes(parameter, typeof(IParameterModifier), true);
            foreach (IParameterModifier modifier in modifiers)
                modifier.Modify(builder);
        }