~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Lexer/Special/Comment.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// <file>
2
 
//     <copyright see="prj:///doc/copyright.txt"/>
3
 
//     <license see="prj:///doc/license.txt"/>
4
 
//     <owner name="none" email=""/>
5
 
//     <version>$Revision: 4482 $</version>
6
 
// </file>
7
 
 
8
 
using System;
9
 
 
10
 
namespace ICSharpCode.OldNRefactory
11
 
{
12
 
        public class Comment : AbstractSpecial
13
 
        {
14
 
                CommentType   commentType;
15
 
                string        comment;
16
 
                
17
 
                public CommentType CommentType {
18
 
                        get {
19
 
                                return commentType;
20
 
                        }
21
 
                        set {
22
 
                                commentType = value;
23
 
                        }
24
 
                }
25
 
                
26
 
                public string CommentText {
27
 
                        get {
28
 
                                return comment;
29
 
                        }
30
 
                        set {
31
 
                                comment = value;
32
 
                        }
33
 
                }
34
 
                
35
 
                /// <value>
36
 
                /// Is true, when the comment is at line start or only whitespaces
37
 
                /// between line and comment start.
38
 
                /// </value>
39
 
                public bool CommentStartsLine {
40
 
                        get;
41
 
                        set;
42
 
                }
43
 
                
44
 
                public Comment(CommentType commentType, string comment, bool commentStartsLine, Location startPosition, Location endPosition)
45
 
                        : base(startPosition, endPosition)
46
 
                {
47
 
                        this.commentType   = commentType;
48
 
                        this.comment       = comment;
49
 
                        this.CommentStartsLine = commentStartsLine;
50
 
                }
51
 
                
52
 
                public override string ToString()
53
 
                {
54
 
                        return String.Format("[{0}: Type = {1}, Text = {2}, Start = {3}, End = {4}]",
55
 
                                             GetType().Name, CommentType, CommentText, StartPosition, EndPosition);
56
 
                }
57
 
                
58
 
                public override object AcceptVisitor(ISpecialVisitor visitor, object data)
59
 
                {
60
 
                        return visitor.Visit(this, data);
61
 
                }
62
 
        }
63
 
}