Click or drag to resize

AccessQueryFromObject Method

Constructs an access query from the constraints applied to a given object. The given object can be a link, such as LinkInstantaneous or LinkSpeedOfLight, or it can be a single object, such as Platform.

Namespace:  AGI.Foundation.Access
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public static AccessQuery FromObject(
	IServiceProvider constrainedObject
)

Parameters

constrainedObject
Type: SystemIServiceProvider
The link or single object from which to construct a query.

Return Value

Type: AccessQuery
The query.
Exceptions
ExceptionCondition
InvalidOperationException The constrainedObject does not have any constraints associated with it.
Remarks

This method assembles a query from the constraints attached to the specified object using IAccessConstraintsService. This service can be added to a Platform, a LinkInstantaneous, or a LinkSpeedOfLight by adding the AccessConstraintsExtension to the object's Extensions collection. If the specified constrainedObject is a link, the returned query will also include constraints attached to the Transmitter and Receiver, if any.

In all cases, this method attempts to infer the objects to which the constraints apply from their context. For example, if the Transmitter end of a link specified as the constrainedObject parameter has an ElevationAngleConstraint attached to it, the constraint's ConstrainedLink property will be set to the constrainedObject link and the ConstrainedLinkEnd property will be set to Transmitter. Instead of modifying the constraints directly, this method will copy them and include the copies in the returned query.

See Also