/// <summary>
        /// Cloning constructor.
        /// </summary>
        /// <param name="source">The source object from which to clone.</param>
        /// <param name="context">The cloning context object.</param>
        protected FusionOverlayCompositeGraphic(FusionOverlayCompositeGraphic source, ICloningContext context)
        {
            context.CloneFields(source, this);

            _overlayFrameDataReference = source._overlayFrameDataReference.Clone();
            _overlayFrameDataReference.FusionOverlayFrameData.Unloaded += HandleOverlayFrameDataUnloaded;
        }
Пример #2
0
        private void OnCloneComplete()
        {
            _fusionOverlayLayer = (CompositeGraphic)CollectionUtils.SelectFirst(base.CompositeImageGraphic.Graphics,
                                                                                g => g is CompositeGraphic && g.Name == _fusionOverlayLayerName);

            if (_fusionOverlayLayer != null)
            {
                _fusionOverlayComposite = (FusionOverlayCompositeGraphic)CollectionUtils.SelectFirst(_fusionOverlayLayer.Graphics, g => g is FusionOverlayCompositeGraphic);
            }

            Initialize();
        }
Пример #3
0
        private void Initialize()
        {
            if (_fusionOverlayLayer == null)
            {
                _fusionOverlayLayer = new CompositeGraphic {
                    Name = _fusionOverlayLayerName
                };

                // insert the fusion graphics layer right after the base image graphic (both contain domain-level graphics)
                base.CompositeImageGraphic.Graphics.Insert(base.CompositeImageGraphic.Graphics.IndexOf(this.ImageGraphic) + 1, _fusionOverlayLayer);
            }

            if (_fusionOverlayComposite == null)
            {
                _fusionOverlayComposite = new FusionOverlayCompositeGraphic(_overlayFrameDataReference.FusionOverlayFrameData);
                _fusionOverlayLayer.Graphics.Add(_fusionOverlayComposite);
            }
        }
Пример #4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _fusionOverlayLayer     = null;
                _fusionOverlayComposite = null;

                if (_baseFrameReference != null)
                {
                    _baseFrameReference.Dispose();
                    _baseFrameReference = null;
                }

                if (_overlayFrameDataReference != null)
                {
                    _overlayFrameDataReference.Dispose();
                    _overlayFrameDataReference = null;
                }
            }

            base.Dispose(disposing);
        }