Example #1
0
        private void Initialize()
        {
            if (_textControlGraphic == null)
            {
                _textControlGraphic       = InitializeTextControlGraphic(new InvariantTextPrimitive());
                _textControlGraphic.Name  = "Text";
                _textControlGraphic.Color = System.Drawing.Color.Yellow;
                this.Graphics.Add(_textControlGraphic);
            }

            this.TextGraphic.VisualStateChanged += OnTextVisualStateChanged;

            if (_pointControlGraphic == null)
            {
                _pointControlGraphic      = InitializePointControlGraphic(new AnchorPointGraphic());
                _pointControlGraphic.Name = "Point";
                this.Graphics.Add(_pointControlGraphic);
            }

            if (_lineGraphic == null)
            {
                _lineGraphic           = new CrosshairGraphic(false);
                _lineGraphic.Name      = "Line";
                _lineGraphic.Color     = System.Drawing.Color.Yellow;
                _lineGraphic.LineStyle = LineStyle.Dash;
                Graphics.Add(_lineGraphic);
            }
        }
Example #2
0
        private void OnCloneComplete()
        {
            _textControlGraphic = (CollectionUtils.SelectFirst(base.Graphics,
                                                               delegate(IGraphic test) { return(test.Name == "Text"); }) as IControlGraphic);

            _pointControlGraphic = (CollectionUtils.SelectFirst(base.Graphics,
                                                                delegate(IGraphic test) { return(test.Name == "Point"); }) as IControlGraphic);

            _lineGraphic = CollectionUtils.SelectFirst(base.Graphics,
                                                       delegate(IGraphic test) { return(test.Name == "Line"); }) as CrosshairGraphic;

            Platform.CheckForNullReference(_lineGraphic, "_lineGraphic");
            Platform.CheckForNullReference(_pointControlGraphic, "_pointControlGraphic");
            Platform.CheckForNullReference(_textControlGraphic, "_textControlGraphic");

            Initialize();
        }
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected CrosshairGraphic(CrosshairGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }
        private void OnCloneComplete()
        {
            _textControlGraphic = (CollectionUtils.SelectFirst(base.Graphics,
                                                               delegate(IGraphic test) { return test.Name == "Text"; }) as IControlGraphic);

            _pointControlGraphic = (CollectionUtils.SelectFirst(base.Graphics,
                                                                delegate(IGraphic test) { return test.Name == "Point"; }) as IControlGraphic);

            _lineGraphic = CollectionUtils.SelectFirst(base.Graphics,
                                                       delegate(IGraphic test) { return test.Name == "Line"; }) as CrosshairGraphic;

            Platform.CheckForNullReference(_lineGraphic, "_lineGraphic");
            Platform.CheckForNullReference(_pointControlGraphic, "_pointControlGraphic");
            Platform.CheckForNullReference(_textControlGraphic, "_textControlGraphic");

            Initialize();
        }
        private void Initialize()
        {
            if (_textControlGraphic == null)
            {
                _textControlGraphic = InitializeTextControlGraphic(new InvariantTextPrimitive());
                _textControlGraphic.Name = "Text";
                _textControlGraphic.Color = System.Drawing.Color.Yellow;
                this.Graphics.Add(_textControlGraphic);
            }

            this.TextGraphic.VisualStateChanged += OnTextVisualStateChanged;

            if (_pointControlGraphic == null)
            {
                _pointControlGraphic = InitializePointControlGraphic(new AnchorPointGraphic());
                _pointControlGraphic.Name = "Point";
                this.Graphics.Add(_pointControlGraphic);
            }

            if (_lineGraphic == null)
            {
                _lineGraphic = new CrosshairGraphic(false);
                _lineGraphic.Name = "Line";
                _lineGraphic.Color = System.Drawing.Color.Yellow;
                _lineGraphic.LineStyle = LineStyle.Dash;
                Graphics.Add(_lineGraphic);
            }
        }
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected CrosshairGraphic(CrosshairGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }