How do I open up and examine a Moss webpart?
I want to look into one of the out of the box MOSS 2007 webparts and examine the code. After that I want to replicate some of the functionality and add some of my own. Any techniques? ...
I want to look into one of the out of the box MOSS 2007 webparts and examine the code. After that I want to replicate some of the functionality and add some of my own. Any techniques? ...
Hi All, I went through all the posts on Reflection but couldn't find the answer to my question. Can you please tell me what were the problems in programming world before .Net Reflection came and how it solved those problems. Please explain with example. ...
Hello community, can someone tell me how I can identify the type of an object in flex? In particular I have an array where I store multiple types in (but all UIComponents) now as I evaluate the array I want to find out whether I have a TextInput Control or a RadioButton. Does someone have an idea? Thanks in advance ...
I have a set of properties defined, the values are all stored as strings. I need to return a new set of properties where the value of each new property may derived in one of 3 ways. A direct copy of a specific source value. A default value. The result of some logic applied to the values of 1 or more source properties. My approach to ...
I have method which gets a POJO as it's parameter. Now I want to programmatically get all the attributes of the POJO (because my code may not know what are all the attributes in it at run time) and need to get the values for the attributes also. Finally I'll form a string representation of the POJO. I could use ToStringBuilder, but I wa...
C#, Net 2.0 Here's the code (I took out all my domain-specific stuff, and it still returns an empty array): using System; using System.Collections.Generic; using System.Text; using System.Reflection; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { ChildClass cc = n...
I've a Java object 'ChildObj' which is extended from 'ParentObj'. Now, if it is possible to retrieve all the attribute names and values of ChildObj, including the inherited attributes too, using Java reflection mechanism? Class.getFields gives me the array of public attributes, and Class.getDeclaredFields gives me the array of all field...
Hello, I’m working on a reflection project, and now I’m stuck. If I have an object of “myclass” that can hold a List does anyone know how to get the type as in the code below if the property myclass.SomList is empty? List<myclass> myList = dataGenerator.getMyClasses(); lbxObjects.ItemsSource = myList; lbxObjects.SelectionChanged +=...
In general, I design classes in such a manner as to not require access to privates for testing purposes. An InternalsVisibleTo can also assist. However, I'm currently dealing with a codebase that has a few area which have become reliant on the private accessors mechanism in VSTS (i.e., using VSCodeGenAccessors to generate *_Accessor cl...
Is there a way in .NET 3.0 (or earlier) to get a string representation of a method? I know that I can get an IL byte array from a MethodBody object, but I'm interested in getting a string that essentially represents the method body as it appears to my eyes in VS. I've poked around in the CodeDom namespace to see if there was a way to co...
Hi, I want to do this in C#, but I don't know how: I have a string with a class name -e.g. "FooClass"- and I want to invoke a (static) method on this class: FooClass.MyMethod(); Obviously, I need to find a reference to the class via reflection, but how? ...
I want to preserve a property between postbacks in an ASP.Net application. Currently doing this: public int MyIndex { get { return (int)Session[ToString() + "MyIndex"]; } } but would prefer something like: public int MyIndex { get { return (int)Sessio...
I think that this problem can be sorted using reflection (a technology which I'm not too sure about). My code is receiving some code objects that have been serialised to XML at runtime. When I receive it and deserialise it one field is causing me some hassle. There is a field that can contain a combination of the following data classes...
Basically, my question is short and sweet: Is the following a bad idea (encapsulating and rethrowing ex.InnerException instead of ex) (There's a similar question here, but not quite... I want to reencapsulate the InnerException, so the stack trace is preserved without reflecting on internals) public abstract class RpcProvider { pub...
Hi, I have created a Generic Extension method for DataRow object. The method takes no argument. I want to Invoke the Generic method through Reflection using MethodInfo. I can do this for Normarl public methods, but somehow I cannot get the reference of the Generic Extension method. I've read this question on SO which somehwat relates t...
Hello developers! I have a Java program that uses reflection to find and invoke the main(String[] args) method of another Java program. This other program is usually a Swing App that tends to spawn its own threads. I was wondering if there was a way to determine when this other 'program' terminates. I'm not sure if there is anyway to de...
I am wanting to access the custom attributes on a Field in the class. I want to access the attributes placed on the field during the fields constructor. Is this possible? Edit 06/28/09 Something like the below pseudo code class SpecialInt { int _intVal; int _maxVal; public SpecialInt() { //Get attribute for the instantiate...
Hi, Im extending a class (DirectoryServices.AccountManagement.Principal) and I need to assign a value to a field in the base class but its marked internal. Can I use reflection to set the value? How would that be done? I found this: base.GetType().GetProperty("unpersisted").SetValue(??, false); But im not quite sure how to give it t...
Hello! It is possible in plain Java to override a method of a class programmatically at runtime (or even create a new method)? I want to be able to do this even if I don't know the classes at compile time. What I mean exactly by overriding at runtime: abstract class MyClass{ public void myMethod(); } class Overrider extends MyCla...
Hi, I need some help trying to come up with a way to set this line of code using reflection: this.extensionCache.properties[attribute] = new ExtensionCacheValue((object[]) value); this.extensionCache is a internal private Field in the base class im inheriting from. I can get at the extensionCache field with ...