G
Guest
This is my code :
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Reflection;
namespace Nox.Componente
{
/// <summary>
/// Summary description for WizardControl.
/// </summary>
public class WizardControl: Component
{
// Variáveis locais
private WizardPages _Pages;
private TabControl _TabControl;
// Propriedades
[Description("Páginas que formam o assistente.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public WizardPages Pages
{
get {return _Pages;}
set {_Pages = value;}
}
[Description("Tabcontrol do assistente.")]
public TabControl TabControl
{
get {return _TabControl;}
set {_TabControl = value;}
}
public WizardControl()
{
_Pages = new WizardPages(this);
}
// Metodos de design-time
private IComponentChangeService ChangeService;
public override ISite Site
{
get
{
return base.Site;
}
set
{
if (value == null)
{
ClearChangeNotifications();
return;
}
base.Site = value;
// Clear any component change event handlers.
ClearChangeNotifications();
RegisterChangeNotifications();
}
}
private void ClearChangeNotifications()
{
// O valor ChangeService é nulo quando não estiver em design mode,
// assim como IComponentChangeService só está disponÃvel em design time.
ChangeService =
(IComponentChangeService)GetService(typeof(IComponentChangeService));
if (ChangeService != null)
{
ChangeService.ComponentRemoving -= new
ComponentChangedEventHandler(OnComponentRemoving);
}
}
private void RegisterChangeNotifications()
{
ChangeService =
(IComponentChangeService)GetService(typeof(IComponentChangeService));
if (ChangeService != null)
{
ChangeService.ComponentRemoving += new
ComponentChangedEventHandler(OnComponentRemoving);
}
}
private void OnComponentRemoving(object sender, ComponentEventArgs ce)
{
}
}
}
When I compile, this message is show :
Method 'Nox.Componente.WizardControl.OnComponentRemoving(object,
System.ComponentModel.Design.ComponentEventArgs)' does not match delegate
'void System.ComponentModel.Design.ComponentChangedEventHandler(object,
System.ComponentModel.Design.ComponentChangedEventArgs)'
What is wrong ?
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Reflection;
namespace Nox.Componente
{
/// <summary>
/// Summary description for WizardControl.
/// </summary>
public class WizardControl: Component
{
// Variáveis locais
private WizardPages _Pages;
private TabControl _TabControl;
// Propriedades
[Description("Páginas que formam o assistente.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public WizardPages Pages
{
get {return _Pages;}
set {_Pages = value;}
}
[Description("Tabcontrol do assistente.")]
public TabControl TabControl
{
get {return _TabControl;}
set {_TabControl = value;}
}
public WizardControl()
{
_Pages = new WizardPages(this);
}
// Metodos de design-time
private IComponentChangeService ChangeService;
public override ISite Site
{
get
{
return base.Site;
}
set
{
if (value == null)
{
ClearChangeNotifications();
return;
}
base.Site = value;
// Clear any component change event handlers.
ClearChangeNotifications();
RegisterChangeNotifications();
}
}
private void ClearChangeNotifications()
{
// O valor ChangeService é nulo quando não estiver em design mode,
// assim como IComponentChangeService só está disponÃvel em design time.
ChangeService =
(IComponentChangeService)GetService(typeof(IComponentChangeService));
if (ChangeService != null)
{
ChangeService.ComponentRemoving -= new
ComponentChangedEventHandler(OnComponentRemoving);
}
}
private void RegisterChangeNotifications()
{
ChangeService =
(IComponentChangeService)GetService(typeof(IComponentChangeService));
if (ChangeService != null)
{
ChangeService.ComponentRemoving += new
ComponentChangedEventHandler(OnComponentRemoving);
}
}
private void OnComponentRemoving(object sender, ComponentEventArgs ce)
{
}
}
}
When I compile, this message is show :
Method 'Nox.Componente.WizardControl.OnComponentRemoving(object,
System.ComponentModel.Design.ComponentEventArgs)' does not match delegate
'void System.ComponentModel.Design.ComponentChangedEventHandler(object,
System.ComponentModel.Design.ComponentChangedEventArgs)'
What is wrong ?