コード例 #1
0
        public override NodeStatus Analyze()
        {
            m_nodeStatus = base.Analyze();

            PropertyInfo piMono = (PropertyInfo)mInfoMono;
            PropertyInfo piMS   = (PropertyInfo)mInfoMS;

            MemberInfo miGetMono, miSetMono;

            if (piMono == null)
            {
                miGetMono = miSetMono = null;
            }
            else
            {
                miGetMono = piMono.GetGetMethod();
                miSetMono = piMono.GetSetMethod();
            }

            MemberInfo miGetMS, miSetMS;

            if (piMS == null)
            {
                miGetMS = miSetMS = null;
            }
            else
            {
                miGetMS = piMS.GetGetMethod();
                miSetMS = piMS.GetSetMethod();
            }

            if (miGetMono != null || miGetMS != null)
            {
                mmGet = new MissingMethod(miGetMono, miGetMS);
                m_nodeStatus.AddChildren(mmGet.Analyze());
            }
            if (miSetMono != null || miSetMS != null)
            {
                mmSet = new MissingMethod(miSetMono, miSetMS);
                m_nodeStatus.AddChildren(mmSet.Analyze());
            }

            if (piMono != null && piMS != null)
            {
                string strTypeMono = piMono.PropertyType.FullName;
                string strTypeMS   = piMS.PropertyType.FullName;
                if (strTypeMono != strTypeMS)
                {
                    Status.AddWarning("Invalid type: is '" + strTypeMono + "', should be '" + strTypeMS + "'");
                }
            }

            return(m_nodeStatus);
        }
コード例 #2
0
        public override NodeStatus Analyze()
        {
            m_nodeStatus = base.Analyze();

            var eiMono = (EventInfo)mInfoMono;
            var eiMS   = (EventInfo)mInfoMS;

            MemberInfo miAddMono, miRemoveMono, miRaiseMono;

            if (eiMono == null)
            {
                miAddMono = miRemoveMono = miRaiseMono = null;
            }
            else
            {
                miAddMono    = eiMono.GetAddMethod();
                miRemoveMono = eiMono.GetRemoveMethod();
                miRaiseMono  = eiMono.GetRaiseMethod();
            }

            MemberInfo miAddMS, miRemoveMS, miRaiseMS;

            if (eiMS == null)
            {
                miAddMS = miRemoveMS = miRaiseMS = null;
            }
            else
            {
                miAddMS    = eiMS.GetAddMethod();
                miRemoveMS = eiMS.GetRemoveMethod();
                miRaiseMS  = eiMS.GetRaiseMethod();
            }

            if (miAddMono != null || miAddMS != null)
            {
                mmAdd = new MissingMethod(miAddMono, miAddMS);
                m_nodeStatus.AddChildren(mmAdd.Analyze());
            }
            if (miRemoveMono != null || miRemoveMS != null)
            {
                mmRemove = new MissingMethod(miRemoveMono, miRemoveMS);
                m_nodeStatus.AddChildren(mmRemove.Analyze());
            }
            if (miRaiseMono != null || miRaiseMS != null)
            {
                mmRaise = new MissingMethod(miRemoveMono, miRemoveMS);
                m_nodeStatus.AddChildren(mmRaise.Analyze());
            }
            return(m_nodeStatus);
        }
コード例 #3
0
        public MissingMember CreateMember(MemberInfo infoMono, MemberInfo infoMS)
        {
            MemberTypes   mt = (infoMono != null) ? infoMono.MemberType : infoMS.MemberType;
            MissingMember mm;

            switch (mt)
            {
            case MemberTypes.Method:
                mm = new MissingMethod(infoMono, infoMS);
                break;

            case MemberTypes.Property:
                mm = new MissingProperty(infoMono, infoMS);
                break;

            case MemberTypes.Event:
                mm = new MissingEvent(infoMono, infoMS);
                break;

            case MemberTypes.Field:
                mm = new MissingField(infoMono, infoMS);
                break;

            case MemberTypes.Constructor:
                mm = new MissingConstructor(infoMono, infoMS);
                break;

            case MemberTypes.NestedType:
                mm = new MissingNestedType(infoMono, infoMS);
                break;

            default:
                throw new Exception("Unexpected MemberType: " + mt.ToString());
            }
            mm.Analyze();
            return(mm);
        }