Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax question on interfaces
Message
De
19/01/2004 00:51:03
 
 
À
19/01/2004 00:14:34
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00868001
Message ID:
00868004
Vues:
16
Kevin,

By adding the Interface to an already existing class, you'll have to add the three new properties to the class or you'll get the compiler errors. The way to implement the interface it with a comma, as you tried to do:
public class MyTextBox :  System.Windows.Forms.TextBox, IBindingInfo
{
  public string MyPropertyOne, MyPropertyTwo, MyPropertyThree;
}
Simply adding the interface to an already existing class does not automatically add the properties. If you create a new class from scratch, and specify then that it implements an Interface, you'll get some Intellisense that tells you to press TAB and it will fill in the Interfaces properties & methods.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform