public static AccessQuery FromObject( IServiceProvider constrainedObject )
Public Shared Function FromObject ( constrainedObject As IServiceProvider ) As AccessQuery
public: static AccessQuery^ FromObject( IServiceProvider^ constrainedObject )
static member FromObject : constrainedObject : IServiceProvider -> AccessQuery
|InvalidOperationException||The constrainedObject does not have any constraints associated with it.|
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.