Repository navigation
Expand file tree
/
Copy pathInterfaceDescription.cs
More file actions
71 lines (60 loc) · 2.02 KB
/
Copy pathInterfaceDescription.cs
File metadata and controls
71 lines (60 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//------------------------------------------------------------------------------
// <copyright file="InterfaceDescription.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System.Text;
using System;
namespace Microsoft.VisualStudio.TeamSystem.Data.AstGen
{
/// <summary>
/// Information about interface
/// </summary>
class InterfaceDescription : TypeDescription
{
public InterfaceDescription(String name)
: base(name)
{
}
public InterfaceDescription(String name, Int32 lineNo, Int32 colNo)
: base(name, lineNo, colNo)
{
}
/// <summary>
/// Generates spec code
/// </summary>
public override String GenerateSpec(bool generateNamespace)
{
StringBuilder sb = new StringBuilder();
if (generateNamespace)
{
sb.AppendLine(NamespaceName);
sb.AppendLine("{");
}
GenerateSummary(sb, Summary, "\t");
sb.Append("\tinternal interface " + Name);
if (!String.IsNullOrEmpty(BaseType))
sb.Append(", " + BaseType);
sb.AppendLine("\r\n\t{");
sb.AppendLine();
foreach (TypeMemberDescription member in members)
{
member.isInterfaceMember = true;
sb.Append(member.GenerateSpec());
}
sb.AppendLine();
sb.AppendLine("\t}");
if (generateNamespace)
sb.AppendLine("}");
sb.AppendLine();
return sb.ToString();
}
/// <summary>
/// Generates real code... which in this case, same as spec :-)
/// </summary>
public override String GenerateCode(bool generateNamespace, bool generateTestDLL)
{
return GenerateSpec(generateNamespace);
}
}
}