Ejemplo n.º 1
0
		public ImeHighlight(EditorView editorView)
		{
			_editorView = editorView;
			_editorHelper = new SourceEditorViewHelper(_editorView);
			Color highlightColor = SystemColors.HighlightColor;
			Color color = Color.FromArgb(0x60, highlightColor.R, highlightColor.G, highlightColor.B);
			Color color3 = Color.FromArgb(180, (Byte)(highlightColor.R / 3), (Byte)(highlightColor.G / 3), (Byte)(highlightColor.B / 3));
			_baseBrush = new SolidColorBrush(color);
			_blinkBrush = new SolidColorBrush(color3);
			_provisionalSpan = null;
			Int32 caretBlinkTime = User32.GetCaretBlinkTime();
			if (caretBlinkTime > 0)
			{
				_blinkTimer = new Timer((Double)caretBlinkTime);
				_blinkTimer.AutoReset = true;
			}
			base.Visibility = Visibility.Hidden;
			base.IsVisibleChanged += new DependencyPropertyChangedEventHandler(this.OnThisVisibilityChanged);
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TextLineVisual"/> class.
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="textView"/> is <see langword="null"/>.</para>
		/// </exception>
		public TextLineVisual(ITextView textView, IList<TextLine> textLines, TextSpan lineSpan, Int32 newLineLength, IList<Int32> virtualCharacters)
		{
			if (textView == null)
			{
				throw new ArgumentNullException("textView");
			}
			_textView = textView;
			_textLines = textLines;
			_newLineLength = newLineLength;
			_horizontalOffset = 0;
			_verticalOffset = 0;
			_startPoint = new TextPoint(lineSpan.TextBuffer, lineSpan.Start);
			_length = lineSpan.Length;
			_transform = new TranslateTransform(this.HorizontalOffset, this.VerticalOffset);
			base.Transform = _transform;
			if (virtualCharacters != null)
			{
				this.CreateVirtualCharacterLookup(virtualCharacters);
			}
			this.ComputeLineProperties();
			this.RenderText();
		}
Ejemplo n.º 3
0
		/// <summary>
		/// </summary>
		public Boolean Intersects(TextSpan span)
		{
			if (span.TextBuffer == this.TextBuffer)
			{
				return base.Intersects(span);
			}

			return false;
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TextSpan"/> class.
		/// </summary>
		/// <exception cref="ArgumentNullException"><paramref name="span"/> is <see langword="null"/>.</exception>
		public TextSpan(TextSpan span)
			: base(span)
		{
			if (span == null)
			{
				throw new ArgumentNullException("span");
			}
			this.Initialize(span.TextBuffer, span.TrackingMode);
		}
Ejemplo n.º 5
0
		void ICodeEditor.Select(Int32 start, Int32 length)
		{
			TextSpan span = new TextSpan(this.TextBuffer, start, length);
			this.TextView.Selection.Select(span);
		}
Ejemplo n.º 6
0
		void ICodeEditor.EnsureSpanVisible(Int32 start, Int32 length)
		{
			TextSpan span = new TextSpan(this.TextBuffer, start, length);
			new TextViewHelper(this.TextView).EnsureSpanVisible(span, 0, 0);
		}