Page 1 of 1
Interface syntax ? - C# to X#
Posted: Thu Mar 16, 2017 6:06 pm
by Phil Hepburn
Hi Robert, Team, Frank and all,
Please can you help me with some suitable syntax for an interface I am converting from Nick's C# code.
I have been translating his code all afternoon and think I have become 'code blind' and/or my brain has frozen ;-0)
Since I have limited experience with Interfaces please guide me.
The attached and inserted image clips should be enough detail for the experienced guys amongst you.
- FrankInterfaces_02.jpg (18.64 KiB) Viewed 612 times
The above is what I start with.
Here is what I tried :-
- FrankInterfaces_01.jpg (81.5 KiB) Viewed 612 times
- FrankInterfaces_06.jpg (49.31 KiB) Viewed 612 times
And here are a couple of images to help :-
- FrankInterfaces_04.jpg (29.15 KiB) Viewed 612 times
- FrankInterfaces_03.jpg (29.44 KiB) Viewed 612 times
Previously, I have managed with interfaces with only methods, and in Nick's code I think this is the first one with what looks to me like a property.
HELP !!!
Phil.
Wales, UK.
Interface syntax ? - C# to X#
Posted: Thu Mar 16, 2017 6:26 pm
by Frank Maraite
Phil
Property DSDbEntityState as DSDbEntityState GET SET
Frank
Interface syntax ? - C# to X#
Posted: Thu Mar 16, 2017 8:37 pm
by Phil Hepburn
Thanks a bunch Frank, it works just fine - see attached.
So why does auto not work ? Robert will need to give one of his 'deeper' explanations.
- FrankInterface_01.jpg (64.59 KiB) Viewed 612 times
Well, onwards and upwards, I will keep testing the VS integration.
Have already found a few useful issues to feed back to the Team.
Best regards to all,
Phil.
Wales, UK.
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 8:21 am
by robert
Phil,
The Auto clause is used to declare a property with an AUTOmatic backing field. Interface members cannot have backing fields.
I guess we could make AUTO a synonym for GET SET but I personally thing the syntax is OK at this moment.
Robert
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 8:49 am
by Frank Maraite
Phil,
an interface says something about how to access a member. The AUTO clause says how it is actually implemented. These are two diferent things.
Robert, I would not allow AUTO because it's mixing up things.
Frank
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 9:39 am
by Phil Hepburn
Hi and thanks Robert,
Yes, I understand, so the 'auto' is for an automatic backing field facility to be put in place - not just the 'get set' - makes sense as it is.
I will send to you directly a couple of things I discovered yesterday about the current VS integration. Not BIG issues but ones which should be addressed and corrected I feel, to improve the 'operation & look-feel' for others.
Power to my finger tips ! Have a nice day.
Cheers,
Phil.
Wales, UK.
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 10:11 am
by Phil Hepburn
Frank,
... Agreed ...
Cheers,
Phil.
Wales, UK.
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 11:23 am
by robert
Phil Hepburn wrote:H
I will send to you directly a couple of things I discovered yesterday about the current VS integration. Not BIG issues but ones which should be addressed and corrected I feel, to improve the 'operation & look-feel' for others.
Please do not send them as images (with the exception of error dialogs of course), but as real text. That makes it much easier to reproduce the problems.
Robert
Interface syntax ? - C# to X#
Posted: Fri Mar 17, 2017 12:58 pm
by Phil Hepburn
Oh! - if live were only so simple ;-0)
Thanks Robert, I will do my best !
Phil.