Interface syntax ? - C# to X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Interface syntax ? - C# to X#

Post 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
FrankInterfaces_02.jpg (18.64 KiB) Viewed 645 times
The above is what I start with.

Here is what I tried :-
FrankInterfaces_01.jpg
FrankInterfaces_01.jpg (81.5 KiB) Viewed 645 times
FrankInterfaces_06.jpg
FrankInterfaces_06.jpg (49.31 KiB) Viewed 645 times
And here are a couple of images to help :-
FrankInterfaces_04.jpg
FrankInterfaces_04.jpg (29.15 KiB) Viewed 645 times

FrankInterfaces_03.jpg
FrankInterfaces_03.jpg (29.44 KiB) Viewed 645 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.
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

Interface syntax ? - C# to X#

Post by Frank Maraite »

Phil

Property DSDbEntityState as DSDbEntityState GET SET

Frank
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Interface syntax ? - C# to X#

Post 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
FrankInterface_01.jpg (64.59 KiB) Viewed 645 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.
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Interface syntax ? - C# to X#

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

Interface syntax ? - C# to X#

Post 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
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Interface syntax ? - C# to X#

Post 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.
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Interface syntax ? - C# to X#

Post by Phil Hepburn »

Frank,

... Agreed ...

Cheers,
Phil.
Wales, UK.
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Interface syntax ? - C# to X#

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Interface syntax ? - C# to X#

Post by Phil Hepburn »

Oh! - if live were only so simple ;-0)

Thanks Robert, I will do my best !

Phil.
Post Reply