private static void BuildMethod(JsonRpcMethodBuilder builder, MethodInfo method)
        {
            Debug.Assert(method != null);
            Debug.Assert(builder != null);

            builder.InternalName = method.Name;
            builder.ResultType = method.ReturnType;
            builder.Dispatcher = new Dispatcher(method);
            
            //
            // Build via attributes.
            //
            
            object[] attributes = method.GetCustomAttributes(typeof(IMethodReflector), true);
            foreach (IMethodReflector reflector in attributes)
                reflector.Build(builder, method);
            
            //
            // Fault in the method name if still without name.
            //
            
            if (builder.Name.Length == 0)
                builder.Name = method.Name;

            //
            // Build the method parameters.
            //

            foreach (ParameterInfo parameter in method.GetParameters())
                BuildParameter(builder.DefineParameter(), parameter);
        }
 public void Init()
 {
     _methodBuilder = (new JsonRpcServiceClassBuilder()).DefineMethod();
     _builder = _methodBuilder.DefineParameter();
 }