class MissingAttribute : MissingBase
{
// e.g. <attribute name="Equals" status="missing"/>
- Object attribute;
+ Object attributeMono;
+ Object attributeMS;
+ static Hashtable htIgnore;
- public MissingAttribute (Object _attribute)
+ static MissingAttribute ()
{
- attribute = _attribute;
+ htIgnore = new Hashtable ();
+ htIgnore.Add ("System.Runtime.InteropServices.ClassInterfaceAttribute", null);
+ htIgnore.Add ("System.Diagnostics.DebuggerHiddenAttribute", null);
+ htIgnore.Add ("System.Diagnostics.DebuggerStepThroughAttribute", null);
+ htIgnore.Add ("System.Runtime.InteropServices.GuidAttribute", null);
+ htIgnore.Add ("System.Runtime.InteropServices.InterfaceTypeAttribute", null);
+ htIgnore.Add ("System.Runtime.InteropServices.ComVisibleAttribute", null);
+ }
+
+ public MissingAttribute (Object _attributeMono, Object _attributeMS)
+ {
+ attributeMono = _attributeMono;
+ attributeMS = _attributeMS;
+ m_nodeStatus = new NodeStatus (attributeMono, attributeMS);
}
public override string Name
{
- get { return attribute.ToString (); }
+ get { return Attribute.ToString (); }
}
public override string Type
get { return "attribute"; }
}
+ public override NodeStatus Analyze ()
+ {
+ return m_nodeStatus;
+ }
+
+
+ public Object Attribute
+ {
+ get { return (attributeMono != null) ? attributeMono : attributeMS; }
+ }
+
/// <summary>
/// creates a map from a list of attributes
/// the hashtable maps from name to attribute
if (attribute != null)
{
string strName = attribute.ToString ();
- map.Add (strName, attribute);
+ if (!map.Contains (strName) && !htIgnore.Contains (strName))
+ map.Add (strName, attribute);
}
}
return map;
/// <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 CompletionInfo AnalyzeAttributes (Object [] rgAttributesMono, Object [] rgAttributesMS, ArrayList rgAttributes)
+ public static NodeStatus AnalyzeAttributes (Object [] rgAttributesMono, Object [] rgAttributesMS, ArrayList rgAttributes)
{
- CompletionInfo ci = new CompletionInfo ();
+ NodeStatus nodeStatus = new NodeStatus ();
Hashtable mapAttributesMono = (rgAttributesMono == null) ? new Hashtable () : MissingAttribute.GetAttributeMap (rgAttributesMono);
Hashtable mapAttributesMS = (rgAttributesMS == null) ? new Hashtable () : MissingAttribute.GetAttributeMap (rgAttributesMS);
{
string strAttribute = attribute.ToString ();
Object attributeMono = mapAttributesMono [strAttribute];
- if (attributeMono == null)
- {
- rgAttributes.Add (new MissingAttribute (attribute));
- ci.cMissing ++;
- }
- else
- {
- rgAttributes.Add (new CompleteAttribute (attributeMono));
+ MissingAttribute ma = new MissingAttribute (attributeMono, attribute);
+ rgAttributes.Add (ma);
+ NodeStatus nsAttribute = ma.Analyze ();
+ nodeStatus.AddChildren (nsAttribute);
+
+ if (attributeMono != null)
mapAttributesMono.Remove (strAttribute);
- ci.cComplete ++;
- }
}
foreach (Object attribute in mapAttributesMono.Values)
{
- if (attribute.ToString () == "System.MonoTODOAttribute")
+ if (attribute.ToString ().EndsWith ("MonoTODOAttribute"))
{
- ci.cTodo ++;
+ 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
{
- rgAttributes.Add (new CompleteAttribute (attribute));
- ci.cComplete ++;
+ MissingAttribute ma = new MissingAttribute (attribute, null);
+ rgAttributes.Add (ma);
+ NodeStatus nsAttribute = ma.Analyze ();
+ nodeStatus.AddChildren (nsAttribute);
}
}
- return ci;
- }
- }
-
- class CompleteAttribute : MissingAttribute
- {
- public CompleteAttribute (Object _attribute) : base (_attribute) {}
-
- public override CompletionTypes Completion
- {
- get { return CompletionTypes.Complete; }
+ return nodeStatus;
}
}
}