OLD | NEW |
| (Empty) |
1 /// Copyright (c) Microsoft Corporation. All rights reserved. | |
2 | |
3 using System; | |
4 using System.Diagnostics.CodeAnalysis; | |
5 using System.Runtime.InteropServices; | |
6 using Microsoft.VisualStudio.Shell.Interop; | |
7 | |
8 namespace Microsoft.VisualStudio.Project | |
9 { | |
10 #region structures | |
11 [StructLayoutAttribute(LayoutKind.Sequential)] | |
12 internal struct _DROPFILES | |
13 { | |
14 public Int32 pFiles; | |
15 public Int32 X; | |
16 public Int32 Y; | |
17 public Int32 fNC; | |
18 public Int32 fWide; | |
19 } | |
20 #endregion | |
21 | |
22 #region enums | |
23 /// <summary> | |
24 /// Defines possible types of output that can produced by a language pro
ject | |
25 /// </summary> | |
26 [PropertyPageTypeConverterAttribute(typeof(OutputTypeConverter))] | |
27 public enum OutputType | |
28 { | |
29 /// <summary> | |
30 /// The output type is a class library. | |
31 /// </summary> | |
32 Library, | |
33 | |
34 /// <summary> | |
35 /// The output type is a windows executable. | |
36 /// </summary> | |
37 WinExe, | |
38 | |
39 /// <summary> | |
40 /// The output type is an executable. | |
41 /// </summary> | |
42 Exe | |
43 } | |
44 | |
45 /// <summary> | |
46 /// Debug values used by DebugModeConverter. | |
47 /// </summary> | |
48 [PropertyPageTypeConverterAttribute(typeof(DebugModeConverter))] | |
49 public enum DebugMode | |
50 { | |
51 Project, | |
52 Program, | |
53 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "URL")] | |
54 URL | |
55 } | |
56 | |
57 /// <summary> | |
58 /// An enumeration that describes the type of action to be taken by the
build. | |
59 /// </summary> | |
60 [PropertyPageTypeConverterAttribute(typeof(BuildActionConverter))] | |
61 public enum BuildAction | |
62 { | |
63 None, | |
64 Compile, | |
65 Content, | |
66 EmbeddedResource | |
67 } | |
68 | |
69 /// <summary> | |
70 /// Defines the version of the CLR that is appropriate to the project. | |
71 /// </summary> | |
72 [PropertyPageTypeConverterAttribute(typeof(PlatformTypeConverter))] | |
73 public enum PlatformType | |
74 { | |
75 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "not")] | |
76 notSpecified, | |
77 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "v")] | |
78 v1, | |
79 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "v")] | |
80 v11, | |
81 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "v")] | |
82 v2, | |
83 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "cli")] | |
84 [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBe
SpelledCorrectly", MessageId = "cli")] | |
85 cli1 | |
86 } | |
87 | |
88 /// <summary> | |
89 /// Defines the currect state of a property page. | |
90 /// </summary> | |
91 [Flags] | |
92 public enum PropPageStatus | |
93 { | |
94 | |
95 Dirty = 0x1, | |
96 | |
97 Validate = 0x2, | |
98 | |
99 Clean = 0x4 | |
100 } | |
101 | |
102 [Flags] | |
103 [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] | |
104 public enum ModuleKindFlags | |
105 { | |
106 | |
107 ConsoleApplication, | |
108 | |
109 WindowsApplication, | |
110 | |
111 DynamicallyLinkedLibrary, | |
112 | |
113 ManifestResourceFile, | |
114 | |
115 UnmanagedDynamicallyLinkedLibrary | |
116 } | |
117 | |
118 /// <summary> | |
119 /// Defines the status of the command being queried | |
120 /// </summary> | |
121 [Flags] | |
122 [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralN
ames")] | |
123 [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] | |
124 public enum QueryStatusResult | |
125 { | |
126 /// <summary> | |
127 /// The command is not supported. | |
128 /// </summary> | |
129 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "NOTSUPPORTED")] | |
130 NOTSUPPORTED = 0, | |
131 | |
132 /// <summary> | |
133 /// The command is supported | |
134 /// </summary> | |
135 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "SUPPORTED")] | |
136 SUPPORTED = 1, | |
137 | |
138 /// <summary> | |
139 /// The command is enabled | |
140 /// </summary> | |
141 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "ENABLED")] | |
142 ENABLED = 2, | |
143 | |
144 /// <summary> | |
145 /// The command is toggled on | |
146 /// </summary> | |
147 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "LATCHED")] | |
148 LATCHED = 4, | |
149 | |
150 /// <summary> | |
151 /// The command is toggled off (the opposite of LATCHED). | |
152 /// </summary> | |
153 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "NINCHED")] | |
154 NINCHED = 8, | |
155 | |
156 /// <summary> | |
157 /// The command is invisible. | |
158 /// </summary> | |
159 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "INVISIBLE")] | |
160 INVISIBLE = 16 | |
161 } | |
162 | |
163 /// <summary> | |
164 /// Defines the type of item to be added to the hierarchy. | |
165 /// </summary> | |
166 public enum HierarchyAddType | |
167 { | |
168 AddNewItem, | |
169 AddExistingItem | |
170 } | |
171 | |
172 /// <summary> | |
173 /// Defines the component from which a command was issued. | |
174 /// </summary> | |
175 public enum CommandOrigin | |
176 { | |
177 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "Ui")] | |
178 UiHierarchy, | |
179 OleCommandTarget | |
180 } | |
181 | |
182 /// <summary> | |
183 /// Defines the current status of the build process. | |
184 /// </summary> | |
185 public enum MSBuildResult | |
186 { | |
187 /// <summary> | |
188 /// The build is currently suspended. | |
189 /// </summary> | |
190 Suspended, | |
191 | |
192 /// <summary> | |
193 /// The build has been restarted. | |
194 /// </summary> | |
195 Resumed, | |
196 | |
197 /// <summary> | |
198 /// The build failed. | |
199 /// </summary> | |
200 Failed, | |
201 | |
202 /// <summary> | |
203 /// The build was successful. | |
204 /// </summary> | |
205 Successful, | |
206 } | |
207 | |
208 /// <summary> | |
209 /// Defines the type of action to be taken in showing the window frame. | |
210 /// </summary> | |
211 public enum WindowFrameShowAction | |
212 { | |
213 DoNotShow, | |
214 Show, | |
215 ShowNoActivate, | |
216 Hide, | |
217 } | |
218 | |
219 /// <summary> | |
220 /// Defines drop types | |
221 /// </summary> | |
222 internal enum DropDataType | |
223 { | |
224 None, | |
225 Shell, | |
226 VsStg, | |
227 VsRef | |
228 } | |
229 | |
230 /// <summary> | |
231 /// Used by the hierarchy node to decide which element to redraw. | |
232 /// </summary> | |
233 [Flags] | |
234 [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralN
ames")] | |
235 public enum UIHierarchyElement | |
236 { | |
237 None = 0, | |
238 | |
239 /// <summary> | |
240 /// This will be translated to VSHPROPID_IconIndex | |
241 /// </summary> | |
242 Icon = 1, | |
243 | |
244 /// <summary> | |
245 /// This will be translated to VSHPROPID_StateIconIndex | |
246 /// </summary> | |
247 [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBe
SpelledCorrectly", MessageId = "Scc")] | |
248 SccState = 2, | |
249 | |
250 /// <summary> | |
251 /// This will be translated to VSHPROPID_Caption | |
252 /// </summary> | |
253 Caption = 4 | |
254 } | |
255 | |
256 /// <summary> | |
257 /// Defines the global propeties used by the msbuild project. | |
258 /// </summary> | |
259 public enum GlobalProperty | |
260 { | |
261 /// <summary> | |
262 /// Property specifying that we are building inside VS. | |
263 /// </summary> | |
264 BuildingInsideVisualStudio, | |
265 | |
266 /// <summary> | |
267 /// The VS installation directory. This is the same as the $(Dev
EnvDir) macro. | |
268 /// </summary> | |
269 [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBe
SpelledCorrectly", MessageId = "Env")] | |
270 DevEnvDir, | |
271 | |
272 /// <summary> | |
273 /// The name of the solution the project is created. This is the
same as the $(SolutionName) macro. | |
274 /// </summary> | |
275 SolutionName, | |
276 | |
277 /// <summary> | |
278 /// The file name of the solution. This is the same as $(Solutio
nFileName) macro. | |
279 /// </summary> | |
280 SolutionFileName, | |
281 | |
282 /// <summary> | |
283 /// The full path of the solution. This is the same as the $(Sol
utionPath) macro. | |
284 /// </summary> | |
285 SolutionPath, | |
286 | |
287 /// <summary> | |
288 /// The directory of the solution. This is the same as the $(Sol
utionDir) macro. | |
289 /// </summary> | |
290 SolutionDir, | |
291 | |
292 /// <summary> | |
293 /// The extension of teh directory. This is the same as the $(So
lutionExt) macro. | |
294 /// </summary> | |
295 SolutionExt, | |
296 | |
297 /// <summary> | |
298 /// The fxcop installation directory. | |
299 /// </summary> | |
300 FxCopDir, | |
301 | |
302 /// <summary> | |
303 /// The ResolvedNonMSBuildProjectOutputs msbuild property | |
304 /// </summary> | |
305 [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBe
CasedCorrectly", MessageId = "VSIDE")] | |
306 VSIDEResolvedNonMSBuildProjectOutputs, | |
307 | |
308 /// <summary> | |
309 /// The Configuartion property. | |
310 /// </summary> | |
311 Configuration, | |
312 | |
313 /// <summary> | |
314 /// The platform property. | |
315 /// </summary> | |
316 Platform, | |
317 | |
318 /// <summary> | |
319 /// The RunCodeAnalysisOnce property | |
320 /// </summary> | |
321 RunCodeAnalysisOnce, | |
322 } | |
323 | |
324 /// <summary> | |
325 /// Defines the project trust levels. | |
326 /// </summary> | |
327 public enum ProjectTrustLevel | |
328 { | |
329 /// <summary> | |
330 /// Unknown project. | |
331 /// </summary> | |
332 Unknown = 0, | |
333 | |
334 /// <summary> | |
335 /// Trusted project. | |
336 /// </summary> | |
337 Trusted = 1 | |
338 }; | |
339 | |
340 /// <summary> | |
341 /// Defines the project load options from the ProjectSecurity dialog box | |
342 /// </summary> | |
343 public enum ProjectLoadOption | |
344 { | |
345 /// <summary> | |
346 /// Load the project normally | |
347 /// </summary> | |
348 LoadNormally = 0, | |
349 | |
350 /// <summary> | |
351 /// Load the project only for browsing | |
352 /// </summary> | |
353 LoadOnlyForBrowsing = 1, | |
354 | |
355 /// <summary> | |
356 /// Do not load the project. | |
357 /// </summary> | |
358 DonNotLoad = 2 | |
359 }; | |
360 | |
361 /// <summary> | |
362 /// Defines the components in the msbuild project file that will be chec
ked. | |
363 /// </summary> | |
364 /// <devremark>The order actually specifies the order in which security
checks are made. Thus this is important.</devremark> | |
365 public enum ProjectFileSecurityCheck | |
366 { | |
367 /// <summary> | |
368 /// Not checked | |
369 /// </summary> | |
370 NotChecked = 0, | |
371 | |
372 /// <summary> | |
373 /// The imports. | |
374 /// </summary> | |
375 Import, | |
376 | |
377 /// <summary> | |
378 /// The imports in the user file. | |
379 /// </summary> | |
380 ImportInUserFile, | |
381 | |
382 /// <summary> | |
383 /// The properties. | |
384 /// </summary> | |
385 Property, | |
386 | |
387 /// <summary> | |
388 /// The targets. | |
389 /// </summary> | |
390 Target, | |
391 | |
392 /// <summary> | |
393 /// The items. | |
394 /// </summary> | |
395 Item, | |
396 | |
397 /// <summary> | |
398 /// The using tasks in the project file. | |
399 /// </summary> | |
400 UsingTask, | |
401 | |
402 /// <summary> | |
403 /// The using task in the user file. | |
404 /// </summary> | |
405 UsingTaskInUserFile, | |
406 | |
407 /// <summary> | |
408 /// The item location. | |
409 /// </summary> | |
410 ItemLocation, | |
411 | |
412 /// <summary> | |
413 /// Unknowm | |
414 /// </summary> | |
415 External | |
416 }; | |
417 | |
418 #endregion | |
419 | |
420 public class AfterProjectFileOpenedEventArgs : EventArgs | |
421 { | |
422 #region fields | |
423 private bool added; | |
424 #endregion | |
425 | |
426 #region properties | |
427 /// <summary> | |
428 /// True if the project is added to the solution after the solut
ion is opened. false if the project is added to the solution while the solution
is being opened. | |
429 /// </summary> | |
430 [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledP
rivateCode")] | |
431 internal bool Added | |
432 { | |
433 get { return this.added; } | |
434 } | |
435 #endregion | |
436 | |
437 #region ctor | |
438 internal AfterProjectFileOpenedEventArgs(bool added) | |
439 { | |
440 this.added = added; | |
441 } | |
442 #endregion | |
443 } | |
444 | |
445 public class BeforeProjectFileClosedEventArgs : EventArgs | |
446 { | |
447 #region fields | |
448 private bool removed; | |
449 #endregion | |
450 | |
451 #region properties | |
452 /// <summary> | |
453 /// true if the project was removed from the solution before the
solution was closed. false if the project was removed from the solution while t
he solution was being closed. | |
454 /// </summary> | |
455 [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledP
rivateCode")] | |
456 internal bool Removed | |
457 { | |
458 get { return this.removed; } | |
459 } | |
460 #endregion | |
461 | |
462 #region ctor | |
463 internal BeforeProjectFileClosedEventArgs(bool removed) | |
464 { | |
465 this.removed = removed; | |
466 } | |
467 #endregion | |
468 } | |
469 | |
470 /// <summary> | |
471 /// This class is used for the events raised by a HierarchyNode object. | |
472 /// </summary> | |
473 internal class HierarchyNodeEventArgs : EventArgs | |
474 { | |
475 private HierarchyNode child; | |
476 | |
477 internal HierarchyNodeEventArgs(HierarchyNode child) | |
478 { | |
479 this.child = child; | |
480 } | |
481 | |
482 public HierarchyNode Child | |
483 { | |
484 get { return this.child; } | |
485 } | |
486 } | |
487 | |
488 /// <summary> | |
489 /// Event args class for triggering file change event arguments. | |
490 /// </summary> | |
491 internal class FileChangedOnDiskEventArgs : EventArgs | |
492 { | |
493 #region Private fields | |
494 /// <summary> | |
495 /// File name that was changed on disk. | |
496 /// </summary> | |
497 private string fileName; | |
498 | |
499 /// <summary> | |
500 /// The item ide of the file that has changed. | |
501 /// </summary> | |
502 private uint itemID; | |
503 | |
504 /// <summary> | |
505 /// The reason the file has changed on disk. | |
506 /// </summary> | |
507 private _VSFILECHANGEFLAGS fileChangeFlag; | |
508 #endregion | |
509 | |
510 /// <summary> | |
511 /// Constructs a new event args. | |
512 /// </summary> | |
513 /// <param name="fileName">File name that was changed on disk.</
param> | |
514 /// <param name="id">The item id of the file that was changed on
disk.</param> | |
515 internal FileChangedOnDiskEventArgs(string fileName, uint id, _V
SFILECHANGEFLAGS flag) | |
516 { | |
517 this.fileName = fileName; | |
518 this.itemID = id; | |
519 this.fileChangeFlag = flag; | |
520 } | |
521 | |
522 /// <summary> | |
523 /// Gets the file name that was changed on disk. | |
524 /// </summary> | |
525 /// <value>The file that was changed on disk.</value> | |
526 internal string FileName | |
527 { | |
528 get | |
529 { | |
530 return this.fileName; | |
531 } | |
532 } | |
533 | |
534 /// <summary> | |
535 /// Gets item id of the file that has changed | |
536 /// </summary> | |
537 /// <value>The file that was changed on disk.</value> | |
538 internal uint ItemID | |
539 { | |
540 get | |
541 { | |
542 return this.itemID; | |
543 } | |
544 } | |
545 | |
546 /// <summary> | |
547 /// The reason while the file has chnaged on disk. | |
548 /// </summary> | |
549 /// <value>The reason while the file has chnaged on disk.</value
> | |
550 internal _VSFILECHANGEFLAGS FileChangeFlag | |
551 { | |
552 get | |
553 { | |
554 return this.fileChangeFlag; | |
555 } | |
556 } | |
557 } | |
558 | |
559 /// <summary> | |
560 /// Defines the event args for the active configuration chnage event. | |
561 /// </summary> | |
562 public class ActiveConfigurationChangedEventArgs : EventArgs | |
563 { | |
564 #region Private fields | |
565 /// <summary> | |
566 /// The hierarchy whose configuration has changed | |
567 /// </summary> | |
568 private IVsHierarchy hierarchy; | |
569 #endregion | |
570 | |
571 /// <summary> | |
572 /// Constructs a new event args. | |
573 /// </summary> | |
574 /// <param name="fileName">The hierarchy that has changed its co
nfiguration.</param> | |
575 internal ActiveConfigurationChangedEventArgs(IVsHierarchy hierar
chy) | |
576 { | |
577 this.hierarchy = hierarchy; | |
578 } | |
579 | |
580 /// <summary> | |
581 /// The hierarchy whose configuration has changed | |
582 /// </summary> | |
583 internal IVsHierarchy Hierarchy | |
584 { | |
585 get | |
586 { | |
587 return this.hierarchy; | |
588 } | |
589 } | |
590 } | |
591 | |
592 /// <summary> | |
593 /// Argument of the event raised when a project property is changed. | |
594 /// </summary> | |
595 [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrec
tSuffix")] | |
596 public class ProjectPropertyChangedArgs : EventArgs | |
597 { | |
598 private string propertyName; | |
599 private string oldValue; | |
600 private string newValue; | |
601 | |
602 internal ProjectPropertyChangedArgs(string propertyName, string
oldValue, string newValue) | |
603 { | |
604 this.propertyName = propertyName; | |
605 this.oldValue = oldValue; | |
606 this.newValue = newValue; | |
607 } | |
608 | |
609 public string NewValue | |
610 { | |
611 get { return newValue; } | |
612 } | |
613 | |
614 public string OldValue | |
615 { | |
616 get { return oldValue; } | |
617 } | |
618 | |
619 public string PropertyName | |
620 { | |
621 get { return propertyName; } | |
622 } | |
623 } | |
624 } | |
OLD | NEW |