diff options
Diffstat (limited to 'Prebuild/src/Core/Targets/ToolInfo.cs')
-rw-r--r-- | Prebuild/src/Core/Targets/ToolInfo.cs | 356 |
1 files changed, 178 insertions, 178 deletions
diff --git a/Prebuild/src/Core/Targets/ToolInfo.cs b/Prebuild/src/Core/Targets/ToolInfo.cs index 935c674..984d20e 100644 --- a/Prebuild/src/Core/Targets/ToolInfo.cs +++ b/Prebuild/src/Core/Targets/ToolInfo.cs | |||
@@ -4,194 +4,194 @@ using System.Text; | |||
4 | 4 | ||
5 | namespace Prebuild.Core.Targets | 5 | namespace Prebuild.Core.Targets |
6 | { | 6 | { |
7 | /// <summary> | 7 | /// <summary> |
8 | /// | 8 | /// |
9 | /// </summary> | 9 | /// </summary> |
10 | public struct ToolInfo | 10 | public struct ToolInfo |
11 | { | 11 | { |
12 | string name; | 12 | string name; |
13 | string guid; | 13 | string guid; |
14 | string fileExtension; | 14 | string fileExtension; |
15 | string xmlTag; | 15 | string xmlTag; |
16 | string importProject; | 16 | string importProject; |
17 | 17 | ||
18 | /// <summary> | 18 | /// <summary> |
19 | /// Gets or sets the name. | 19 | /// Gets or sets the name. |
20 | /// </summary> | 20 | /// </summary> |
21 | /// <value>The name.</value> | 21 | /// <value>The name.</value> |
22 | public string Name | 22 | public string Name |
23 | { | 23 | { |
24 | get | 24 | get |
25 | { | 25 | { |
26 | return name; | 26 | return name; |
27 | } | 27 | } |
28 | set | 28 | set |
29 | { | 29 | { |
30 | name = value; | 30 | name = value; |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | /// <summary> | 34 | /// <summary> |
35 | /// Gets or sets the GUID. | 35 | /// Gets or sets the GUID. |
36 | /// </summary> | 36 | /// </summary> |
37 | /// <value>The GUID.</value> | 37 | /// <value>The GUID.</value> |
38 | public string Guid | 38 | public string Guid |
39 | { | 39 | { |
40 | get | 40 | get |
41 | { | 41 | { |
42 | return guid; | 42 | return guid; |
43 | } | 43 | } |
44 | set | 44 | set |
45 | { | 45 | { |
46 | guid = value; | 46 | guid = value; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Gets or sets the file extension. | 51 | /// Gets or sets the file extension. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <value>The file extension.</value> | 53 | /// <value>The file extension.</value> |
54 | public string FileExtension | 54 | public string FileExtension |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return fileExtension; | 58 | return fileExtension; |
59 | } | 59 | } |
60 | set | 60 | set |
61 | { | 61 | { |
62 | fileExtension = value; | 62 | fileExtension = value; |
63 | } | 63 | } |
64 | } | 64 | } |
65 | public string LanguageExtension | 65 | public string LanguageExtension |
66 | { | 66 | { |
67 | get | 67 | get |
68 | { | 68 | { |
69 | switch (this.Name) | 69 | switch (this.Name) |
70 | { | 70 | { |
71 | case "C#": | 71 | case "C#": |
72 | return ".cs"; | 72 | return ".cs"; |
73 | case "VisualBasic": | 73 | case "VisualBasic": |
74 | return ".vb"; | 74 | return ".vb"; |
75 | case "Boo": | 75 | case "Boo": |
76 | return ".boo"; | 76 | return ".boo"; |
77 | default: | 77 | default: |
78 | return ".cs"; | 78 | return ".cs"; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | /// <summary> | 82 | /// <summary> |
83 | /// Gets or sets the XML tag. | 83 | /// Gets or sets the XML tag. |
84 | /// </summary> | 84 | /// </summary> |
85 | /// <value>The XML tag.</value> | 85 | /// <value>The XML tag.</value> |
86 | public string XmlTag | 86 | public string XmlTag |
87 | { | 87 | { |
88 | get | 88 | get |
89 | { | 89 | { |
90 | return xmlTag; | 90 | return xmlTag; |
91 | } | 91 | } |
92 | set | 92 | set |
93 | { | 93 | { |
94 | xmlTag = value; | 94 | xmlTag = value; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Gets or sets the import project property. | 99 | /// Gets or sets the import project property. |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <value>The ImportProject tag.</value> | 101 | /// <value>The ImportProject tag.</value> |
102 | public string ImportProject | 102 | public string ImportProject |
103 | { | 103 | { |
104 | get | 104 | get |
105 | { | 105 | { |
106 | return importProject; | 106 | return importProject; |
107 | } | 107 | } |
108 | set | 108 | set |
109 | { | 109 | { |
110 | importProject = value; | 110 | importProject = value; |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. | 115 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <param name="name">The name.</param> | 117 | /// <param name="name">The name.</param> |
118 | /// <param name="guid">The GUID.</param> | 118 | /// <param name="guid">The GUID.</param> |
119 | /// <param name="fileExtension">The file extension.</param> | 119 | /// <param name="fileExtension">The file extension.</param> |
120 | /// <param name="xml">The XML.</param> | 120 | /// <param name="xml">The XML.</param> |
121 | /// <param name="importProject">The import project.</param> | 121 | /// <param name="importProject">The import project.</param> |
122 | public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject) | 122 | public ToolInfo(string name, string guid, string fileExtension, string xml, string importProject) |
123 | { | 123 | { |
124 | this.name = name; | 124 | this.name = name; |
125 | this.guid = guid; | 125 | this.guid = guid; |
126 | this.fileExtension = fileExtension; | 126 | this.fileExtension = fileExtension; |
127 | this.xmlTag = xml; | 127 | this.xmlTag = xml; |
128 | this.importProject = importProject; | 128 | this.importProject = importProject; |
129 | } | 129 | } |
130 | 130 | ||
131 | /// <summary> | 131 | /// <summary> |
132 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. | 132 | /// Initializes a new instance of the <see cref="ToolInfo"/> class. |
133 | /// </summary> | 133 | /// </summary> |
134 | /// <param name="name">The name.</param> | 134 | /// <param name="name">The name.</param> |
135 | /// <param name="guid">The GUID.</param> | 135 | /// <param name="guid">The GUID.</param> |
136 | /// <param name="fileExtension">The file extension.</param> | 136 | /// <param name="fileExtension">The file extension.</param> |
137 | /// <param name="xml">The XML.</param> | 137 | /// <param name="xml">The XML.</param> |
138 | public ToolInfo(string name, string guid, string fileExtension, string xml) | 138 | public ToolInfo(string name, string guid, string fileExtension, string xml) |
139 | { | 139 | { |
140 | this.name = name; | 140 | this.name = name; |
141 | this.guid = guid; | 141 | this.guid = guid; |
142 | this.fileExtension = fileExtension; | 142 | this.fileExtension = fileExtension; |
143 | this.xmlTag = xml; | 143 | this.xmlTag = xml; |
144 | this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets"; | 144 | this.importProject = "$(MSBuildBinPath)\\Microsoft." + xml + ".Targets"; |
145 | } | 145 | } |
146 | 146 | ||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Equals operator | 148 | /// Equals operator |
149 | /// </summary> | 149 | /// </summary> |
150 | /// <param name="obj">ToolInfo to compare</param> | 150 | /// <param name="obj">ToolInfo to compare</param> |
151 | /// <returns>true if toolInfos are equal</returns> | 151 | /// <returns>true if toolInfos are equal</returns> |
152 | public override bool Equals(object obj) | 152 | public override bool Equals(object obj) |
153 | { | 153 | { |
154 | if (obj == null) | 154 | if (obj == null) |
155 | { | 155 | { |
156 | throw new ArgumentNullException("obj"); | 156 | throw new ArgumentNullException("obj"); |
157 | } | 157 | } |
158 | if (obj.GetType() != typeof(ToolInfo)) | 158 | if (obj.GetType() != typeof(ToolInfo)) |
159 | return false; | 159 | return false; |
160 | 160 | ||
161 | ToolInfo c = (ToolInfo)obj; | 161 | ToolInfo c = (ToolInfo)obj; |
162 | return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject)); | 162 | return ((this.name == c.name) && (this.guid == c.guid) && (this.fileExtension == c.fileExtension) && (this.importProject == c.importProject)); |
163 | } | 163 | } |
164 | 164 | ||
165 | /// <summary> | 165 | /// <summary> |
166 | /// Equals operator | 166 | /// Equals operator |
167 | /// </summary> | 167 | /// </summary> |
168 | /// <param name="c1">ToolInfo to compare</param> | 168 | /// <param name="c1">ToolInfo to compare</param> |
169 | /// <param name="c2">ToolInfo to compare</param> | 169 | /// <param name="c2">ToolInfo to compare</param> |
170 | /// <returns>True if toolInfos are equal</returns> | 170 | /// <returns>True if toolInfos are equal</returns> |
171 | public static bool operator ==(ToolInfo c1, ToolInfo c2) | 171 | public static bool operator ==(ToolInfo c1, ToolInfo c2) |
172 | { | 172 | { |
173 | return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag)); | 173 | return ((c1.name == c2.name) && (c1.guid == c2.guid) && (c1.fileExtension == c2.fileExtension) && (c1.importProject == c2.importProject) && (c1.xmlTag == c2.xmlTag)); |
174 | } | 174 | } |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// Not equals operator | 177 | /// Not equals operator |
178 | /// </summary> | 178 | /// </summary> |
179 | /// <param name="c1">ToolInfo to compare</param> | 179 | /// <param name="c1">ToolInfo to compare</param> |
180 | /// <param name="c2">ToolInfo to compare</param> | 180 | /// <param name="c2">ToolInfo to compare</param> |
181 | /// <returns>True if toolInfos are not equal</returns> | 181 | /// <returns>True if toolInfos are not equal</returns> |
182 | public static bool operator !=(ToolInfo c1, ToolInfo c2) | 182 | public static bool operator !=(ToolInfo c1, ToolInfo c2) |
183 | { | 183 | { |
184 | return !(c1 == c2); | 184 | return !(c1 == c2); |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// Hash Code | 188 | /// Hash Code |
189 | /// </summary> | 189 | /// </summary> |
190 | /// <returns>Hash code</returns> | 190 | /// <returns>Hash code</returns> |
191 | public override int GetHashCode() | 191 | public override int GetHashCode() |
192 | { | 192 | { |
193 | return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode(); | 193 | return name.GetHashCode() ^ guid.GetHashCode() ^ this.fileExtension.GetHashCode() ^ this.importProject.GetHashCode() ^ this.xmlTag.GetHashCode(); |
194 | 194 | ||
195 | } | 195 | } |
196 | } | 196 | } |
197 | } | 197 | } |