Mono.Cecil.Cil.CodeWriter.IsEmptyMethodBody C# (CSharp) Method

IsEmptyMethodBody() static private method

static private IsEmptyMethodBody ( MethodBody body ) : bool
body MethodBody
return bool
        static bool IsEmptyMethodBody(MethodBody body)
        {
            return body.instructions.IsNullOrEmpty ()
                && body.variables.IsNullOrEmpty ();
        }

Usage Example

        public uint WriteMethodBody(MethodDefinition method)
        {
            uint num = this.BeginMethod();

            if (!CodeWriter.IsUnresolved(method))
            {
                if (CodeWriter.IsEmptyMethodBody(method.Body))
                {
                    return((uint)0);
                }
                this.WriteResolvedMethodBody(method);
            }
            else
            {
                if (method.rva == 0)
                {
                    return((uint)0);
                }
                this.WriteUnresolvedMethodBody(method);
            }
            this.Align(4);
            this.EndMethod();
            return(num);
        }