private Collection <HttpParameterDescriptor> InitializeParameterDescriptors()
        {
            Contract.Assert(_methodInfo != null);

            List <HttpParameterDescriptor> parameterInfos = ParameterInfos.Select(
                (item) => new ReflectedHttpParameterDescriptor(this, item)).ToList <HttpParameterDescriptor>();

            return(new Collection <HttpParameterDescriptor>(parameterInfos));
        }
Exemple #2
0
        /// <summary>
        /// Создает коллекцию программ.
        /// </summary>
        /// <returns></returns>
        protected override VstProgramCollection CreateProgramCollection()
        {
            VstProgramCollection programs = new VstProgramCollection();

            VstProgram defaultProgram = new VstProgram(ParameterCategories);

            defaultProgram.Parameters.AddRange(ParameterInfos.Select(x => new VstParameter(x)));
            defaultProgram.Name = "Default";
            programs.Add(defaultProgram);

            return(programs);
        }
Exemple #3
0
            public string GetSignature(bool isInterfaceDeclaration)
            {
                var sb = new System.Text.StringBuilder();

                sb.Append($"fn {NativeName}(");

                var paramDecl = ParameterInfos.Select((rpi) => {
                    return($"{rpi.NativeName}: {rpi.NativeTypeName}");
                }).ToList();

                if (!isInterfaceDeclaration)
                {
                    paramDecl.Insert(0, "&self");
                }

                sb.Append(string.Join(", ", paramDecl));
                sb.Append($") -> {NativeReturnTypeName}");
                return(sb.ToString());
            }
Exemple #4
0
 public override void OnException(MethodExecutionArgs args)
 {
     Console.WriteLine(
         $"Exception: {args.Method.DeclaringType?.Name}.{args.Method.Name}({ParameterInfos.Select((x, i) => $"{x.Name} = {args.Arguments[i]}").Aggregate((x, y) => x + ", " + y)})");
     args.FlowBehavior = FlowBehavior.ThrowException;
 }
Exemple #5
0
 public override void OnEntry(MethodExecutionArgs args)
 {
     Console.WriteLine(
         $"Entering {args.Method.DeclaringType?.Name}.{args.Method.Name}({ParameterInfos.Select((x, i) => $"{x.Name} = {args.Arguments[i]}").Aggregate((x, y) => x + ", " + y)})");
 }