1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.ComponentModel;
6
using System.ComponentModel.Design;
8
namespace ICSharpCode.Reports.Addin.Designer
11
/// Description of GroupeHeaderDesigner.
13
public class GroupHeaderDesigner:DataItemDesigner
16
private ISelectionService selectionService;
17
private IComponentChangeService componentChangeService;
19
public GroupHeaderDesigner()
23
public override void Initialize(IComponent component)
25
base.Initialize(component);
30
private void OnSelectionChanged(object sender, EventArgs e)
32
Control.Invalidate( );
36
private void OnComponentRename(object sender,ComponentRenameEventArgs e) {
37
if (e.Component == this.Component) {
38
Control.Name = e.NewName;
44
private void GetService ()
46
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
47
if (selectionService != null)
49
selectionService.SelectionChanged += OnSelectionChanged;
52
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
53
if (componentChangeService != null) {
54
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename);
59
protected override void Dispose(bool disposing)
61
if (this.selectionService != null) {
62
selectionService.SelectionChanged -= OnSelectionChanged;
65
if (componentChangeService != null) {
66
componentChangeService.ComponentRename -= OnComponentRename;
68
base.Dispose(disposing);