-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDesignerEventBindingService.cs
82 lines (66 loc) · 2.65 KB
/
DesignerEventBindingService.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#region License
/*
EventHandler Naming Visual Studio Extension
Copyright (C) 2010 Einar Egilsson
http://einaregilsson.com/better-eventhandler-names-in-visual-studio-2010/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
$Id$
*/
#endregion
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace EinarEgilsson.EventHandlerNaming
{
internal class DesignerEventBindingService : IEventBindingService
{
private readonly IEventBindingService _realService;
private readonly PatternNameProvider _nameProvider;
public DesignerEventBindingService(IEventBindingService realService, PatternNameProvider nameProvider)
{
_realService = realService;
_nameProvider = nameProvider;
}
public string CreateUniqueMethodName(IComponent component, EventDescriptor e)
{
return _nameProvider.CreateEventHandlerName(component.Site.Name, e.Name, component.Site.Container.Components[0].Site.Name, _realService.CreateUniqueMethodName(component, e));
}
public ICollection GetCompatibleMethods(EventDescriptor e)
{
return _realService.GetCompatibleMethods(e);
}
public EventDescriptor GetEvent(PropertyDescriptor property)
{
return _realService.GetEvent(property);
}
public PropertyDescriptorCollection GetEventProperties(EventDescriptorCollection events)
{
return _realService.GetEventProperties(events);
}
public PropertyDescriptor GetEventProperty(EventDescriptor e)
{
return _realService.GetEventProperty(e);
}
public bool ShowCode()
{
return _realService.ShowCode();
}
public bool ShowCode(int lineNumber)
{
return _realService.ShowCode(lineNumber);
}
public bool ShowCode(IComponent component, EventDescriptor e)
{
return _realService.ShowCode(component, e);
}
}
}