Esempio n. 1
0
            //-------------------------------------------------------------------------------------------------------------------------------------------------

            private void ImplementObjectEquals()
            {
                m_ClassBody
                .Method <object, bool>(cls => cls.Equals)
                .Implement((m, other) => {
                    m.Return(
                        m.This <IEquatable <TT.TPrimary> >().Func <TT.TPrimary, bool>(intf => intf.Equals, other.CastTo <TT.TPrimary>())
                        );
                });
            }
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        private void InternalOnMethod <TBase>(IHappilClassBody <TBase> classDefinition, MethodInfo info)
        {
            var decoration = new MethodDecorationBuilder();

            OnMethod(info, decoration);

            if (!decoration.IsEmpty)
            {
                classDefinition.Method(info).Decorate(
                    attributes: decoration.GetAttributes,
                    body: decoration.ApplyBody);
            }
        }