Mono.CSharp.TypeManager.GetPredefinedConstructor C# (CSharp) Method

GetPredefinedConstructor() public static method

public static GetPredefinedConstructor ( System.TypeSpec t, Mono.CSharp.Location loc ) : MethodSpec
t System.TypeSpec
loc Mono.CSharp.Location
return MethodSpec
	public static MethodSpec GetPredefinedConstructor (TypeSpec t, Location loc, params TypeSpec [] args)
	{
		var pc = ParametersCompiled.CreateFullyResolved (args);
		return GetPredefinedMember (t, MemberFilter.Constructor (pc), false, loc) as MethodSpec;
	}

Usage Example

Example #1
0
        public override void ApplyAttributes(MethodBuilder mb, ConstructorBuilder cb, int index)
        {
            base.ApplyAttributes(mb, cb, index);

            CustomAttributeBuilder ca = TypeManager.param_array_attr;

            if (ca == null)
            {
                ConstructorInfo ci = TypeManager.GetPredefinedConstructor(TypeManager.param_array_type, Location, Type.EmptyTypes);
                if (ci == null)
                {
                    return;
                }

                ca = new CustomAttributeBuilder(ci, new object [0]);
                if (ca == null)
                {
                    return;
                }

                TypeManager.param_array_attr = ca;
            }

            builder.SetCustomAttribute(ca);
        }
All Usage Examples Of Mono.CSharp.TypeManager::GetPredefinedConstructor