Example #1
0
 public override void Dispose()
 {
     if (_contourClassItems != null)
     {
         foreach (ContourClass it in _contourClassItems)
         {
             it.Dispose();
         }
         _contourClassItems = null;
     }
     if (_grahpicPath != null)
     {
         _grahpicPath.Dispose();
         _grahpicPath = null;
     }
     if (_font != null)
     {
         _font.Dispose();
         _font = null;
     }
     if (_labelBrush != null)
     {
         _labelBrush.Dispose();
         _labelBrush = null;
     }
     if (_maskBrush != null)
     {
         _maskBrush.Dispose();
         _maskBrush = null;
     }
     if (_conflictor != null)
     {
         _conflictor.Dispose();
         _conflictor = null;
     }
     FreeLabelBuffers();
     if (_canvas != null)
     {
         _canvas.OnEnvelopeChanged -= _canvasSizeChanged;
         _canvasSizeChanged         = null;
     }
     base.Dispose();
 }
Example #2
0
 public void Apply(IMap map)
 {
     if (map == null)
     {
         return;
     }
     if (_map != null)
     {
         _map.Dispose();
         _map = null;
     }
     _map = map;
     (_map as Map).InternalInit(_projectionTransform, this as IFeatureRenderEnvironment);
     //
     if (_gridExchanger != null)
     {
         _gridExchanger.Enabled = false;
         _gridExchanger.Dispose();
         _gridExchanger = null;
     }
     //
     _gridExchanger = new RuntimeExchanger(this as IFeatureRenderEnvironment,
                                           _environment as IMapRefresh, _map.LayerContainer, _asyncDataArrivedNotify);
     //
     (_map as Map).InternalApplyLayers();
     //
     if (_conflictorForSymbol != null)
     {
         _conflictorForSymbol.Dispose();
     }
     _conflictorForSymbol = new SimpleConflictor(_map.ConflictDefForSymbol, _environment);
     if (_conflictorForLabel != null)
     {
         _conflictorForLabel.Dispose();
     }
     _conflictorForLabel = new PixelConflictor(_map.ConflictDefForLabel, _environment);
 }