|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Interface creation in VB.Net 2005Is it me or has the way interfaces created changed in VB 2005?
I have to create a class file and then create the Interface within that, e.g.: to create an Interface called IOrders, I create a class file called Interfaces then within that file: Public Class Interfaces Interface IOrders Property myOrderID() As Integer End Interface End Class To reference this Interface in an Implements statement I have to use Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be seen by any Implements statement. Am I don't something embarassingly wrong here, or have things changed with 2005?
Show quote
Hide quote
"John Mason" <JohnMa***@discussions.microsoft.com> schrieb: Mhm... It should work without adding the interface to the class as a nested > Is it me or has the way interfaces created changed in VB 2005? > I have to create a class file and then create the Interface within that, > e.g.: > to create an Interface called IOrders, I create a class file called > Interfaces then within that file: > Public Class Interfaces > Interface IOrders > Property myOrderID() As Integer > End Interface > End Class > > To reference this Interface in an Implements statement I have to use > Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be > seen by any Implements statement. type. I am curious if it only doesn't show up in IntelliSense or if the compiler complains about the 'Implements...'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Many thanks for your reply Herfried, I think I have now resolved the problem.
Initially, when creating the class file which I wanted to use for my Interface file I chose NOT to store the file in the App_Code folder. In that resulting file, the Interface name would not show up in Intellisense. Now, by allowing the file to be created in the App_Code folder, the Interface IS available in Intellisense. I'm afraid I'm a victim of trying to learn VB.Net 2005 at home, without the crutch of my far more intelligent colleagues and the Help system showing me everything except what I need to know! Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "John Mason" <JohnMa***@discussions.microsoft.com> schrieb: > > Is it me or has the way interfaces created changed in VB 2005? > > I have to create a class file and then create the Interface within that, > > e.g.: > > to create an Interface called IOrders, I create a class file called > > Interfaces then within that file: > > Public Class Interfaces > > Interface IOrders > > Property myOrderID() As Integer > > End Interface > > End Class > > > > To reference this Interface in an Implements statement I have to use > > Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be > > seen by any Implements statement. > > Mhm... It should work without adding the interface to the class as a nested > type. I am curious if it only doesn't show up in IntelliSense or if the > compiler complains about the 'Implements...'. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > >
array - how do you get the number of dimensions?
Resize problem (in IDE) Barcode Reader Application -- HELP New bee:How do i make an .exe file in VS 2005? DimeAttachment save to disk Com+ and asp.net? Connection Properties Dialog Box? Flash (swf) in VB.net?? .NET 2.0 DataGridView Problem using mixed-mode DLL from VB.NET |
|||||||||||||||||||||||