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 ArrowGraphic;

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

			Initialize();
		}
Beispiel #2
0
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		protected ArrowGraphic(ArrowGraphic source, ICloningContext context)
		{
			context.CloneFields(source, this);
		}
		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 ArrowGraphic(false);
				_lineGraphic.Name = "Line";
				_lineGraphic.Color = System.Drawing.Color.Yellow;
				_lineGraphic.LineStyle = LineStyle.Dash;
				this.Graphics.Add(_lineGraphic);
			}
		}
Beispiel #4
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected ArrowGraphic(ArrowGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }