Пример #1
0
        /// <summary>
        /// Creates a new TextArea instance.
        /// </summary>
        protected TextArea(TextView textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException("textView");
            }
            this.textView = textView;
            this.Options  = textView.Options;

            selection = emptySelection = new EmptySelection(this);

            textView.Services.AddService(typeof(TextArea), this);

            textView.LineTransformers.Add(new SelectionColorizer(this));
            textView.InsertLayer(new SelectionLayer(this), KnownLayer.Selection, LayerInsertionPosition.Replace);

            caret = new Caret(this);
            caret.PositionChanged += (sender, e) => RequestSelectionValidation();
            caret.PositionChanged += CaretPositionChanged;
            AttachTypingEvents();
            ime = new ImeSupport(this);

            leftMargins.CollectionChanged += leftMargins_CollectionChanged;

            this.DefaultInputHandler = new TextAreaDefaultInputHandler(this);
            this.ActiveInputHandler  = this.DefaultInputHandler;
        }
Пример #2
0
		/// <summary>
		/// Creates a new TextArea instance.
		/// </summary>
		protected TextArea(TextView textView)
		{
			if (textView == null)
				throw new ArgumentNullException("textView");
			this.textView = textView;
			this.Options = textView.Options;
			
			selection = emptySelection = new EmptySelection(this);
			
			textView.Services.AddService(typeof(TextArea), this);
			
			textView.LineTransformers.Add(new SelectionColorizer(this));
			textView.InsertLayer(new SelectionLayer(this), KnownLayer.Selection, LayerInsertionPosition.Replace);
			
			caret = new Caret(this);
			caret.PositionChanged += (sender, e) => RequestSelectionValidation();
			caret.PositionChanged += CaretPositionChanged;
			AttachTypingEvents();
			ime = new ImeSupport(this);
			
			leftMargins.CollectionChanged += leftMargins_CollectionChanged;
			
			this.DefaultInputHandler = new TextAreaDefaultInputHandler(this);
			this.ActiveInputHandler = this.DefaultInputHandler;
		}
Пример #3
0
        /// <summary>
        /// Creates a new TextArea instance.
        /// </summary>
        protected TextArea(TextView textView)
        {
            if (textView == null)
                throw new ArgumentNullException(nameof(textView));
            this.textView = textView;
            Options = textView.Options;

            selection = emptySelection = new EmptySelection(this);

            textView.Services.AddService(typeof(TextArea), this);
            textView.InsertLayer(new SelectionLayer(this), KnownLayer.Selection, LayerInsertionPosition.Replace);

            caret = new Caret(this);
            caret.PositionChanged += (sender, e) => RequestSelectionValidation();

            leftMargins.CollectionChanged += leftMargins_CollectionChanged;

            DefaultInputHandler = new TextAreaDefaultInputHandler(this);
            ActiveInputHandler = DefaultInputHandler;
        }
Пример #4
0
        /// <summary>
        /// Creates a new TextArea instance.
        /// </summary>
        protected TextArea(TextView textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException(nameof(textView));
            }
            this.textView = textView;
            Options       = textView.Options;

            selection = emptySelection = new EmptySelection(this);

            textView.Services.AddService(typeof(TextArea), this);
            textView.InsertLayer(new SelectionLayer(this), KnownLayer.Selection, LayerInsertionPosition.Replace);

            caret = new Caret(this);
            caret.PositionChanged += (sender, e) => RequestSelectionValidation();

            leftMargins.CollectionChanged += leftMargins_CollectionChanged;

            DefaultInputHandler = new TextAreaDefaultInputHandler(this);
            ActiveInputHandler  = DefaultInputHandler;
        }