this rule does not work . i got this code from forum. please see the code
i have included both the rule and target file.
rule does not finde that i do not mark serializable for enum EntityType , please tell me what is the reason for that.
rulepublic class EnumerationsAreMarkedSerializable : BaseRule
{
/// <summary>
/// <para>
/// Initializes a new instance of the <see cref="EnumerationsAreMarkedSerializable"/> class.
/// </para>
/// </summary>
public EnumerationsAreMarkedSerializable() : base("EnumerationsAreMarkedSerializable")
{
}
/// <summary>
/// <para>
/// This member overrides <see cref="BaseIntrospectionRule.TargetVisibility"/>.
/// </para>
/// </summary>
/// <value>
/// This property is a combination of <see cref="TargetVisibilities.ExternallyVisible"/> and <see cref="TargetVisibilities.Overridable"/>.
/// </value>
public override TargetVisibilities TargetVisibility
{
get { return TargetVisibilities.ExternallyVisible | TargetVisibilities.Overridable; }
}
/// <summary>
/// <para>
/// This member overrides <see cref="BaseRule.Check(EnumNode)"/>.
/// </para>
/// </summary>
/// <param name="e">
/// The <see cref="EnumNode"/> to check.
/// </param>
/// <returns>
/// A <see cref="ProblemCollection"/> containing the problems associated with <paramref name="e"/>.
/// </returns>
public override ProblemCollection Check(EnumNode e)
{
if (e == null)
return null;
if (RuleUtilities.IsSerializable(e))
return null;
Problems.Add(new Problem(GetResolution(e.Name.Name)));
return Problems;
}
}
my target cs file is as belew
public class Class
{
int myno = 0;
public int my;
const int VIN_MU = 0;
public enum EntityType
{
Customer = 1,
FundingSource = 2,
Inventory = 3,
Lease = 4,
RefurbishmentCentre = 5,
Transaction = 6,
Vendor = 7
}
}
here i did not specify about sirialization attribute.but the code does not detect it.
pleasee tell me what is the reason.

