public RpcTypeDescriptor(Type code_type, string unmarshal_method, MarshalHelperBuilder marshal_helper,
                          string marshal_method, NdrBaseTypeReference ndr_type,
                          NdrCorrelationDescriptor conformance, NdrCorrelationDescriptor variance, AdditionalArguments additional_marshal_args, AdditionalArguments additional_unmarshal_args)
     : this(new CodeTypeReference(code_type), code_type.IsValueType || typeof(NtObject).IsAssignableFrom(code_type),
            unmarshal_method, marshal_helper, marshal_method, ndr_type, conformance, variance, additional_marshal_args, additional_unmarshal_args)
 {
     BuiltinType = code_type;
 }
        public RpcTypeDescriptor(CodeTypeReference code_type, bool value_type, string unmarshal_method,
                                 MarshalHelperBuilder marshal_helper, string marshal_method, NdrBaseTypeReference ndr_type,
                                 NdrCorrelationDescriptor conformance, NdrCorrelationDescriptor variance,
                                 AdditionalArguments additional_marshal_args, AdditionalArguments additional_unmarshal_args)
        {
            CodeType        = code_type;
            UnmarshalMethod = unmarshal_method;
            if (additional_marshal_args != null)
            {
                if (marshal_helper == null)
                {
                    throw new ArgumentNullException(nameof(marshal_helper));
                }

                MarshalMethod = marshal_helper.AddGenericMarshal(ndr_type, code_type, marshal_method, additional_marshal_args);
            }
            else
            {
                MarshalMethod = marshal_method;
            }

            if (additional_unmarshal_args != null)
            {
                if (marshal_helper == null)
                {
                    throw new ArgumentNullException(nameof(marshal_helper));
                }

                UnmarshalMethod = marshal_helper.AddGenericUnmarshal(ndr_type, code_type, unmarshal_method, additional_unmarshal_args ?? new AdditionalArguments());
            }
            else
            {
                UnmarshalMethod = unmarshal_method;
            }

            NdrType               = ndr_type;
            ValueType             = value_type;
            ConformanceDescriptor = conformance ?? new NdrCorrelationDescriptor();
            VarianceDescriptor    = variance ?? new NdrCorrelationDescriptor();
        }
 public RpcTypeDescriptor(string name, bool value_type, string unmarshal_method, MarshalHelperBuilder marshal_helper,
                          string marshal_method, NdrBaseTypeReference ndr_type, NdrCorrelationDescriptor conformance, NdrCorrelationDescriptor variance,
                          AdditionalArguments additional_marshal_args, AdditionalArguments additional_unmarshal_args)
     : this(new CodeTypeReference(name), value_type, unmarshal_method, marshal_helper, marshal_method, ndr_type,
            conformance, variance, additional_marshal_args, additional_unmarshal_args)
 {
     Constructed = true;
     Union       = ndr_type is NdrUnionTypeReference;
 }