internal UnmanagedCalliDescriptor(CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes)
     : base()
 {
     this.Value = string.Format(CultureInfo.CurrentCulture, "unmanaged {0} {1}({2})",
                                unmanagedCallConv.ToString().ToLower(CultureInfo.CurrentCulture),
                                new TypeDescriptor(returnType).Value,
                                string.Join(", ", CalliDescriptor.GetArguments(parameterTypes).ToArray()));
 }
        private static string GetArguments(CallingConventions callingConvention, Type[] parameterTypes, Type[] optionalParameterTypes)
        {
            var arguments = new List <string>();

            arguments.AddRange(CalliDescriptor.GetArguments(parameterTypes));

            if ((callingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)
            {
                arguments.Add("...");
                arguments.AddRange(CalliDescriptor.GetArguments(optionalParameterTypes));
            }

            return(string.Join(", ", arguments.ToArray()));
        }