public enum LayerCacheType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum LayerCacheType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
public enum LayerCacheType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum LayerCacheType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
Member | Description |
---|---|
MaxAge | Cache will be kept between sessions and cleared every Layer.MaxDisplayCacheAge minutes. Use SetDisplayCacheMaxAge to set the cache age. Not supported for layers that support feature caching (i.e. feature service layers). |
None | Don't cache the layer locally. If the layer supports feature caching (i.e. is a feature service layer), then any existing cache is also cleared. |
Permanent | Cache will be kept between sessions and invalidated when the data is updated. Not supported for layers that support feature caching (i.e. feature service layers). |
Session | Cache will be cleared when the session ends. |
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { // change the layer cache type to maximum age //At 2.x - featureLayer.SetDisplayCacheType(ArcGIS.Core.CIM.DisplayCacheType.MaxAge); featureLayer.SetCacheOptions(LayerCacheType.MaxAge); // change from the default 5 min to 2 min featureLayer.SetDisplayCacheMaxAge(TimeSpan.FromMinutes(2)); });
System.Object
System.ValueType
System.Enum
ArcGIS.Desktop.Mapping.LayerCacheType
Target Platforms: Windows 11, Windows 10