C# Syntax - Can anyone explain what [public static A B.C(D) {...}] would mean?

Started by
6 comments, last by KorangarDev 12 years ago
Right so I found this weird format for a method declaration and I can't wrap my head around it.

public static A B.C(D)
{...}

it's a public static method,
that returns type A?
Named "B"?
or "B.C"?
and of course D is the parameter.

Thoughts?
Advertisement
Are you sure this is in C# code? Is it a fragment from some code? Can you show us how it is written fully?
Yeah I figured you guys can't be much help until I find the original. I've misplaced it lol.
Thank you so much for your time dude. I really appreciate it. It gets hard to figure out what's going on for us newbies, and we do so want to join your ranks lol. biggrin.png

I think it has something to do with "using alias directive"? But I'm no C# expert.

using B = E.F.G;
public static A B.C(D)
{...}

I think it might be a typo. Would
A B.C(D);
make more sense?

I'll get you that original if I can. I'm just trying to wrap my head around all this craziness. Not enough time to practice and get good! wink.png
It still doesn't make sense.

Maybe this will help:
public static A B(C D) - that makes sense. A is return type, B is method name, C is argument type, D is argument name.
new B.C(D) - also makes sense. Here B is namespace (or class, or struct). C is class name. D is variable or value.
B.C(D) - this also makes sense. Here B is class (or struct). C is method name.
Did it look like the code for an explicit interface implementation?
Where is the delete post?
It is for explicit interfaces. It is if you have two or more interfaces in the same class with the same name, then you use that notation to specify which one you are using for a method.

So A is the return value
B is the Interface
C is the interface member
D is the parameter.
That must be it! Makes much more sense now I a I-have-no-idea-how-to-work-with-interfaces-but-I-will-learn-soon kind of way.

/Thank you/. You guys are awesome.

This topic is closed to new replies.

Advertisement