当前位置: 首页>>代码示例>>C#>>正文


C# TextView.SetBinding方法代码示例

本文整理汇总了C#中TextView.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.SetBinding方法的具体用法?C# TextView.SetBinding怎么用?C# TextView.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextView的用法示例。


在下文中一共展示了TextView.SetBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TextArea

		/// <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;
			textView.SetBinding(TextView.DocumentProperty, new Binding(DocumentProperty.Name) { Source = this });
			textView.SetBinding(TextView.OptionsProperty, new Binding(OptionsProperty.Name) { Source = this });
			
			textView.Services.AddService(typeof(TextArea), this);
			
			leftMargins.Add(new LineNumberMargin { TextView = textView, TextArea = this } );
			leftMargins.Add(new Line {
			                	X1 = 0, Y1 = 0, X2 = 0, Y2 = 1,
			                	StrokeDashArray = { 0, 2 },
			                	Stretch = Stretch.Fill,
			                	Stroke = Brushes.Gray,
			                	StrokeThickness = 1,
			                	StrokeDashCap = PenLineCap.Round,
			                	Margin = new Thickness(2, 0, 2, 0)
			                });
			
			textView.LineTransformers.Add(new SelectionColorizer(this));
			textView.InsertLayer(new SelectionLayer(this), KnownLayer.Selection, LayerInsertionPosition.Replace);
			
			caret = new Caret(this);
			caret.PositionChanged += (sender, e) => RequestSelectionValidation();
			
			this.DefaultInputHandler = new TextAreaDefaultInputHandler(this);
			this.ActiveInputHandler = this.DefaultInputHandler;
		}
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:34,代码来源:TextArea.cs

示例2: TextArea

        /// <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;
            textView.SetBinding(TextView.DocumentProperty, new Binding(DocumentProperty.Name) { Source = this });
            textView.SetBinding(TextView.OptionsProperty, new Binding(OptionsProperty.Name) { Source = 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();

            leftMargins.CollectionChanged += leftMargins_CollectionChanged;

            this.DefaultInputHandler = new TextAreaDefaultInputHandler(this);
            this.ActiveInputHandler = this.DefaultInputHandler;
            this.FindOnPageBrush = new SolidColorBrush(Color.FromArgb(0xAF, 0xFF, 0x42, 0x4E));
            this.FindOnPageBorder = new Pen(new SolidColorBrush(Color.FromArgb(0x9F, 0xFF, 0x42, 0x4E)), 2.0);
            this.SelectionBrush = new SolidColorBrush(Color.FromArgb(0xAF, 0x2A, 0x45, 0x79));
            this.SelectionBorder = new Pen(new SolidColorBrush(Color.FromArgb(0x9F, 0x2A, 0x45, 0x79)), 1.0);
        }
开发者ID:kjk,项目名称:kjkpub,代码行数:29,代码来源:TextArea.cs


注:本文中的TextView.SetBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。