/Release/Product/Python/PythonTools/PythonTools/Project/Automation/VSProject/OAVSProject.cs

http://pytools.codeplex.com · C# · 217 lines · 168 code · 29 blank · 20 comment · 4 complexity · e477e010ef5a625e6cc8df0c6f8a8864 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. * vspython@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 EnvDTE;
  18. using VSLangProj;
  19. namespace Microsoft.PythonTools.Project.Automation
  20. {
  21. /// <summary>
  22. /// Represents an automation friendly version of a language-specific project.
  23. /// </summary>
  24. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OAVS")]
  25. [ComVisible(true), CLSCompliant(false)]
  26. public class OAVSProject : VSProject
  27. {
  28. #region fields
  29. private ProjectNode project;
  30. private OAVSProjectEvents events;
  31. #endregion
  32. #region ctors
  33. public OAVSProject(ProjectNode project)
  34. {
  35. this.project = project;
  36. }
  37. #endregion
  38. #region VSProject Members
  39. public virtual ProjectItem AddWebReference(string bstrUrl)
  40. {
  41. throw new NotImplementedException();
  42. }
  43. public virtual BuildManager BuildManager
  44. {
  45. get
  46. {
  47. throw new NotImplementedException();
  48. //return new OABuildManager(this.project);
  49. }
  50. }
  51. public virtual void CopyProject(string bstrDestFolder, string bstrDestUNCPath, prjCopyProjectOption copyProjectOption, string bstrUsername, string bstrPassword)
  52. {
  53. throw new NotImplementedException();
  54. }
  55. public virtual ProjectItem CreateWebReferencesFolder()
  56. {
  57. throw new NotImplementedException();
  58. }
  59. public virtual DTE DTE
  60. {
  61. get
  62. {
  63. return (EnvDTE.DTE)this.project.Site.GetService(typeof(EnvDTE.DTE));
  64. }
  65. }
  66. public virtual VSProjectEvents Events
  67. {
  68. get
  69. {
  70. if (events == null)
  71. events = new OAVSProjectEvents(this);
  72. return events;
  73. }
  74. }
  75. public virtual void Exec(prjExecCommand command, int bSuppressUI, object varIn, out object pVarOut)
  76. {
  77. throw new NotImplementedException(); ;
  78. }
  79. public virtual void GenerateKeyPairFiles(string strPublicPrivateFile, string strPublicOnlyFile)
  80. {
  81. throw new NotImplementedException(); ;
  82. }
  83. public virtual string GetUniqueFilename(object pDispatch, string bstrRoot, string bstrDesiredExt)
  84. {
  85. throw new NotImplementedException(); ;
  86. }
  87. public virtual Imports Imports
  88. {
  89. get
  90. {
  91. throw new NotImplementedException();
  92. }
  93. }
  94. public virtual EnvDTE.Project Project
  95. {
  96. get
  97. {
  98. return this.project.GetAutomationObject() as EnvDTE.Project;
  99. }
  100. }
  101. public virtual References References
  102. {
  103. get
  104. {
  105. ReferenceContainerNode references = project.GetReferenceContainer() as ReferenceContainerNode;
  106. if (null == references)
  107. {
  108. return null;
  109. }
  110. return references.Object as References;
  111. }
  112. }
  113. public virtual void Refresh()
  114. {
  115. throw new NotImplementedException();
  116. }
  117. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
  118. public virtual string TemplatePath
  119. {
  120. get
  121. {
  122. throw new NotImplementedException();
  123. }
  124. }
  125. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
  126. public virtual ProjectItem WebReferencesFolder
  127. {
  128. get
  129. {
  130. throw new NotImplementedException();
  131. }
  132. }
  133. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
  134. public virtual bool WorkOffline
  135. {
  136. get
  137. {
  138. throw new NotImplementedException();
  139. }
  140. set
  141. {
  142. throw new NotImplementedException();
  143. }
  144. }
  145. #endregion
  146. }
  147. /// <summary>
  148. /// Provides access to language-specific project events
  149. /// </summary>
  150. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OAVS")]
  151. [ComVisible(true), CLSCompliant(false)]
  152. public class OAVSProjectEvents : VSProjectEvents
  153. {
  154. #region fields
  155. private OAVSProject vsProject;
  156. #endregion
  157. #region ctors
  158. public OAVSProjectEvents(OAVSProject vsProject)
  159. {
  160. this.vsProject = vsProject;
  161. }
  162. #endregion
  163. #region VSProjectEvents Members
  164. public virtual BuildManagerEvents BuildManagerEvents
  165. {
  166. get
  167. {
  168. return vsProject.BuildManager as BuildManagerEvents;
  169. }
  170. }
  171. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
  172. public virtual ImportsEvents ImportsEvents
  173. {
  174. get
  175. {
  176. throw new NotImplementedException();
  177. }
  178. }
  179. public virtual ReferencesEvents ReferencesEvents
  180. {
  181. get
  182. {
  183. return vsProject.References as ReferencesEvents;
  184. }
  185. }
  186. #endregion
  187. }
  188. }