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; | |
7 using Microsoft.VisualStudio.Shell; | |
8 using Microsoft.VisualStudio.Shell.Interop; | |
9 using VSLangProj; | |
10 | |
11 namespace Microsoft.VisualStudio.Project.Automation | |
12 { | |
13 /// <summary> | |
14 /// Represents a project reference of the solution | |
15 /// </summary> | |
16 [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBas
eTypesShouldBeComVisible")] | |
17 [ComVisible(true)] | |
18 public class OAProjectReference : OAReferenceBase<ProjectReferenceNode> | |
19 { | |
20 public OAProjectReference(ProjectReferenceNode projectReference)
: | |
21 base(projectReference) | |
22 { | |
23 } | |
24 | |
25 #region Reference override | |
26 public override string Culture | |
27 { | |
28 get { return string.Empty; } | |
29 } | |
30 public override string Name | |
31 { | |
32 get { return BaseReferenceNode.ReferencedProjectName; } | |
33 } | |
34 public override string Identity | |
35 { | |
36 get | |
37 { | |
38 return BaseReferenceNode.Caption; | |
39 } | |
40 } | |
41 public override string Path | |
42 { | |
43 get | |
44 { | |
45 return BaseReferenceNode.ReferencedProjectOutput
Path; | |
46 } | |
47 } | |
48 public override EnvDTE.Project SourceProject | |
49 { | |
50 get | |
51 { | |
52 if(Guid.Empty == BaseReferenceNode.ReferencedPro
jectGuid) | |
53 { | |
54 return null; | |
55 } | |
56 IVsHierarchy hierarchy = VsShellUtilities.GetHie
rarchy(BaseReferenceNode.ProjectMgr.Site, BaseReferenceNode.ReferencedProjectGui
d); | |
57 if(null == hierarchy) | |
58 { | |
59 return null; | |
60 } | |
61 object extObject; | |
62 if(Microsoft.VisualStudio.ErrorHandler.Succeeded
( | |
63 hierarchy.GetProperty(VSConstant
s.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out extObject))) | |
64 { | |
65 return extObject as EnvDTE.Project; | |
66 } | |
67 return null; | |
68 } | |
69 } | |
70 public override prjReferenceType Type | |
71 { | |
72 // TODO: Write the code that finds out the type of the o
utput of the source project. | |
73 get { return prjReferenceType.prjReferenceTypeAssembly;
} | |
74 } | |
75 public override string Version | |
76 { | |
77 get { return string.Empty; } | |
78 } | |
79 #endregion | |
80 } | |
81 } | |
OLD | NEW |