PageRenderTime 63ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/IronPython_Main/Tools/IronStudio/IronStudio/VisualStudio/Project/Interfaces.cs

#
C# | 168 lines | 72 code | 18 blank | 78 comment | 0 complexity | 051a1208fd06aabae7a35af71d2c0a4f MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, CPL-1.0, CC-BY-SA-3.0, BSD-3-Clause, ISC, AGPL-3.0, LGPL-2.1, Apache-2.0
  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.Collections.Generic;
  16. using System.Diagnostics.CodeAnalysis;
  17. using System.Runtime.InteropServices;
  18. using Microsoft.VisualStudio.Shell.Interop;
  19. using MSBuild = Microsoft.Build.Evaluation;
  20. namespace Microsoft.VisualStudio.Project
  21. {
  22. /// <summary>
  23. /// This interface defines the rules for handling build dependency on a project container.
  24. /// </summary>
  25. /// <remarks>Normally this should be an internal interface but since it shouldbe available for the aggregator it must be made public.</remarks>
  26. [ComVisible(true)]
  27. [CLSCompliant(false)]
  28. public interface IBuildDependencyOnProjectContainer
  29. {
  30. /// <summary>
  31. /// Defines whether the nested projects should be build with the parent project.
  32. /// </summary>
  33. bool BuildNestedProjectsOnBuild
  34. {
  35. get;
  36. set;
  37. }
  38. /// <summary>
  39. /// Enumerates the nested hierachies present that will participate in the build dependency update.
  40. /// </summary>
  41. /// <returns>A list of hierrachies.</returns>
  42. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Hierachies")]
  43. IVsHierarchy[] EnumNestedHierachiesForBuildDependency();
  44. }
  45. /// <summary>
  46. /// Interface for manipulating build dependency
  47. /// </summary>
  48. /// <remarks>Normally this should be an internal interface but since it shouldbe available for the aggregator it must be made public.</remarks>
  49. [ComVisible(true)]
  50. [CLSCompliant(false)]
  51. public interface IBuildDependencyUpdate
  52. {
  53. /// <summary>
  54. /// Defines a container for storing BuildDependencies
  55. /// </summary>
  56. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
  57. IVsBuildDependency[] BuildDependencies
  58. {
  59. get;
  60. }
  61. /// <summary>
  62. /// Adds a BuildDependency to the container
  63. /// </summary>
  64. /// <param name="dependency">The dependency to add</param>
  65. void AddBuildDependency(IVsBuildDependency dependency);
  66. /// <summary>
  67. /// Removes the builddependency from teh container.
  68. /// </summary>
  69. /// <param name="dependency">The dependency to add</param>
  70. void RemoveBuildDependency(IVsBuildDependency dependency);
  71. }
  72. /// <summary>
  73. /// Provides access to the reference data container.
  74. /// </summary>
  75. /// <remarks>Normally this should be an internal interface but since it should be available for
  76. /// the aggregator it must be made public.</remarks>
  77. [ComVisible(true)]
  78. public interface IReferenceContainerProvider
  79. {
  80. IReferenceContainer GetReferenceContainer();
  81. }
  82. /// <summary>
  83. /// Defines a container for manipulating references
  84. /// </summary>
  85. /// <remarks>Normally this should be an internal interface but since it should be available for
  86. /// the aggregator it must be made public.</remarks>
  87. [ComVisible(true)]
  88. public interface IReferenceContainer
  89. {
  90. IList<ReferenceNode> EnumReferences();
  91. ReferenceNode AddReferenceFromSelectorData(VSCOMPONENTSELECTORDATA selectorData);
  92. void LoadReferencesFromBuildProject(MSBuild.Project buildProject);
  93. }
  94. /// <summary>
  95. /// Defines the events that are internally defined for communication with other subsytems.
  96. /// </summary>
  97. [ComVisible(true)]
  98. public interface IProjectEvents
  99. {
  100. /// <summary>
  101. /// Event raised just after the project file opened.
  102. /// </summary>
  103. [SuppressMessage("Microsoft.Naming", "CA1713:EventsShouldNotHaveBeforeOrAfterPrefix")]
  104. event EventHandler<AfterProjectFileOpenedEventArgs> AfterProjectFileOpened;
  105. /// <summary>
  106. /// Event raised before the project file closed.
  107. /// </summary>
  108. [SuppressMessage("Microsoft.Naming", "CA1713:EventsShouldNotHaveBeforeOrAfterPrefix")]
  109. event EventHandler<BeforeProjectFileClosedEventArgs> BeforeProjectFileClosed;
  110. }
  111. /// <summary>
  112. /// Defines the interface that will specify ehethrr the object is a project events listener.
  113. /// </summary>
  114. [ComVisible(true)]
  115. public interface IProjectEventsListener
  116. {
  117. /// <summary>
  118. /// Is the object a project events listener.
  119. /// </summary>
  120. /// <returns></returns>
  121. bool IsProjectEventsListener
  122. { get; set; }
  123. }
  124. /// <summary>
  125. /// Enable getting and setting the project events provider
  126. /// </summary>
  127. [ComVisible(true)]
  128. public interface IProjectEventsProvider
  129. {
  130. /// <summary>
  131. /// Defines the provider for the project events
  132. /// </summary>
  133. IProjectEvents ProjectEventsProvider
  134. {
  135. get;
  136. set;
  137. }
  138. }
  139. /// <summary>
  140. /// Defines support for single file generator
  141. /// </summary>
  142. public interface ISingleFileGenerator
  143. {
  144. ///<summary>
  145. /// Runs the generator on the item represented by the document moniker.
  146. /// </summary>
  147. /// <param name="document"></param>
  148. void RunGenerator(string document);
  149. }
  150. }