Show Bid Request
.NET Reflection Help #2
Bid Request Id: 37049
|
|
|
Posted by: |
QUIET (19 ratings)
(Software buyer rating 9.95)
|
Non-action Ratio: |
Very Good - 18.92%
|
Buyer Security Verifications: |
Excellent
|
Approved on: |
Nov 25, 2002 5:21:17 PM EDT
|
Bidding Closes: |
Nov 26, 2002 6:00:00 PM EDT
|
Viewed (by coders): |
125 times
|
Deadline: |
11/27/2002
TIME EXPIRED
|
|
|
|
Description:
need reflection to show me the value of the subclass as well as those of the superclass.
Also, need to understand if there are any restrictions on this after we make it work.
To reproduce, create SelfInspection2() . . . it only shows the vars of the superclass
class SelfIntrospection { private string privateStringl; protected string protectedString; public string publicString;
public SelfIntrospection() { Type t = GetType(); FieldInfo[] f = t.GetFields( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance );
IEnumerator e = f.GetEnumerator(); while (e.MoveNext()) { FieldInfo fi = (FieldInfo)e.Current;
Console.WriteLine("---------------"); Console.WriteLine(fi.Name); Console.WriteLine(fi.Attributes); Console.WriteLine(fi.DeclaringType); Console.WriteLine(fi.FieldHandle); Console.WriteLine(fi.FieldType); Console.WriteLine(fi.IsNotSerialized); Console.WriteLine(fi.MemberType); Console.WriteLine(fi.GetValue(this)); }
} }
class SelfInspection2 : SelfIntrospection { private string subval; }
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Complete ownership and distribution copyrights to all work purchased.
Platform:
.NET
Must be 100% finished and received by buyer on:
Nov 27, 2002 EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$6 (USD)
|
Nov 26, 2002 3:31:02 AM EDT
|
10
(Excellent)
|
|
|
Hi.
This example is ok - it shows all vars of superclass which are NOT PRIVATE (private is visible ONLY in declared class) and all vars from SelfInspection2 (i.e. subval - this is private and it is accesible from that class).
So, you can display all non-private members from super class, and all (private included) members from current class.
Regards, Dejan
|
|
Attached File
|
|
|
|
|