Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax question on interfaces
Message
From
19/01/2004 00:51:03
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00868001
Message ID:
00868004
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform