- jonno_simpletestrunner_demo.zip
- Jonno Nunit Helper.AddIn
- Jonno.AddIns.Entities.dll
- Jonno.AddIns.Logic.VisualStudioSpecific.dll
- Jonno.AddIns.NunitHelper.dll
- Jonno.Extensions.dll
- Jonno.SimpleTestRunner.Entities.dll
- Jonno.SimpleTestRunner.exe
- Jonno.SimpleTestRunner.Logic.dll
- Jonno.Utilities.dll
- test framework helper options.xml
- jonno_simpletestrunner_src.zip
- Jonno Nunit Helper.AddIn
- Jonno.AddIns.Entities.UnitTests
- Jonno.AddIns.Entities
- Jonno.AddIns.Logic.EnvDTE
- Jonno.AddIns.NunitHelper
- Jonno.Extensions.UnitTests
- Jonno.Extensions
- Jonno.Logic.SimpleTestRunner
- Jonno.SimpleTestRunner.Entities
- Jonno.SimpleTestRunner
- Jonno.Utilities
- Nunit helper.sln
|
//-------------------------------------------------------------------------------------
// <copyright file='CompositeCodeElement.cs' company='Jonno'>
// Copyright (c) Paul Johnson 2009 (email:paulmichael.johnson@gmail.com)
// Code is released under The Code Project Open License (CPOL).
// </copyright>
//-------------------------------------------------------------------------------------
namespace Jonno.AddIns.Entities
{
using System.Collections.Generic;
using Jonno.Extensions;
public enum ElementType
{
Namespace,
Import,
Class,
Interface,
Event,
Constructor,
Field,
Property,
Delegate,
Enum,
Method,
Structure,
Attribute,
Parameter,
Unknown
}
public enum AccessType
{
Public,
Protected,
Private,
Internal,
NotApplicable
}
public class CompositeCodeElement
{
public CompositeCodeElement()
{
this.Attributes = new List<string>();
}
public string Id { get; set; }
public AccessType Access { get; set; }
public ElementType Kind { get; set; }
public string ParentId { get; set; }
public int StartAbsoluteCharacterOffset { get; set; }
public int EndAbsoluteCharacterOffset { get; set; }
public bool IsShared { get; set; }
public bool IsConstant { get; set; }
public string Comment { get; set; }
public string DocComment { get; set; }
public string Text { get; set; }
public string FullName { get; set; }
public string Name { get; set; }
public string FullText
{
get
{
return this.GetFullText();
}
}
private List<string> Attributes { get; set; }
public void AddAttribute(string attributeText)
{
this.Attributes.Add(attributeText);
}
public bool HasAttribute(string attributeText)
{
return this.Attributes.Contains(attributeText);
}
private string GetFullText()
{
if (!string.IsNullOrEmpty(this.DocComment))
{
return this.ConvertDocCommentToDisplayString() + this.Text;
}
if (!string.IsNullOrEmpty(this.Comment))
{
return this.Comment + this.Text;
}
return this.Text;
}
private string ConvertDocCommentToDisplayString()
{
// replace the doc attribute with empty string
var replaced = this.DocComment.Replace("<doc>", string.Empty);
replaced = replaced.Left(replaced.IndexOf("\r\n</doc>"));
// replace all new lines with newline and the "/// " chars
replaced = replaced.Replace("\r\n", "\r\n/// ");
replaced = replaced + "\r\n";
return replaced;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have over 15 years of development experience, in many different languages, programming styles and platforms. Currently working as a C# coder, and residing in north Herts in the UK. I love lean software development and anything that reduces a grind to leave more time for useful coding!