IsEnum() public method

public IsEnum ( string type ) : bool
type string
return bool
Example #1
0
	public void Write (StringBuilder text, SignatureType type, GlobalInfo info)
	{
		if (IsConst && (type == SignatureType.Native || type == SignatureType.NativeC))
			text.Append ("const ");

		if (type != SignatureType.Native && type != SignatureType.NativeC) {
			if (IsRef && !IsReturnType)
				text.Append ("ref ");
			if (IsOut && !IsReturnType)
				text.Append ("out ");
		}

		if (type == SignatureType.NativeC && info.IsEnum (Value)) {
			text.Append (GetPrettyType ().Replace (Value.Replace ("*", ""), "int"));
		} else if (type == SignatureType.Native || type == SignatureType.NativeC) {
			text.Append (GetPrettyType ());
		} else {
			text.Append (GetManagedType ());
		}
	}
Example #2
0
    public void Write(StringBuilder text, SignatureType type, GlobalInfo info)
    {
        if (IsConst && (type == SignatureType.Native || type == SignatureType.NativeC))
        {
            text.Append("const ");
        }

        if (type != SignatureType.Native && type != SignatureType.NativeC)
        {
            if (IsRef && !IsReturnType)
            {
                text.Append("ref ");
            }
            if (IsOut && !IsReturnType)
            {
                text.Append("out ");
            }
        }

        if (type == SignatureType.NativeC && info.IsEnum(Value))
        {
            text.Append(GetPrettyType().Replace(Value.Replace("*", ""), "int"));
        }
        else if (type == SignatureType.Native || type == SignatureType.NativeC)
        {
            if (Value == "GCHandle")
            {
                text.Append("void *");
            }
            else
            {
                text.Append(GetPrettyType());
            }
        }
        else
        {
            text.Append(GetManagedType());
        }
    }
Example #3
0
    public void WriteCall(StringBuilder text, SignatureType type)
    {
        if (type != SignatureType.Native && type != SignatureType.NativeC)
        {
            if (ParameterType.IsRef)
            {
                text.Append("ref ");
            }
            if (ParameterType.IsOut)
            {
                text.Append("out ");
            }
        }

        if (type == SignatureType.NativeC && GlobalInfo.IsEnum(ParameterType.Value))
        {
            text.Append("(");
            text.Append(ParameterType.Value);
            text.Append(") ");
        }
        text.Append(Name);
    }