コード例 #1
0
        public ToDoAssembly(string _strName, Assembly _assMono, Assembly _assMS)
        {
            strName = _strName;
            assMono = _assMono;
            assMS   = _assMS;

            rgTypesMono  = assMono.GetTypes();
            rgTypesMS    = assMS.GetTypes();
            m_nodeStatus = new NodeStatus(_assMono, _assMS);
        }
コード例 #2
0
        /// <summary>
        /// first we go through all the microsoft types adding any mono types that match, or missing types otherwise
        /// then we go through the unmatched mono types adding those
        /// uses a hashtable to speed up lookups
        /// </summary>
        /// <returns></returns>
        public override NodeStatus Analyze()
        {
            Hashtable htMono = new Hashtable();

            if (rgTypesMono != null)
            {
                foreach (Type t in rgTypesMono)
                {
                    htMono.Add(t.FullName, t);
                }
            }
            if (rgTypesMS != null)
            {
                foreach (Type t in rgTypesMS)
                {
                    Type        tMono = (Type)htMono [t.FullName];
                    MissingType mt    = null;
                    if (tMono == null)
                    {
                        if (t.IsPublic && !htGhostTypes.Contains(t.FullName))
                        {
                            mt = new MissingType(null, t);
                        }
                    }
                    else
                    {
                        if (t.IsPublic)
                        {
                            htMono.Remove(t.FullName);
                            mt = new MissingType(tMono, t);
                        }
                    }
                    if (mt != null)
                    {
                        NodeStatus nsType = mt.Analyze();
                        m_nodeStatus.AddChildren(nsType);
                        rgTypes.Add(mt);
                    }
                }
            }
            // do any mono types that aren't in microsoft's namespace
            foreach (Type tMono in htMono.Values)
            {
                if (tMono.IsPublic)
                {
                    MissingType tdt    = new MissingType(tMono, null);
                    NodeStatus  nsType = tdt.Analyze();
                    m_nodeStatus.AddChildren(nsType);
                    rgTypes.Add(tdt);
                }
            }
            return(m_nodeStatus);
        }
コード例 #3
0
        /// <summary>
        /// analyzes two sets of reflected attributes, generates a list
        /// of MissingAttributes according to the completion of the first set wrt the second.
        /// </summary>
        /// <param name="rgAttributesMono">mono attributes</param>
        /// <param name="rgAttributesMS">microsoft attributes</param>
        /// <param name="rgAttributes">where the results are put</param>
        /// <returns>completion info for the whole set</returns>
        public static NodeStatus AnalyzeAttributes(Object [] rgAttributesMono, Object [] rgAttributesMS, ArrayList rgAttributes)
        {
            var nodeStatus = new NodeStatus();

            var mapAttributesMono = (rgAttributesMono == null) ? new Hashtable() : GetAttributeMap(rgAttributesMono);
            var mapAttributesMS   = (rgAttributesMS == null) ? new Hashtable() : GetAttributeMap(rgAttributesMS);

            foreach (var attribute in mapAttributesMS.Values)
            {
                string strAttribute  = attribute.ToString();
                var    attributeMono = mapAttributesMono [strAttribute];
                var    ma            = new MissingAttribute(attributeMono, attribute);
                rgAttributes.Add(ma);
                var nsAttribute = ma.Analyze();
                nodeStatus.AddChildren(nsAttribute);

                if (attributeMono != null)
                {
                    mapAttributesMono.Remove(strAttribute);
                }
            }
            foreach (var attribute in mapAttributesMono.Values)
            {
                if (attribute.ToString().EndsWith("MonoTODOAttribute"))
                {
                    nodeStatus.SetError(ErrorTypes.Todo);
                    //nodeStatus.statusCountsChildren.errorCounts.Add (ErrorTypes.Todo);
                    //nodeStatus.statusCountsTotal.errorCounts.Add (ErrorTypes.Todo);
                    //nodeStatus.cTodo ++;	// this is where ALL the 'todo's come from
                }
                else if (attribute.ToString().EndsWith("DllImportAttribute") || attribute.ToString().EndsWith("PreserveSigAttribute"))
                {
                    // Ignore these
                }
                else
                {
                    var ma = new MissingAttribute(attribute, null);
                    rgAttributes.Add(ma);
                    var nsAttribute = ma.Analyze();
                    nodeStatus.AddChildren(nsAttribute);
                }
            }
            return(nodeStatus);
        }
コード例 #4
0
 // e.g. <method name="Equals" status="missing"/>
 public MissingInterface(Type _ifaceMono, Type _ifaceMS)
 {
     ifaceMono    = _ifaceMono;
     ifaceMS      = _ifaceMS;
     m_nodeStatus = new NodeStatus(ifaceMono, ifaceMS);
 }
コード例 #5
0
 public void SubChildren(NodeStatus statusChild)
 {
     statusCountsTotal.Sub(statusChild.statusCountsTotal);
     statusCountsTotal.Sub(statusChild.status);
     statusCountsChildren.Sub(statusChild.status);
 }
コード例 #6
0
 public void AddChildren(NodeStatus statusChild)
 {
     statusCountsTotal.Add(statusChild.statusCountsTotal);
     statusCountsTotal.Add(statusChild.status);
     statusCountsChildren.Add(statusChild.status);
 }
コード例 #7
0
 public MissingType(Type _typeMono, Type _typeMS)
 {
     typeMono     = _typeMono;
     typeMS       = _typeMS;
     m_nodeStatus = new NodeStatus(_typeMono, _typeMS);
 }
コード例 #8
0
        /// <summary>
        /// Creates an XmlElement grouping together a set of sub-elements
        /// </summary>
        /// <param name="name">the name of the element to create</param>
        /// <param name="rgMembers">a list of sub-elements</param>
        /// <param name="doc">the document in which to create the element</param>
        /// <returns></returns>
        public static XmlElement CreateMemberCollectionElement(string name, ArrayList rgMembers, NodeStatus ns, XmlDocument doc)
        {
            XmlElement element = null;

            if (rgMembers != null && rgMembers.Count > 0)
            {
                element = doc.CreateElement(name);
                foreach (MissingBase mm in rgMembers)
                {
                    element.AppendChild(mm.CreateXML(doc));
                }

                //ns.SetAttributes (element);
            }
            return(element);
        }
コード例 #9
0
 public MissingMember(MemberInfo infoMono, MemberInfo infoMS)
 {
     mInfoMono    = infoMono;
     mInfoMS      = infoMS;
     m_nodeStatus = new NodeStatus(infoMono, infoMS);
 }
コード例 #10
0
 public MissingAttribute(Object _attributeMono, Object _attributeMS)
 {
     attributeMono = _attributeMono;
     attributeMS   = _attributeMS;
     m_nodeStatus  = new NodeStatus(attributeMono, attributeMS);
 }