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

            private void ImplementObjectEquals()
            {
                m_ClassBody
                .Method <object, bool>(cls => cls.Equals)
                .Implement((m, other) => {
                    m.Return(
                        m.This <IEquatable <TypeTemplate.TPrimary> >().Func <TypeTemplate.TPrimary, bool>(intf => intf.Equals, other.CastTo <TypeTemplate.TPrimary>())
                        );
                });
            }
Esempio n. 2
0
        public void SetUp()
        {
            StatementScope.Cleanup();

            var key = new TypeKey(baseType: typeof(object));

            m_Class = m_Module.DefineClass(key.BaseType, key, Guid.NewGuid().ToString());

            var classBody = new ImplementationClassWriter <object>(m_Class);

            classBody.Method <string>(x => x.ToString).Implement(m => { });

            m_Method = m_Class.GetMemberByName <MethodMember>("ToString");
        }