Mono.CSharp.MethodOrOperator.Define C# (CSharp) Method

Define() public method

public Define ( ) : bool
return bool
        public override bool Define()
        {
            if (!base.Define ())
                return false;

            if (!CheckBase ())
                return false;

            MemberKind kind;
            if (this is Operator)
                kind = MemberKind.Operator;
            else if (this is Destructor)
                kind = MemberKind.Destructor;
            else
                kind = MemberKind.Method;

            if (IsPartialDefinition) {
                caching_flags &= ~Flags.Excluded_Undetected;
                caching_flags |= Flags.Excluded;

                // Add to member cache only when a partial method implementation has not been found yet
                if ((caching_flags & Flags.PartialDefinitionExists) == 0) {
            //					MethodBase mb = new PartialMethodDefinitionInfo (this);

                    spec = new MethodSpec (kind, Parent.Definition, this, ReturnType, null, parameters, ModFlags);
                    Parent.MemberCache.AddMember (spec);
                }

                return true;
            }

            MethodData = new MethodData (
                this, ModFlags, flags, this, MethodBuilder, GenericMethod, base_method);

            if (!MethodData.Define (Parent.PartialContainer, GetFullName (MemberName), Report))
                return false;

            MethodBuilder = MethodData.MethodBuilder;

            spec = new MethodSpec (kind, Parent.Definition, this, ReturnType, MethodBuilder, parameters, ModFlags);
            if (MemberName.Arity > 0)
                spec.IsGeneric = true;

            Parent.MemberCache.AddMember (this, MethodBuilder.Name, spec);

            return true;
        }