PageRenderTime 136ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/Code/Foundation.Build.VisualBasic6.VisualStudioIntegration/ProjectBase/StructuresEnums.cs

https://github.com/DavidMoore/Foundation
C# | 562 lines | 291 code | 75 blank | 196 comment | 0 complexity | af25ffde89f90d7190b06373c53ab5fb MD5 | raw file
  1. /* ****************************************************************************
  2. *
  3. * Copyright (c) Microsoft Corporation.
  4. *
  5. * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
  6. * copy of the license can be found in the License.html file at the root of this distribution. If
  7. * you cannot locate the Apache License, Version 2.0, please send an email to
  8. * ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
  9. * by the terms of the Apache License, Version 2.0.
  10. *
  11. * You must not remove this notice, or any other, from this software.
  12. *
  13. * ***************************************************************************/
  14. using System;
  15. using System.Diagnostics.CodeAnalysis;
  16. using System.Runtime.InteropServices;
  17. using Microsoft.VisualStudio.Shell.Interop;
  18. namespace Microsoft.VisualStudio.Project
  19. {
  20. #region structures
  21. [StructLayoutAttribute(LayoutKind.Sequential)]
  22. internal struct _DROPFILES
  23. {
  24. public Int32 pFiles;
  25. public Int32 X;
  26. public Int32 Y;
  27. public Int32 fNC;
  28. public Int32 fWide;
  29. }
  30. #endregion
  31. #region enums
  32. /// <summary>
  33. /// The type of build performed.
  34. /// </summary>
  35. public enum BuildKind
  36. {
  37. Sync,
  38. Async
  39. }
  40. /// <summary>
  41. /// Defines possible types of output that can produced by a language project
  42. /// </summary>
  43. [PropertyPageTypeConverterAttribute(typeof(OutputTypeConverter))]
  44. public enum OutputType
  45. {
  46. /// <summary>
  47. /// The output type is a class library.
  48. /// </summary>
  49. Library,
  50. /// <summary>
  51. /// The output type is a windows executable.
  52. /// </summary>
  53. WinExe,
  54. /// <summary>
  55. /// The output type is an executable.
  56. /// </summary>
  57. Exe
  58. }
  59. /// <summary>
  60. /// Debug values used by DebugModeConverter.
  61. /// </summary>
  62. [PropertyPageTypeConverterAttribute(typeof(DebugModeConverter))]
  63. public enum DebugMode
  64. {
  65. Project,
  66. Program,
  67. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "URL")]
  68. URL
  69. }
  70. /// <summary>
  71. /// An enumeration that describes the type of action to be taken by the build.
  72. /// </summary>
  73. [PropertyPageTypeConverterAttribute(typeof(BuildActionConverter))]
  74. public enum BuildAction
  75. {
  76. None,
  77. Compile,
  78. Content,
  79. EmbeddedResource
  80. }
  81. /// <summary>
  82. /// Defines the version of the CLR that is appropriate to the project.
  83. /// </summary>
  84. [PropertyPageTypeConverterAttribute(typeof(PlatformTypeConverter))]
  85. public enum PlatformType
  86. {
  87. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "not")]
  88. notSpecified,
  89. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  90. v1,
  91. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  92. v11,
  93. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  94. v2,
  95. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  96. v3,
  97. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  98. v35,
  99. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "v")]
  100. v4,
  101. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "cli")]
  102. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "cli")]
  103. cli1
  104. }
  105. /// <summary>
  106. /// Defines the currect state of a property page.
  107. /// </summary>
  108. [Flags]
  109. public enum PropPageStatus
  110. {
  111. Dirty = 0x1,
  112. Validate = 0x2,
  113. Clean = 0x4
  114. }
  115. [Flags]
  116. [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
  117. public enum ModuleKindFlags
  118. {
  119. ConsoleApplication,
  120. WindowsApplication,
  121. DynamicallyLinkedLibrary,
  122. ManifestResourceFile,
  123. UnmanagedDynamicallyLinkedLibrary
  124. }
  125. /// <summary>
  126. /// Defines the status of the command being queried
  127. /// </summary>
  128. [Flags]
  129. [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames")]
  130. [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
  131. public enum QueryStatusResult
  132. {
  133. /// <summary>
  134. /// The command is not supported.
  135. /// </summary>
  136. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "NOTSUPPORTED")]
  137. NOTSUPPORTED = 0,
  138. /// <summary>
  139. /// The command is supported
  140. /// </summary>
  141. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SUPPORTED")]
  142. SUPPORTED = 1,
  143. /// <summary>
  144. /// The command is enabled
  145. /// </summary>
  146. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ENABLED")]
  147. ENABLED = 2,
  148. /// <summary>
  149. /// The command is toggled on
  150. /// </summary>
  151. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "LATCHED")]
  152. LATCHED = 4,
  153. /// <summary>
  154. /// The command is toggled off (the opposite of LATCHED).
  155. /// </summary>
  156. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "NINCHED")]
  157. NINCHED = 8,
  158. /// <summary>
  159. /// The command is invisible.
  160. /// </summary>
  161. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "INVISIBLE")]
  162. INVISIBLE = 16
  163. }
  164. /// <summary>
  165. /// Defines the type of item to be added to the hierarchy.
  166. /// </summary>
  167. public enum HierarchyAddType
  168. {
  169. AddNewItem,
  170. AddExistingItem
  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:IdentifiersShouldBeCasedCorrectly", MessageId = "Ui")]
  178. UiHierarchy,
  179. OleCommandTarget
  180. }
  181. /// <summary>
  182. /// Defines the current status of the build process.
  183. /// </summary>
  184. public enum MSBuildResult
  185. {
  186. /// <summary>
  187. /// The build is currently suspended.
  188. /// </summary>
  189. Suspended,
  190. /// <summary>
  191. /// The build has been restarted.
  192. /// </summary>
  193. Resumed,
  194. /// <summary>
  195. /// The build failed.
  196. /// </summary>
  197. Failed,
  198. /// <summary>
  199. /// The build was successful.
  200. /// </summary>
  201. Successful,
  202. }
  203. /// <summary>
  204. /// Defines the type of action to be taken in showing the window frame.
  205. /// </summary>
  206. public enum WindowFrameShowAction
  207. {
  208. DoNotShow,
  209. Show,
  210. ShowNoActivate,
  211. Hide,
  212. }
  213. /// <summary>
  214. /// Defines drop types
  215. /// </summary>
  216. internal enum DropDataType
  217. {
  218. None,
  219. Shell,
  220. VsStg,
  221. VsRef
  222. }
  223. /// <summary>
  224. /// Used by the hierarchy node to decide which element to redraw.
  225. /// </summary>
  226. [Flags]
  227. [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames")]
  228. public enum UIHierarchyElement
  229. {
  230. None = 0,
  231. /// <summary>
  232. /// This will be translated to VSHPROPID_IconIndex
  233. /// </summary>
  234. Icon = 1,
  235. /// <summary>
  236. /// This will be translated to VSHPROPID_StateIconIndex
  237. /// </summary>
  238. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Scc")]
  239. SccState = 2,
  240. /// <summary>
  241. /// This will be translated to VSHPROPID_Caption
  242. /// </summary>
  243. Caption = 4
  244. }
  245. /// <summary>
  246. /// Defines the global propeties used by the msbuild project.
  247. /// </summary>
  248. public enum GlobalProperty
  249. {
  250. /// <summary>
  251. /// Property specifying that we are building inside VS.
  252. /// </summary>
  253. BuildingInsideVisualStudio,
  254. /// <summary>
  255. /// The VS installation directory. This is the same as the $(DevEnvDir) macro.
  256. /// </summary>
  257. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Env")]
  258. DevEnvDir,
  259. /// <summary>
  260. /// The name of the solution the project is created. This is the same as the $(SolutionName) macro.
  261. /// </summary>
  262. SolutionName,
  263. /// <summary>
  264. /// The file name of the solution. This is the same as $(SolutionFileName) macro.
  265. /// </summary>
  266. SolutionFileName,
  267. /// <summary>
  268. /// The full path of the solution. This is the same as the $(SolutionPath) macro.
  269. /// </summary>
  270. SolutionPath,
  271. /// <summary>
  272. /// The directory of the solution. This is the same as the $(SolutionDir) macro.
  273. /// </summary>
  274. SolutionDir,
  275. /// <summary>
  276. /// The extension of teh directory. This is the same as the $(SolutionExt) macro.
  277. /// </summary>
  278. SolutionExt,
  279. /// <summary>
  280. /// The fxcop installation directory.
  281. /// </summary>
  282. FxCopDir,
  283. /// <summary>
  284. /// The ResolvedNonMSBuildProjectOutputs msbuild property
  285. /// </summary>
  286. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "VSIDE")]
  287. VSIDEResolvedNonMSBuildProjectOutputs,
  288. /// <summary>
  289. /// The Configuartion property.
  290. /// </summary>
  291. Configuration,
  292. /// <summary>
  293. /// The platform property.
  294. /// </summary>
  295. Platform,
  296. /// <summary>
  297. /// The RunCodeAnalysisOnce property
  298. /// </summary>
  299. RunCodeAnalysisOnce,
  300. /// <summary>
  301. /// The VisualStudioStyleErrors property
  302. /// </summary>
  303. VisualStudioStyleErrors,
  304. }
  305. #endregion
  306. public class AfterProjectFileOpenedEventArgs : EventArgs
  307. {
  308. #region fields
  309. private bool added;
  310. #endregion
  311. #region properties
  312. /// <summary>
  313. /// True if the project is added to the solution after the solution is opened. false if the project is added to the solution while the solution is being opened.
  314. /// </summary>
  315. [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
  316. internal bool Added
  317. {
  318. get { return this.added; }
  319. }
  320. #endregion
  321. #region ctor
  322. internal AfterProjectFileOpenedEventArgs(bool added)
  323. {
  324. this.added = added;
  325. }
  326. #endregion
  327. }
  328. public class BeforeProjectFileClosedEventArgs : EventArgs
  329. {
  330. #region fields
  331. private bool removed;
  332. #endregion
  333. #region properties
  334. /// <summary>
  335. /// true if the project was removed from the solution before the solution was closed. false if the project was removed from the solution while the solution was being closed.
  336. /// </summary>
  337. [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
  338. internal bool Removed
  339. {
  340. get { return this.removed; }
  341. }
  342. #endregion
  343. #region ctor
  344. internal BeforeProjectFileClosedEventArgs(bool removed)
  345. {
  346. this.removed = removed;
  347. }
  348. #endregion
  349. }
  350. /// <summary>
  351. /// This class is used for the events raised by a HierarchyNode object.
  352. /// </summary>
  353. internal class HierarchyNodeEventArgs : EventArgs
  354. {
  355. private HierarchyNode child;
  356. internal HierarchyNodeEventArgs(HierarchyNode child)
  357. {
  358. this.child = child;
  359. }
  360. public HierarchyNode Child
  361. {
  362. get { return this.child; }
  363. }
  364. }
  365. /// <summary>
  366. /// Event args class for triggering file change event arguments.
  367. /// </summary>
  368. internal class FileChangedOnDiskEventArgs : EventArgs
  369. {
  370. #region Private fields
  371. /// <summary>
  372. /// File name that was changed on disk.
  373. /// </summary>
  374. private string fileName;
  375. /// <summary>
  376. /// The item ide of the file that has changed.
  377. /// </summary>
  378. private uint itemID;
  379. /// <summary>
  380. /// The reason the file has changed on disk.
  381. /// </summary>
  382. private _VSFILECHANGEFLAGS fileChangeFlag;
  383. #endregion
  384. /// <summary>
  385. /// Constructs a new event args.
  386. /// </summary>
  387. /// <param name="fileName">File name that was changed on disk.</param>
  388. /// <param name="id">The item id of the file that was changed on disk.</param>
  389. internal FileChangedOnDiskEventArgs(string fileName, uint id, _VSFILECHANGEFLAGS flag)
  390. {
  391. this.fileName = fileName;
  392. this.itemID = id;
  393. this.fileChangeFlag = flag;
  394. }
  395. /// <summary>
  396. /// Gets the file name that was changed on disk.
  397. /// </summary>
  398. /// <value>The file that was changed on disk.</value>
  399. internal string FileName
  400. {
  401. get
  402. {
  403. return this.fileName;
  404. }
  405. }
  406. /// <summary>
  407. /// Gets item id of the file that has changed
  408. /// </summary>
  409. /// <value>The file that was changed on disk.</value>
  410. internal uint ItemID
  411. {
  412. get
  413. {
  414. return this.itemID;
  415. }
  416. }
  417. /// <summary>
  418. /// The reason while the file has chnaged on disk.
  419. /// </summary>
  420. /// <value>The reason while the file has chnaged on disk.</value>
  421. internal _VSFILECHANGEFLAGS FileChangeFlag
  422. {
  423. get
  424. {
  425. return this.fileChangeFlag;
  426. }
  427. }
  428. }
  429. /// <summary>
  430. /// Defines the event args for the active configuration chnage event.
  431. /// </summary>
  432. public class ActiveConfigurationChangedEventArgs : EventArgs
  433. {
  434. #region Private fields
  435. /// <summary>
  436. /// The hierarchy whose configuration has changed
  437. /// </summary>
  438. private IVsHierarchy hierarchy;
  439. #endregion
  440. /// <summary>
  441. /// Constructs a new event args.
  442. /// </summary>
  443. /// <param name="fileName">The hierarchy that has changed its configuration.</param>
  444. internal ActiveConfigurationChangedEventArgs(IVsHierarchy hierarchy)
  445. {
  446. this.hierarchy = hierarchy;
  447. }
  448. /// <summary>
  449. /// The hierarchy whose configuration has changed
  450. /// </summary>
  451. internal IVsHierarchy Hierarchy
  452. {
  453. get
  454. {
  455. return this.hierarchy;
  456. }
  457. }
  458. }
  459. /// <summary>
  460. /// Argument of the event raised when a project property is changed.
  461. /// </summary>
  462. [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
  463. public class ProjectPropertyChangedArgs : EventArgs
  464. {
  465. private string propertyName;
  466. private string oldValue;
  467. private string newValue;
  468. internal ProjectPropertyChangedArgs(string propertyName, string oldValue, string newValue)
  469. {
  470. this.propertyName = propertyName;
  471. this.oldValue = oldValue;
  472. this.newValue = newValue;
  473. }
  474. public string NewValue
  475. {
  476. get { return newValue; }
  477. }
  478. public string OldValue
  479. {
  480. get { return oldValue; }
  481. }
  482. public string PropertyName
  483. {
  484. get { return propertyName; }
  485. }
  486. }
  487. }