Repository navigation
Expand file tree
/
Copy pathClojureProjectFileNode.cs
More file actions
75 lines (66 loc) · 1.9 KB
/
Copy pathClojureProjectFileNode.cs
File metadata and controls
75 lines (66 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// MIT License Copyright 2010-2013 jmis
// See LICENSE.txt or http://opensource.org/licenses/MIT
// See AUTHORS.txt for a complete list of all contributors
using System;
using System.Drawing;
using ClojureExtension.Project;
using Microsoft.VisualStudio.Project;
using Microsoft.VisualStudio.Project.Automation;
namespace Microsoft.ClojureExtension.Project
{
/// <summary>
/// This class extends the FileNode in order to represent a file
/// within the hierarchy.
/// </summary>
public class ClojureProjectFileNode : FileNode
{
#region Fields
private OAClojureProjectFileItem automationObject;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ClojureProjectFileNode"/> class.
/// </summary>
/// <param name="root">The project node.</param>
/// <param name="e">The project element node.</param>
internal ClojureProjectFileNode(ProjectNode root, ProjectElement e)
: base(root, e)
{
}
#endregion
#region Overriden implementation
/// <summary>
/// Gets the automation object for the file node.
/// </summary>
/// <returns></returns>
public override object GetAutomationObject()
{
if(automationObject == null)
{
automationObject = new OAClojureProjectFileItem(this.ProjectMgr.GetAutomationObject() as OAProject, this);
}
return automationObject;
}
public override object GetIconHandle(bool open)
{
Bitmap image = (Bitmap) ClojureProjectNode.ImageList.Images[1];
return image.GetHicon();
}
#endregion
#region Private implementation
internal OleServiceProvider.ServiceCreatorCallback ServiceCreator
{
get { return new OleServiceProvider.ServiceCreatorCallback(this.CreateServices); }
}
private object CreateServices(Type serviceType)
{
object service = null;
if(typeof(EnvDTE.ProjectItem) == serviceType)
{
service = GetAutomationObject();
}
return service;
}
#endregion
}
}