473,238 Members | 1,591 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,238 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 1704
> 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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.