PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/Common/Product/SharedProject/Automation/OAProjectConfigurationProperties.cs

https://gitlab.com/SplatoonModdingHub/PTVS
C# | 395 lines | 325 code | 55 blank | 15 comment | 0 complexity | 1229a08eb3fae6f342227d86447b6956 MD5 | raw file
  1. // Visual Studio Shared Project
  2. // Copyright(c) Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the License); you may not use
  6. // this file except in compliance with the License. You may obtain a copy of the
  7. // License at http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
  10. // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
  11. // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  12. // MERCHANTABLITY OR NON-INFRINGEMENT.
  13. //
  14. // See the Apache Version 2.0 License for specific language governing
  15. // permissions and limitations under the License.
  16. using System;
  17. using System.Collections.Generic;
  18. using Microsoft.VisualStudio;
  19. using Microsoft.VisualStudio.OLE.Interop;
  20. using Microsoft.VisualStudio.Shell.Interop;
  21. using Microsoft.VisualStudioTools.Project;
  22. using VSLangProj;
  23. namespace Microsoft.VisualStudioTools.Project.Automation {
  24. class OAProjectConfigurationProperties : ConnectionPointContainer, ProjectConfigurationProperties, IConnectionPointContainer, IEventSource<IPropertyNotifySink> {
  25. private readonly ProjectNode _project;
  26. private readonly List<IPropertyNotifySink> _sinks = new List<IPropertyNotifySink>();
  27. private readonly HierarchyListener _hierarchyListener;
  28. public OAProjectConfigurationProperties(ProjectNode node) {
  29. _project = node;
  30. AddEventSource<IPropertyNotifySink>(this);
  31. _hierarchyListener = new HierarchyListener(_project, this);
  32. }
  33. #region ProjectConfigurationProperties Members
  34. public bool AllowUnsafeBlocks {
  35. get {
  36. throw new NotImplementedException();
  37. }
  38. set {
  39. throw new NotImplementedException();
  40. }
  41. }
  42. public uint BaseAddress {
  43. get {
  44. throw new NotImplementedException();
  45. }
  46. set {
  47. throw new NotImplementedException();
  48. }
  49. }
  50. public bool CheckForOverflowUnderflow {
  51. get {
  52. throw new NotImplementedException();
  53. }
  54. set {
  55. throw new NotImplementedException();
  56. }
  57. }
  58. public string ConfigurationOverrideFile {
  59. get {
  60. throw new NotImplementedException();
  61. }
  62. set {
  63. throw new NotImplementedException();
  64. }
  65. }
  66. public bool DebugSymbols {
  67. get {
  68. throw new NotImplementedException();
  69. }
  70. set {
  71. throw new NotImplementedException();
  72. }
  73. }
  74. public string DefineConstants {
  75. get {
  76. throw new NotImplementedException();
  77. }
  78. set {
  79. throw new NotImplementedException();
  80. }
  81. }
  82. public bool DefineDebug {
  83. get {
  84. throw new NotImplementedException();
  85. }
  86. set {
  87. throw new NotImplementedException();
  88. }
  89. }
  90. public bool DefineTrace {
  91. get {
  92. throw new NotImplementedException();
  93. }
  94. set {
  95. throw new NotImplementedException();
  96. }
  97. }
  98. public string DocumentationFile {
  99. get {
  100. throw new NotImplementedException();
  101. }
  102. set {
  103. throw new NotImplementedException();
  104. }
  105. }
  106. public bool EnableASPDebugging {
  107. get {
  108. throw new NotImplementedException();
  109. }
  110. set {
  111. throw new NotImplementedException();
  112. }
  113. }
  114. public bool EnableASPXDebugging {
  115. get {
  116. throw new NotImplementedException();
  117. }
  118. set {
  119. throw new NotImplementedException();
  120. }
  121. }
  122. public bool EnableSQLServerDebugging {
  123. get {
  124. throw new NotImplementedException();
  125. }
  126. set {
  127. throw new NotImplementedException();
  128. }
  129. }
  130. public bool EnableUnmanagedDebugging {
  131. get {
  132. throw new NotImplementedException();
  133. }
  134. set {
  135. throw new NotImplementedException();
  136. }
  137. }
  138. public string ExtenderCATID {
  139. get { throw new NotImplementedException(); }
  140. }
  141. public object ExtenderNames {
  142. get { throw new NotImplementedException(); }
  143. }
  144. public uint FileAlignment {
  145. get {
  146. throw new NotImplementedException();
  147. }
  148. set {
  149. throw new NotImplementedException();
  150. }
  151. }
  152. public bool IncrementalBuild {
  153. get {
  154. throw new NotImplementedException();
  155. }
  156. set {
  157. throw new NotImplementedException();
  158. }
  159. }
  160. public string IntermediatePath {
  161. get {
  162. throw new NotImplementedException();
  163. }
  164. set {
  165. throw new NotImplementedException();
  166. }
  167. }
  168. public bool Optimize {
  169. get {
  170. throw new NotImplementedException();
  171. }
  172. set {
  173. throw new NotImplementedException();
  174. }
  175. }
  176. public string OutputPath {
  177. get {
  178. return _project.Site.GetUIThread().Invoke(() => _project.GetProjectProperty("OutputPath"));
  179. }
  180. set {
  181. _project.Site.GetUIThread().Invoke(() => _project.SetProjectProperty("OutputPath", value));
  182. }
  183. }
  184. public bool RegisterForComInterop {
  185. get {
  186. throw new NotImplementedException();
  187. }
  188. set {
  189. throw new NotImplementedException();
  190. }
  191. }
  192. public bool RemoteDebugEnabled {
  193. get {
  194. throw new NotImplementedException();
  195. }
  196. set {
  197. throw new NotImplementedException();
  198. }
  199. }
  200. public string RemoteDebugMachine {
  201. get {
  202. throw new NotImplementedException();
  203. }
  204. set {
  205. throw new NotImplementedException();
  206. }
  207. }
  208. public bool RemoveIntegerChecks {
  209. get {
  210. throw new NotImplementedException();
  211. }
  212. set {
  213. throw new NotImplementedException();
  214. }
  215. }
  216. public prjStartAction StartAction {
  217. get {
  218. throw new NotImplementedException();
  219. }
  220. set {
  221. throw new NotImplementedException();
  222. }
  223. }
  224. public string StartArguments {
  225. get {
  226. throw new NotImplementedException();
  227. }
  228. set {
  229. throw new NotImplementedException();
  230. }
  231. }
  232. public string StartPage {
  233. get {
  234. throw new NotImplementedException();
  235. }
  236. set {
  237. throw new NotImplementedException();
  238. }
  239. }
  240. public string StartProgram {
  241. get {
  242. throw new NotImplementedException();
  243. }
  244. set {
  245. throw new NotImplementedException();
  246. }
  247. }
  248. public string StartURL {
  249. get {
  250. throw new NotImplementedException();
  251. }
  252. set {
  253. throw new NotImplementedException();
  254. }
  255. }
  256. public bool StartWithIE {
  257. get {
  258. throw new NotImplementedException();
  259. }
  260. set {
  261. throw new NotImplementedException();
  262. }
  263. }
  264. public string StartWorkingDirectory {
  265. get {
  266. throw new NotImplementedException();
  267. }
  268. set {
  269. throw new NotImplementedException();
  270. }
  271. }
  272. public bool TreatWarningsAsErrors {
  273. get {
  274. throw new NotImplementedException();
  275. }
  276. set {
  277. throw new NotImplementedException();
  278. }
  279. }
  280. public prjWarningLevel WarningLevel {
  281. get {
  282. throw new NotImplementedException();
  283. }
  284. set {
  285. throw new NotImplementedException();
  286. }
  287. }
  288. public string __id {
  289. get { throw new NotImplementedException(); }
  290. }
  291. public object get_Extender(string ExtenderName) {
  292. throw new NotImplementedException();
  293. }
  294. #endregion
  295. #region IEventSource<IPropertyNotifySink> Members
  296. public void OnSinkAdded(IPropertyNotifySink sink) {
  297. _sinks.Add(sink);
  298. }
  299. public void OnSinkRemoved(IPropertyNotifySink sink) {
  300. _sinks.Remove(sink);
  301. }
  302. #endregion
  303. internal class HierarchyListener : IVsHierarchyEvents {
  304. private readonly IVsHierarchy _hierarchy;
  305. private readonly uint _cookie;
  306. private readonly OAProjectConfigurationProperties _props;
  307. public HierarchyListener(IVsHierarchy hierarchy, OAProjectConfigurationProperties props) {
  308. _hierarchy = hierarchy;
  309. _props = props;
  310. ErrorHandler.ThrowOnFailure(_hierarchy.AdviseHierarchyEvents(this, out _cookie));
  311. }
  312. ~HierarchyListener() {
  313. _hierarchy.UnadviseHierarchyEvents(_cookie);
  314. }
  315. #region IVsHierarchyEvents Members
  316. public int OnInvalidateIcon(IntPtr hicon) {
  317. return VSConstants.S_OK;
  318. }
  319. public int OnInvalidateItems(uint itemidParent) {
  320. return VSConstants.S_OK;
  321. }
  322. public int OnItemAdded(uint itemidParent, uint itemidSiblingPrev, uint itemidAdded) {
  323. return VSConstants.S_OK;
  324. }
  325. public int OnItemDeleted(uint itemid) {
  326. return VSConstants.S_OK;
  327. }
  328. public int OnItemsAppended(uint itemidParent) {
  329. return VSConstants.S_OK;
  330. }
  331. public int OnPropertyChanged(uint itemid, int propid, uint flags) {
  332. foreach (var sink in _props._sinks) {
  333. sink.OnChanged(propid);
  334. }
  335. return VSConstants.S_OK;
  336. }
  337. #endregion
  338. }
  339. }
  340. }