[nem-en] Information about VS 2005 Integration in English
Michal Moskal
michal.moskal at gmail.com
Wed Sep 27 10:10:47 CEST 2006
On 9/27/06, vc <vc at rsdn.ru> wrote:
> Hi,
>
> I need some additional information to be provided by the IMember
> interface, which is the member source.
>
> Let me explain. Right now, I use the following way to distinguish that
> the member is a property getter, setter or something else needed to be
> exclude from the completion list:
>
> static IsValid(name : string) : bool
> {
> !IsPropertyAccessor(name) && !IsEventAccessor(name)
> && !IsOperator(name)
> }
>
> static IsPropertyAccessor(name : string) : bool {
> name.StartsWith("get_") || name.StartsWith("set_") }
>
> static IsEventAccessor(name : string) : bool {
> name.StartsWith("add_") || name.StartsWith("remove_") }
>
> static IsOperator(name : string) : bool
> {
> name.StartsWith("op_")
> }
>
> static IsSpecialName(name : string) : bool {
> name.StartsWith("value__") || name.StartsWith("_N_") }
>
> It works for C# and N, but this naming convention might be different in
> other .NET languages. So, the question is can we have some more detailed
> information where a particular member comes from and what is its parent?
You may look for specialname attribute. It is present in IL for all
such strange names.
Right now IMember doesn't have means to access it, but it might be
easily added (like a IsSpecialName property). I may work on it later
today.
Anyway I don't think this is going to be a problem -- I guess all the
languages are going to stick to C# conventions unless they have really
good reasons. More of a problem might be, that people may want to call
regular method add_something.
--
Michał
More information about the devel-en
mailing list