private void OnCloneComplete()
        {
            _shaft     = CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return(graphic is LinePrimitive); }) as LinePrimitive;
            _crosshair = CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return(graphic is InvariantCrosshairGraphic); }) as InvariantCrosshairGraphic;

            Initialize();
        }
        private void Initialize()
        {
            if (_shaft == null)
            {
                base.Graphics.Add(_shaft = new LinePrimitive());
            }

            if (_crosshair == null)
            {
                base.Graphics.Add(_crosshair = new InvariantCrosshairGraphic());
                _crosshair.Visible           = _showCrosshair;
            }

            _shaft.Point1Changed += OnShaftPoint1Changed;
            _shaft.Point2Changed += OnShaftPoint2Changed;
        }
        private void OnCloneComplete()
        {
            _shaft = CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return graphic is LinePrimitive; }) as LinePrimitive;
            _crosshair = CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return graphic is InvariantCrosshairGraphic; }) as InvariantCrosshairGraphic;

            Initialize();
        }
        private void Initialize()
        {
            if (_shaft == null)
            {
                base.Graphics.Add(_shaft = new LinePrimitive());
            }

            if (_crosshair == null)
            {
                base.Graphics.Add(_crosshair = new InvariantCrosshairGraphic());
                _crosshair.Visible = _showCrosshair;
            }

            _shaft.Point1Changed += OnShaftPoint1Changed;
            _shaft.Point2Changed += OnShaftPoint2Changed;
        }
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected InvariantCrosshairGraphic(InvariantCrosshairGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected InvariantCrosshairGraphic(InvariantCrosshairGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }