• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DocumentRegion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: WebFormsResourceExpression

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


示例17: Remove

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


示例18: SuppressWithAttribute

		public override void SuppressWithAttribute (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
		{
			var member = document.ParsedDocument.GetMember (loc.End);
			document.Editor.Insert (
				document.Editor.LocationToOffset (member.Region.BeginLine, 1),
				document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + string.Format ("[SuppressMessage(\"{0}\", \"{1}\")]" + document.Editor.EolMarker, attr.SuppressMessageCategory, attr.SuppressMessageCheckId)
			); 
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:8,代码来源:NRefactoryIssueProvider.cs


示例19: XProcessingInstruction

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


示例20: WebFormsRenderBlock

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DocumentRetriever类代码示例发布时间:2022-05-24
下一篇:
C# DocumentRange类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap