Mono.Cecil.CustomAttribute.GetBlob C# (CSharp) Method

GetBlob() public method

public GetBlob ( ) : byte[]
return byte[]
        public byte[] GetBlob()
        {
            if (blob != null)
                return blob;

            if (!HasImage)
                throw new NotSupportedException ();

            return Module.Read (ref blob, this, (attribute, reader) => reader.ReadCustomAttributeBlob (attribute.signature));
        }

Usage Example

        private void WriteCustomAttribute(CustomAttribute custom)
        {
            custom.Resolve();
            WriteDot();
            WriteKeyword("custom");
            WriteSpace();
            WriteMethodReference(custom.Constructor, true);
            WriteSpace();
            Write("=");
            WriteLine();
            if (custom.HasConstructorArguments || custom.HasProperties || custom.HasFields)
            {
                WriteOpenBreckets();
                WriteLine();
                Indent();
                if (custom.HasConstructorArguments)
                {
                    WriteCustomAttributeConstructorArguments(custom.ConstructorArguments);
                }
                if (custom.HasProperties)
                {
                    WriteCustomAttributeProperties(custom);
                }
                if (custom.HasFields)
                {
                    WriteCustomAttributeFields(custom);
                }
                Outdent();
                WriteEndBreckets();
            }

            else
            {
                Byte[] blob = custom.GetBlob();
                Write("(");
                WriteLine();
                Indent();
                WriteByteArray(blob);
                WriteLine();
                Outdent();
                Write(")");
                WriteLine();
            }
        }
All Usage Examples Of Mono.Cecil.CustomAttribute::GetBlob