コード例 #1
0
 protected void AddFakeAttribute(bool fMono, bool fMS, string strName)
 {
     if (fMono || fMS)
     {
         var ma = new MissingAttribute(
             (fMono) ? strName : null,
             (fMS) ? strName : null);
         ma.Analyze();
         rgAttributes.Add(ma);
         nsAttributes.AddChildren(ma.Status);
     }
 }
コード例 #2
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);
        }