StateFilterAttribute Class
Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)
The following example shows usage of the StateFilter attribute.
namespace ATSvc.Model { public static class ModelProgram { /// <summary> /// A filter on states. Filters out states where job count exceeds the bound. /// </summary> [StateFilter] static bool JobCountBound { get { return JobBound == 0 || jobs.Count <= JobBound; } } } }
A state filter is a Boolean condition causing states to be excluded from exploration. The StateFilter attribute indicates that its Boolean target property, field, or parameterless method is a state filter.
A value of TRUE indicates that the annotated method or property is evaluated in a given state; FALSE indicates exclusion from exploration.
If the target of a StateFilter is a method, it can be static or instance-based. If it is instance-based, the state filter is said to hold if the return value is TRUE for all reachable instances of the type. The return type of the method MUST be System.Boolean.
For more information about using attributes, see Extending Metadata Using Attributes.
Development Platforms
Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003