473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Allows CLR more than 2 accessors for a property?

Does the clr allow more than one set and one get method for a property? Is
it possible to use overloading for example set_Color(int c), set_Color(Color
c)?

from msdn:

PropertyInfo.GetAccessors Method ()

Return Value
An array of MethodInfo objects that reflect the public get, set, *and other
accessors* of the property reflected by the current instance, if found;
otherwise, this method returns an array with zero (0) elements.

what is meant with "other accessors" here?
Jul 21 '05 #1
2 1709
> Does the clr allow more than one set and one get method for a property? Is
it possible to use overloading for example set_Color(int c),
set_Color(Color
c)? Not possible, there will always be only one setter for the same property
with one argument this is because when you overload a property you need two
different signatures (does not include return type).

what is meant with "other accessors" here? No idea but if you look at the documentation for C# there are not other
modifiers.

Gabriel Lozano-Morán
"cody" <de********@gmx.de> wrote in message
news:e%****************@TK2MSFTNGP14.phx.gbl... Does the clr allow more than one set and one get method for a property? Is
it possible to use overloading for example set_Color(int c),
set_Color(Color
c)?

from msdn:

PropertyInfo.GetAccessors Method ()

Return Value
An array of MethodInfo objects that reflect the public get, set, *and
other
accessors* of the property reflected by the current instance, if found;
otherwise, this method returns an array with zero (0) elements.

what is meant with "other accessors" here?

Jul 21 '05 #2
Does the clr allow more than one set and one get method for a property?
No

Is
it possible to use overloading for example set_Color(int c), set_Color(Color
c)?
Yes, but only one of those method can be the setter.

what is meant with "other accessors" here?


In languages that allow it, such as ILAsm, you can associate an
arbitrary number of other methods to a property. But there's still at
most one getter and one setter.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Cresswell | last post by:
Hello everyone, I would like to serialize an object to XML. Currently my code will serialize all of the public properties that are value types, but not my public properties that have get...
3
by: Mike P | last post by:
What does it do when you have a property with get and set accessors like this? public int PasswordAttemptWindows { get; } Thanks, Mike
1
by: thechaosengine | last post by:
Hi all, Does anyone know of a decent code generator that would take in the details of the variables I would like my class to have and then make the property accessors from that information? ...
6
by: steveevets | last post by:
Hi I have written a class with a private member & public member with accessors thus public class Wierd { private int _MyInt = 0; private bool _MyIntGot = false; public int MyInt
5
by: Ahmad Jalil Qarshi | last post by:
i want to store binary data into my property. i read earlier positing on "microsoft.public.dotnet.languages.vc" group with subject as SAFEARRAY in attributed ATL7 Project. i followed the same...
2
by: Andy Fish | last post by:
Hi, I have some data which is stored as an array (or possibly an arraylist) of identically typed objects, each of which has certain public properties. I want to display these in a datagrid...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
2
by: cody | last post by:
Does the clr allow more than one set and one get method for a property? Is it possible to use overloading for example set_Color(int c), set_Color(Color c)? from msdn: ...
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.