Compartilhar via


ProbeAttribute Class

Marks the target method or property as a state probe. State probes provide state information that can be accessed when examining exploration results for the model.

Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property, AllowMultiple=false, Inherited=false)] 
public sealed class ProbeAttribute : Attribute

Example

The following example shows a probe from the Sailboat code sample.

static int x, y;

/// <summary>
/// State description, which could be represented as a probe value.
/// </summary>
[Probe]
public static string Position()
{
    return string.Format("{0},{1}", x, y);
}

Remarks

When applied to a method or property in a model program, the ProbeAttribute attribute creates a probe, which is state information that can be accessed when examining exploration results for the model. The name of the probe is set to the name of the member to which the Probe attribute is applied. The Probe attribute can be applied to static, parameterless methods and to static, parameterless properties that contain a get method.

The state browser in the Exploration Graph Viewer displays probes in a separate category, and you can create a view definition that uses a defined probe to change the displayed label of each state, or to hide or group states. For more information about using probes to modify the representation of an exploration graph, see View Definitions.

For more uses of probes, see Probe Attribute.

For more information about using attributes, see Extending Metadata Using Attributes.

Inheritance Hierarchy

System.Object
   System.Attribute
    Microsoft.Modeling.ProbeAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

Change History

See Also

Reference

ProbeAttribute Members
Microsoft.Modeling Namespace

Other Resources

Probe Attribute
Rule Attribute
Model Programs
Model Program Attributes