ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StreamLayer Class / GetExpirationMaxCount Method
Example

In This Topic
    GetExpirationMaxCount Method (StreamLayer)
    In This Topic
    Gets the expiration maximum feature count. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetExpirationMaxCount() As ULong
    public ulong GetExpirationMaxCount()

    Return Value

    The System.UInt64 indicating the ExpirationMaxCount
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Stream service data connection is null.
    Remarks
    When FeatureLayer.IsTrackAware is true, ExpirationMaxCount represents the maximum number of features that will be stored per track. Otherwise, it represents the maximum number of features.
    Example
    Set Stream Layer properties via the CIM
    {
      //The layer must be track aware and spatial
      if (streamLayer.TrackType != TrackType.Spatial)
      {
        // not track aware and spatial
      }
      // Note: call within QueuedTask.Run()
      {
        //get the CIM Definition
        var def = streamLayer.GetDefinition() as CIMFeatureLayer;
        //set the number of previous observations, 
        def.PreviousObservationsCount = (int)streamLayer.GetExpirationMaxCount() - 1;
        //set show previous observations and track lines to true
        def.ShowPreviousObservations = true;
        def.ShowTracks = true;
        //commit the changes
        streamLayer.SetDefinition(def);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also