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


C# DocumentRegion类代码示例

本文整理汇总了C#中DocumentRegion的典型用法代码示例。如果您正苦于以下问题:C# DocumentRegion类的具体用法?C# DocumentRegion怎么用?C# DocumentRegion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetLanguageItem

		public static ISymbol GetLanguageItem (this Document document, int offset, out DocumentRegion expressionRegion)
		{
			if (document == null)
				throw new System.ArgumentNullException ("document");

			var textEditorResolver = TextEditorResolverService.GetProvider (document.Editor.MimeType);
			if (textEditorResolver != null) {
				return textEditorResolver.GetLanguageItem (document, offset, out expressionRegion);
			}
			expressionRegion = DocumentRegion.Empty;
			return null;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:12,代码来源:ITextEditorResolver.cs

示例2: AddContentPattern_Click

        private void AddContentPattern_Click(object sender, RoutedEventArgs e)
        {
            var cp = (ContentPattern) contentPaternsLst.SelectedValue;

            var region = new DocumentRegion
                             {
                                 RegionContent = cp.Id
                             };

            region.ContentPattern = cp;

            if (RegionAdded != null)
            {
                RegionAdded(this, new RegionAddedEventArgs(region));
            }

            this.Close();
        }
开发者ID:spolnik,项目名称:DocumentEditor,代码行数:18,代码来源:AddExistingRegionWindow.xaml.cs

示例3: GetLanguageItem

		public ISymbol GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, out DocumentRegion expressionRegion)
		{
			expressionRegion = DocumentRegion.Empty;
			var parsedDocument = document.ParsedDocument;
			if (parsedDocument == null)
				return null;
			var model = parsedDocument.GetAst<SemanticModel> ();
			if (model == null)
				return null;
			foreach (var symbol in model.LookupSymbols (offset)) {
				var firstDeclaration = symbol.DeclaringSyntaxReferences.FirstOrDefault ();
				if (firstDeclaration != null) {
					expressionRegion = new DocumentRegion (
						document.Editor.OffsetToLocation (firstDeclaration.Span.Start),
						document.Editor.OffsetToLocation (firstDeclaration.Span.End));
				}
				return symbol;
			}
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:20,代码来源:TextEditorResolverProvider.cs

示例4: Ok_Clicked

        private void Ok_Clicked(object sender, RoutedEventArgs e)
        {
            try
            {

                double d = 0.0;

                var region = new DocumentRegion
                                 {
                                     Uid = this.txtBoxId.Text,
                                     RegionContent = txtBoxId.Text
                                 };

                var proxy = new DocumentEditorServiceSoapClient();

                var cp = proxy.CreateContentPattern();

                cp.Id = txtBoxId.Text;
                cp.X = double.Parse(txtBoxPosX.Text);
                cp.Y = double.Parse(txtBoxosY.Text);
                cp.Width = double.Parse(txtBoxWidth.Text);
                cp.Height = double.Parse(txtBoxHeight.Text);

                proxy.SaveContentPattern(cp);

                region.ContentPattern = cp;

                if (RegionCreated != null)
                {
                    RegionCreated(this, new RegionAddedEventArgs(region));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.Close();
        }
开发者ID:spolnik,项目名称:DocumentEditor,代码行数:39,代码来源:AddRegionWindow.xaml.cs

示例5: GetTextAt

		public string GetTextAt (DocumentRegion region)
		{
			return document.GetTextAt (region);
		}
开发者ID:dodev,项目名称:monodevelop,代码行数:4,代码来源:TextEditorData.cs

示例6: FoldingRegion

		public FoldingRegion (DocumentRegion region, FoldType type) : this (null, region, type)
		{
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:3,代码来源:FoldingRegion.cs

示例7: DisableWithPragma

		public virtual void DisableWithPragma (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
		{
			throw new NotSupportedException ();
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:4,代码来源:CodeIssueProvider.cs

示例8: WebFormsHtmlEncodedExpression

		public WebFormsHtmlEncodedExpression (DocumentRegion region) : base (region)
		{
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:3,代码来源:WebFormsHtmlEncodedExpression.cs

示例9: GetBufferText

		protected string GetBufferText (DocumentRegion region)
		{
			int start = Editor.LocationToOffset (region.BeginLine, region.BeginColumn);
			int end = Editor.LocationToOffset (region.EndLine, region.EndColumn);
			if (end > start && start >= 0)
				return Editor.GetTextBetween (start, end);
			return null;
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:8,代码来源:BaseXmlEditorExtension.cs

示例10: GetTextAt

		public string GetTextAt (DocumentRegion region)
		{
			return GetTextAt (region.GetSegment (this));
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:4,代码来源:TextDocument.cs

示例11: DisableAndRestore

		public override void DisableAndRestore (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
		{
			using (document.Editor.OpenUndoGroup ()) {
				document.Editor.Insert (
					document.Editor.LocationToOffset (loc.EndLine + 1, 1),
					document.Editor.IndentationTracker.GetIndentationString (loc.End) + "// " + analysisDisableTag + "restore " + attr.AnalysisDisableKeyword + document.Editor.EolMarker
				); 
				document.Editor.Insert (
					document.Editor.LocationToOffset (loc.BeginLine, 1),
					document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + "// " + analysisDisableTag + "disable " + attr.AnalysisDisableKeyword + document.Editor.EolMarker
				); 
			}
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:13,代码来源:NRefactoryIssueProvider.cs

示例12: RazorComment

		public RazorComment (DocumentRegion region) : base (region)
		{
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:3,代码来源:RazorComment.cs

示例13: SuppressWithAttribute

		public virtual void SuppressWithAttribute (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
		{
			throw new NotSupportedException ();
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:4,代码来源:CodeIssueProvider.cs

示例14: SelectNode

		new void SelectNode (XNode n)
		{
			var region = n.Region;
			
			XElement el = n as XElement;
			if (el != null && el.IsClosed && el.ClosingTag.Region.End > region.End) {
				region = new DocumentRegion (region.Begin, el.ClosingTag.Region.End);
			}
			
			int s = Editor.LocationToOffset (region.BeginLine, region.BeginColumn );
			int e = Editor.LocationToOffset (region.EndLine, region.EndColumn);
			if (e > s && s > -1)
				Editor.SetSelection (s, e);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:14,代码来源:HtmlEditorExtension.cs

示例15: RegionAddedEventArgs

 public RegionAddedEventArgs(DocumentRegion region)
 {
     this.Region = region;
 }
开发者ID:spolnik,项目名称:DocumentEditor,代码行数:4,代码来源:RegionAddedEventArgs.cs


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