forked from nicholas-ross/SSMS-Schema-Folders
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SchemaFolderTreeNode.cs
64 lines (50 loc) · 1.47 KB
/
SchemaFolderTreeNode.cs
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
using Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer;
using System;
using System.Drawing;
namespace SsmsSchemaFolders
{
internal class SchemaFolderTreeNode : HierarchyTreeNode, INodeWithMenu, IServiceProvider
//IServiceProvider causes the SchemaFolders.DoReorganization to run on itself
{
object parent;
public SchemaFolderTreeNode(object o)
{
parent = o;
}
public override Icon Icon
{
get { return (parent as INodeWithIcon).Icon; }
}
public override Icon SelectedIcon
{
get { return (parent as INodeWithIcon).SelectedIcon; }
}
public override bool ShowPolicyHealthState
{
get
{
return false;
}
set
{
//throw new NotImplementedException();
}
}
public override int State
{
get { return (parent == null) ? 0 : (parent as INodeWithIcon).State; }
}
public object GetService(Type serviceType)
{
return (parent == null) ? null : (parent as IServiceProvider).GetService(serviceType);
}
public void DoDefaultAction()
{
(parent as INodeWithMenu).DoDefaultAction();
}
public void ShowContextMenu(Point screenPos)
{
(parent as INodeWithMenu).ShowContextMenu(screenPos);
}
}
}