473,807 Members | 2,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Ge tAccessors 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 1738
> 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%******** ********@TK2MSF TNGP14.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.Ge tAccessors 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
6505
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 accessors. e.g: public class MyObject { public string name; // This is serialized OK
3
1849
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
2152
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? It seems I spend ages at the begining of a project just writting that same old very elementary crap :-) Thanks all
6
1183
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
3113
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 approach but unfortunately i failed to do that. i declared the property accessors as follow in my idl file. HRESULT Data( SAFEARRAY * *pVal); HRESULT Data( SAFEARRAY * newVal); when i compile code i get following error.
2
1150
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 control. According to the documentation, the datasource of a datagrid can be anything which implements IEnumerable (which includes array and arraylist). However, every example I've seen for datagrid uses a DataTable to store the data.
14
2409
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 standard ASPX page with minor modifications to it. All of my pages inherit from a "BasePage.cs" class, that handles common things like getting the user's information out of the session, determines if a page should or should not be password...
2
289
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: PropertyInfo.GetAccessors Method () Return Value An array of MethodInfo objects that reflect the public get, set, *and other
112
13882
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 because they smell "Javaish." But now my code base is expanding and I'm beginning to appreciate the wisdom behind them. I welcome example code and illustrations.
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.