Click here to Skip to main content
16,011,947 members
Home / Discussions / C#
   

C#

 
QuestionTwo basic questions about reflection Pin
George_George1-Jun-08 16:54
George_George1-Jun-08 16:54 
AnswerRe: Two basic questions about reflection Pin
PIEBALDconsult1-Jun-08 17:42
mvePIEBALDconsult1-Jun-08 17:42 
GeneralRe: Two basic questions about reflection Pin
George_George1-Jun-08 18:35
George_George1-Jun-08 18:35 
GeneralRe: Two basic questions about reflection Pin
PIEBALDconsult1-Jun-08 19:20
mvePIEBALDconsult1-Jun-08 19:20 
GeneralRe: Two basic questions about reflection Pin
George_George1-Jun-08 19:42
George_George1-Jun-08 19:42 
GeneralRe: Two basic questions about reflection Pin
Scott Dorman2-Jun-08 4:37
professionalScott Dorman2-Jun-08 4:37 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 2:32
George_George3-Jun-08 2:32 
GeneralRe: Two basic questions about reflection Pin
Scott Dorman3-Jun-08 2:43
professionalScott Dorman3-Jun-08 2:43 
George_George wrote:
Means using BindingFlags.NonPublic to grant permission?


No, permission is different and is part of Code Access Security (CAS), which is an entirely different topic. To grant permission you would need to add a ReflectionPermission attribute to the code somewhere (not sure where since I don't know the code you are using and don't do a lot with CAS and reflection.

George_George wrote:
I am confused what means "outside the current assembly" and why it applies to my situaion, since I am always using the same assembly -- the current.


"Outside the current assembly" means just that - the calling code is located in a different physical assembly than the code being called. This may not be the case.

What it comes down to is that you really should think of the binding flags like a combination of this:

1. BindingFlags.Instance or BindingFlags.Static
2. BindingFlags.Public or BindingFlags.NonPublic or ... (any of the other flags)

By just specifying BindingFlags.Instance you are effectively saying get me any instance field that is neither public nor non-public, which really doesn't leave a lot. Smile | :)

Scott.

—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

[Forum Guidelines] [Articles] [Blog]

GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 3:05
George_George3-Jun-08 3:05 
GeneralRe: Two basic questions about reflection Pin
Scott Dorman3-Jun-08 3:15
professionalScott Dorman3-Jun-08 3:15 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 15:33
George_George3-Jun-08 15:33 
GeneralRe: Two basic questions about reflection Pin
Scott Dorman3-Jun-08 16:36
professionalScott Dorman3-Jun-08 16:36 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 17:27
George_George3-Jun-08 17:27 
GeneralRe: Two basic questions about reflection Pin
PIEBALDconsult2-Jun-08 6:29
mvePIEBALDconsult2-Jun-08 6:29 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 2:34
George_George3-Jun-08 2:34 
GeneralRe: Two basic questions about reflection Pin
PIEBALDconsult3-Jun-08 18:01
mvePIEBALDconsult3-Jun-08 18:01 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 18:23
George_George3-Jun-08 18:23 
GeneralRe: Two basic questions about reflection Pin
PIEBALDconsult3-Jun-08 18:46
mvePIEBALDconsult3-Jun-08 18:46 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 18:52
George_George3-Jun-08 18:52 
GeneralRe: Two basic questions about reflection Pin
PIEBALDconsult3-Jun-08 19:06
mvePIEBALDconsult3-Jun-08 19:06 
GeneralRe: Two basic questions about reflection Pin
George_George3-Jun-08 21:35
George_George3-Jun-08 21:35 
Questionhow to use event to re-write this code segment? Pin
George_George1-Jun-08 15:11
George_George1-Jun-08 15:11 
AnswerRe: how to use event to re-write this code segment? Pin
Christian Graus1-Jun-08 15:52
protectorChristian Graus1-Jun-08 15:52 
GeneralRe: how to use event to re-write this code segment? Pin
George_George1-Jun-08 16:24
George_George1-Jun-08 16:24 
GeneralRe: how to use event to re-write this code segment? Pin
Christian Graus1-Jun-08 16:39
protectorChristian Graus1-Jun-08 16:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.