This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get Tactical Graphic Cached Renderer Snippet (ArcObjects .NET 10.4 SDK) |
Creates a Tactical Graphic Layer and obtains a cached renderer from this layer.
///<summary>Creates a Tactical Graphic Layer and obtains a cached renderer from this layer.</summary> /// ///<returns>An ICacheRendererCollection interface.</returns> /// ///<remarks> ///IMPORTANT: For performance reasons, this should only be called once ///and a application-wide reference to the renderer returned should be ///maintained by the client (rather than making multiple or frequent calls ///to this function). ///</remarks> public ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection GetTacticalGraphicCachedRenderer() { ESRI.ArcGIS.DefenseSolutions.ITacticalGraphicLayer tacticalGraphicLayer=new ESRI.ArcGIS.DefenseSolutions.TacticalGraphicLayerClass(); ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection cachedRenderCollection=((ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection)(tacticalGraphicLayer)); // Explicit Cast ESRI.ArcGIS.DefenseSolutions.ICacheRenderer cacheRenderer=new ESRI.ArcGIS.DefenseSolutions.TacticalGraphic2525BRendererClass(); cachedRenderCollection.AddRenderer(ref cacheRenderer, 0); return cachedRenderCollection; }
'''<summary>Creates a Tactical Graphic Layer and obtains a cached renderer from this layer.</summary> ''' '''<returns>An ICacheRendererCollection interface.</returns> ''' '''<remarks> '''IMPORTANT: For performance reasons, this should only be called once '''and a application-wide reference to the renderer returned should be '''maintained by the client (rather than making multiple or frequent calls '''to this function). '''</remarks> Public Function GetTacticalGraphicCachedRenderer() As ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection Dim tacticalGraphicLayer As ESRI.ArcGIS.DefenseSolutions.ITacticalGraphicLayer=New ESRI.ArcGIS.DefenseSolutions.TacticalGraphicLayerClass Dim cachedRenderCollection As ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection=CType(tacticalGraphicLayer, ESRI.ArcGIS.DefenseSolutions.ICacheRendererCollection) ' Explict Cast Dim cacheRenderer As ESRI.ArcGIS.DefenseSolutions.ICacheRenderer=New ESRI.ArcGIS.DefenseSolutions.TacticalGraphic2525BRendererClass cachedRenderCollection.AddRenderer(cacheRenderer, 0) Return cachedRenderCollection End Function