Mono.CSharp.NullConstant.EncodeAttributeValue C# (CSharp) Method

EncodeAttributeValue() public method

public EncodeAttributeValue ( IMemberContext rc, Mono.CSharp.AttributeEncoder enc, System.TypeSpec targetType, System.TypeSpec parameterType ) : void
rc IMemberContext
enc Mono.CSharp.AttributeEncoder
targetType System.TypeSpec
parameterType System.TypeSpec
return void
		public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)
		{
			switch (targetType.BuiltinType) {
			case BuiltinTypeSpec.Type.Object:
				// Type it as string cast
				enc.Encode (rc.Module.Compiler.BuiltinTypes.String);
				goto case BuiltinTypeSpec.Type.String;
			case BuiltinTypeSpec.Type.String:
			case BuiltinTypeSpec.Type.Type:
				enc.Encode (byte.MaxValue);
				return;
			default:
				var ac = targetType as ArrayContainer;
				if (ac != null && ac.Rank == 1 && !ac.Element.IsArray) {
					enc.Encode (uint.MaxValue);
					return;
				}

				break;
			}

			base.EncodeAttributeValue (rc, enc, targetType, parameterType);
		}