示例#1
0
        private void PlugIn1_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args)
        {
            LanguageElement element = args.LanguageElement;

            if (_DisplayTile && element.ElementType == LanguageElementType.Method && CanBeRun((Method)element))
            {
                DocPoint start = new DocPoint(element.StartLine, element.StartOffset);
                args.AddAdornment(new RunMethodTileDocumentAdornment(start, start, this, (Method)element));
            }
        }
 private void PlugIn1_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args)
 {
     // You must decide if it//s appropriate to decorate the LanguageElement in question.
     if (args.LanguageElement ==  null)
         return;
     // You must select a suitable TextDocumentAdornment derived class and pass it to the AddAdornment method.
     if (args.LanguageElement.ElementType != LanguageElementType.Method)
         return;
     var Method = (Method) args.LanguageElement;
     SourceRange range = GetMethodBoxRange(args, Method);
     args.AddAdornment(new BlueBoxAdornmentFactory(range));
 }
示例#3
0
 private void PlugIn1_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args)
 {
     if (args.LanguageElement == null)
         return;
     if (args.LanguageElement.Parent == null)
         return;
     LanguageElementType[] Types = { LanguageElementType.Class, LanguageElementType.Struct, LanguageElementType.Method, LanguageElementType.Property };
     if (!Types.Contains(args.LanguageElement.Parent.ElementType))
         return;
     if (LineStartsWith(args.LanguageElement.StartLine, _settings.Prefixes))
         args.AddAdornment(new FadeOutAdornmentFactory(args.LanguageElement.Range));
 }
示例#4
0
 private void CreateAttributeShadeAdornment(DecorateLanguageElementEventArgs args,
                                            DevExpress.CodeRush.StructuralParser.Attribute attribute,
                                            Method target,
                                            TestStatus status)
 {
     if (ShadeAttribute && status != TestStatus.Pending && status != TestStatus.PassedWithChanges && status != TestStatus.FailedWithChanges)
     {
         SourceRange shadedArea = new SourceRange(
             attribute.Parent.Range.Start,
             new SourcePoint(attribute.Range.End.Line, target.NameRange.End.Offset - 1));
         args.AddAdornment(new TestAttributeShaderAdornmentDocumentAdornment(shadedArea, status, AttributeColors));
     }
 }
示例#5
0
 private void CreateErrorArrowAdornment(DecorateLanguageElementEventArgs args,
                                        DevExpress.CodeRush.StructuralParser.Attribute attribute,
                                        Method target,
                                        TestMethod test)
 {
     if (test.Status == TestStatus.Failure && DrawArrowToAssert)
     {
         ArrowDescription visibleArrow = new ArrowDescription(
             attribute,
             target,
             test.TestResults[0],
             new MessageLimiter(ShortenLongStrings, MaxContextLength, ConvertEscapeCharacters));
         args.AddAdornment(
             new FailedTestInspectorDocumentAdornment(
                 new DocPoint(attribute.StartLine, attribute.StartOffset),
                 new DocPoint(visibleArrow.End.Start.Line, visibleArrow.End.Start.Offset),
                 this,
                 visibleArrow));
     }
 }
		private void CreateErrorArrowAdornment(DecorateLanguageElementEventArgs args,
			DevExpress.CodeRush.StructuralParser.Attribute attribute,
			Method target,
			TestMethod test)
		{
			if (test.Status == TestStatus.Failure && DrawArrowToAssert)
			{
				ArrowDescription visibleArrow = new ArrowDescription(
													attribute,
													target,
													test.TestResults[0],
													new MessageLimiter(ShortenLongStrings, MaxContextLength, ConvertEscapeCharacters));
				args.AddAdornment(
					new FailedTestInspectorDocumentAdornment(
						new DocPoint(attribute.StartLine, attribute.StartOffset),
						new DocPoint(visibleArrow.End.Start.Line, visibleArrow.End.Start.Offset),
						this,
						visibleArrow));
			}
		}
 private void PlugIn1_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args)
 {
     LanguageElement element = args.LanguageElement;
     if (_DisplayTile && element.ElementType == LanguageElementType.Method && CanBeRun((Method)element))
     {
         DocPoint start = new DocPoint(element.StartLine, element.StartOffset);
         args.AddAdornment(new RunMethodTileDocumentAdornment(start, start, this, (Method)element));
     }
 }
		private void CreateAttributeShadeAdornment(DecorateLanguageElementEventArgs args, 
            DevExpress.CodeRush.StructuralParser.Attribute attribute, 
            Method target, 
            TestStatus status)
		{
			if (ShadeAttribute && status != TestStatus.Pending && status != TestStatus.PassedWithChanges && status != TestStatus.FailedWithChanges)
			{
				SourceRange shadedArea = new SourceRange(
					attribute.Parent.Range.Start, 
					new SourcePoint(attribute.Range.End.Line, target.NameRange.End.Offset - 1));
				args.AddAdornment(new TestAttributeShaderAdornmentDocumentAdornment(shadedArea, status, AttributeColors));
			}
		}