Пример #1
0
        public void InvalidateLayers()
        {
            if (ShapeLayer.InvalidateVisual != null)
            {
                ShapeLayer.InvalidateVisual();
            }

            if (BlockLayer.InvalidateVisual != null)
            {
                BlockLayer.InvalidateVisual();
            }

            if (PinLayer.InvalidateVisual != null)
            {
                PinLayer.InvalidateVisual();
            }

            if (WireLayer.InvalidateVisual != null)
            {
                WireLayer.InvalidateVisual();
            }

            if (OverlayLayer.InvalidateVisual != null)
            {
                OverlayLayer.InvalidateVisual();
            }
        }
		public override void Attach(ITextEditor editor)
		{
			if (editor == null)
				return;
			
			var textEditor = editor.GetService(typeof(TextEditor)) as TextEditor;
			if (textEditor != null) {
				pinLayer = new PinLayer(textEditor.TextArea);
				textEditor.TextArea.TextView.InsertLayer(
					pinLayer,
					KnownLayer.Caret,
					LayerInsertionPosition.Above);
			}
			
			_editor = editor;
			CreatePins(_editor);
			
			base.Attach(editor);
		}
		public override void Detach()
		{
			ClosePins(_editor);
			pinLayer = null;
			base.Detach();
		}