473,379 Members | 1,257 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,379 software developers and data experts.

Determine if a property is read-only, write-only or read-write with reflection

Is it possible to determine if a property is read-only, write-only or
read-write with reflection? Does MemberInfo class contains such
information?

Thanks

Dec 16 '05 #1
1 2236
>Is it possible to determine if a property is read-only, write-only or
read-write with reflection? Does MemberInfo class contains such
information?


Not MemberInfo but the derived PropertyInfo class does. If you have a
MemberInfo object reference for a property it should actually be a
PropertyInfo so try to cast it. Then check the CanRead and CanWrite
properties.
Mattias

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

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

Similar topics

3
by: mikeorb | last post by:
Is there a way to determine the object that a property is in? For example: function MyClass() { ... } MyClass.prototype.myFunc = function() { ... } var obj = new MyClass(); var sameobj =...
1
by: Me | last post by:
Hi all, I have an Access application that has to import hundreds of other MDB's, some access 97 and some 2000, and merge them into several large mdb's. so far so good, but my command: Set...
3
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The...
1
by: mdb | last post by:
I want to determine whether the SHIFT key is depressed, but NOT during a key up/down/pressed event. How can I do that?
3
by: Rob Nicholson | last post by:
How do you determine if a program is running in the Visual Studio IDE/debugger as opposed to standalone? We often include support files in the same folder as the executable and would so something...
1
by: Chris Ashley | last post by:
I'm trying to use a treeview control for navigation in an app. How do I determine which node has been selected? I can't use the text property because some nodes have the same name, and the index...
3
by: mrdylan | last post by:
Given a class like so: ------------------------------- class TestMe(object): def get(self): pass def set(self, v): pass p = property( get, set )
8
by: Ole | last post by:
If I define a class and create a instant of it like e.g.: UserClass instantName = new UserClass(); how do I then determine the defined name "instantName" in the UserClass e.g. in a method (or...
10
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've...
19
by: =?Utf-8?B?R3JlZw==?= | last post by:
How can I tell via code if a Form is already open. Each time my forms load I have some initialization code that runs, but if the form is already open and hidden I don't want that initialization...
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...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.