While analyzing the NodeType the FxCop 1.35 is skipping the Struct which itself is a NodeType. I tried the following code while overriding the Check(NodeType) but still the structs are not getting trapped
public override ProblemCollection Check(TypeNode type) { if(type == null) { return null; } switch (type.NodeType) { case NodeType.Class: return Check((Class)type);
case NodeType.Interface: return Check((Interface)type);
case NodeType.EnumNode: return Check((EnumNode)type);
case NodeType.Struct: return Check((Struct)type); } return base.Check(type); }
I tried one workaround for this by overriding the Check(Module) method and checking for each type. There I can trap the Structs.
But problem with this is if the user unchecks the target assembly and keep the struct checked in the window under FxCop's rules tab then this struct wont be trapped or checked.
If anybody knows the solution to it, please let me know.
Visual Studio Team System42
|