ArcGIS Pro 2.7 API Reference Guide
SetExpirationMaxAge Method (StreamLayer)

ArcGIS.Desktop.Mapping Namespace > StreamLayer Class : SetExpirationMaxAge Method
The System.TimeSpan indicating features older than this value will be removed.
Sets the expiration maximum age for features. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetExpirationMaxAge( 
   TimeSpan expirationMaxAge
)
Public Sub SetExpirationMaxAge( _
   ByVal expirationMaxAge As TimeSpan _
) 

Parameters

expirationMaxAge
The System.TimeSpan indicating features older than this value will be removed.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Stream service data connection is null.
Remarks
SetExpirationMethod must be set to ArcGIS.Core.CIM.FeatureExpirationMethod.MaximumFeatureAge or the maximum age is ignored. When FeatureLayer.IsTrackAware is true, ExpirationMaxAge represents the maximum age within each track. Previous observations older than the maximum expiration age, compared to the latest observation in the same track, will be removed. When FeatureLayer.IsTrackAware is false, features older than the maximum expiration age, comparing to the current time, will get removed. The stream layer uses a FIFO method - the first observation in is the first one to be removed and so on. To prevent any features from being removed, set ExpirationMaxAge to 0.

Note: When a stream layer is track-aware, use FeatureLayer.SetPreviousObservationsCount to set how many previous observations will be displayed on the map. Whereas SetExpirationMaxAge defines how many previous observation will be stored in memory.

Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

StreamLayer Class
StreamLayer Members