Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enum and interfaces
Message
De
21/08/2006 17:45:11
 
 
À
21/08/2006 17:17:30
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01147155
Message ID:
01147431
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
Brian,

I guess I also should have asked you what is the error you're getting? Compile error? Runtime error?

I don't know how different VB is from C#, but I bet the basics are pretty much the same. So, with that in mind, here's what looks fishy to me:

1) I don't think your MyInterfaces module should be Implementing the IDataForm ... you're *defining* that interface in this Module. (although I could be wrong ... maybe that's a VB thing?)

2) You don't want to redefine your Enum in your Form. Having it defined in your MyInterfaces should be all you need to do (and you probably need to make it Public too ... that may be why it can't be found, if that's what your problem is).

Sorry about saying your property definition shouldn't have had the parentheses in a previous reply ... I was misled by a conversion program that took my C# property definition and *supposedly* converted it to VB code. I've since looked at VB documentation and saw that it's supposed to have the parentheses. Sorry ... I'm a C# expert, but don't know a whole lot about VB.

A little help from the VB experts here might be appreciated!!! <g>

~~Bonnie





>Bonnie,
>
>I've moved the Enum defination arround trying to solve this originaly It rested solely in the projects "Main" module
>
>
>Interface
>Module MyInterfaces
>    Implements IDataForm
>
>    Enum FormMode As Integer
>        Mode_Default = 0
>        Mode_Add = 1
>        Mode_Edit = 2
>        Mode_Cancel = 3
>    End Enum
>
>    Public Interface IDataForm
>
>        'Property Mode()
>        ReadOnly Property Mode() As FormMode
>        Sub OnEdit()
>        Sub OnAdd()
>        Sub OnSave()
>        Sub OnCancel()
>        ' Property Mode() As FormMode
>
>    End Interface
>End Module
>
>
>
>Forms Code:
>
>
>Implements IDataForm
>
>    Enum FormMode As Integer
>        Mode_Default = 0
>        Mode_Add = 1
>        Mode_Edit = 2
>        Mode_Cancel = 3
>    End Enum
>
>
>
> Public Property Mode() As FormMode Implements IDataForm.mode
>        Get
>            Return _mode
>        End Get
>
>        Set(ByVal Value As FormMode)
>            _mode = Value
>        End Set
>
>End Property
>
>
>
>all the subs that are defined in the interface are working fine.
>
>Thanks
>Brian Grant
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