0

This might really be a simple question, but I am stuck without an way out. I am trying to access a property which is not available at design time but visible in "quick watch" at run time. See this question I had posted for details. I have tried getting hold of these "runtime only" visible properties in more ways than one using reflection but I get a null reference saying those properties do not exist in the type.

Any thoughts on why these are inaccessible? Seeing their access specifiers, they appear to be as "sealed" (sealed) (looking at VS.NET Babel icon representation). I could not make sense out of all this. May be something simple that I am missing to understand?

An answer to this MSDN Blog question says it works, does not for me. I have raised a question there as well.

Community
  • 1
  • 1
Lalman
  • 946
  • 2
  • 11
  • 27
  • 1
    sealed means someone doesn't want you modifying them, you technically can do this via reflection but its normally a bad idea – undefined Mar 12 '12 at 11:21
  • Are you talking about private / internal members or members hidden from IntelliSense? – Matthias Mar 12 '12 at 11:22
  • 3
    By itself this question does not make much sense. Try to post independent questions, not sequels. – H H Mar 12 '12 at 11:22
  • Please check my answer to your previous question. – Nikola Markovinović Mar 12 '12 at 11:24
  • I just figured out that these properties are "internal" and I am not sure why there is no public equivalent. By the way, Sorry for an indirect question. Here is what I was trying to do - I wanted to get latest code from TFS using TFS API in C#. I want the "Progress" notified while code is fetched and the GettingEventArgs (Assembly - Microsoft.TeamFoundation.VersionControl.Client) has two properties "Total" and "Current" which are internal, showing up in quickwatch, but there are no public equivalents – Lalman Mar 12 '12 at 11:38
  • Thanks Nikola, I probably did not know that. Will try it. – Lalman Mar 12 '12 at 11:39
  • possible duplicate of [TFS Get Latest Code - GettingEventArgs properties 'Total' and 'Current' not visible](http://stackoverflow.com/questions/9644994/tfs-get-latest-code-gettingeventargs-properties-total-and-current-not-visi) – Hans Passant Mar 12 '12 at 12:23
  • Hans, that question was raised by me as well. I did not get much response on that and hence raised a direct question – Lalman Mar 12 '12 at 12:34
  • BTW, it appears that BindingFlags is all you need to get hold of internal or private properties of any type. See [here](http://stackoverflow.com/questions/9667654/c-sharp-internal-properties-readable-in-quickwatch-but-not-using-reflection) – Lalman Mar 22 '12 at 05:13

0 Answers0