本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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();
}
示例5: GetTextAt
public string GetTextAt (DocumentRegion region)
{
return document.GetTextAt (region);
}
示例6: FoldingRegion
public FoldingRegion (DocumentRegion region, FoldType type) : this (null, region, type)
{
}
示例7: DisableWithPragma
public virtual void DisableWithPragma (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
{
throw new NotSupportedException ();
}
示例8: WebFormsHtmlEncodedExpression
public WebFormsHtmlEncodedExpression (DocumentRegion region) : base (region)
{
}
示例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;
}
示例10: GetTextAt
public string GetTextAt (DocumentRegion region)
{
return GetTextAt (region.GetSegment (this));
}
示例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
);
}
}
示例12: RazorComment
public RazorComment (DocumentRegion region) : base (region)
{
}
示例13: SuppressWithAttribute
public virtual void SuppressWithAttribute (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
{
throw new NotSupportedException ();
}
示例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);
}
示例15: RegionAddedEventArgs
public RegionAddedEventArgs(DocumentRegion region)
{
this.Region = region;
}