Hey Guys,
I've got a cross thread invoke going on, and the invoke works fine, however I have found that all subsequent function calls need to be invoked aswell, otherwise it throws exceptions, how do I go about either modifiying my invoke command, or through some other solution, fix this?
This is my current invoker:
foreach (chat_wind...
(set! *warn-on-reflection* true)
(proxy [javax.swing.JPanel] []
(paintComponent [#^java.awt.Graphics g]
(proxy-super paintComponent g)
(.fillRect g 100 100 10 10)))
"Reflection warning, call to paintComponent can't be resolved"
...
The question I have is this: If I have the MethodInfo object, for a method, obtained from an interface type, and I also have the Type object for a class that implements this interface, but it implements the said method with an explicit implementation, how do I correctly obtain the corresponding MethodInfo object for the implementing meth...
I'd like to be able to add a runtime object inspector to my iPhone app, mostly for debugging purposes.
This would let me do something like:
[inspector addObject:someObject];
and in my app, a view would appear that would let me browse and change the public properties of the object in question.
Possibly it would work with a subset o...
I need to create a dynamic enum and then be able to get the type using Type.GetType(). Is this possible?
The below code will create a dynamic enum, and attempt to use it's qualifying name. This is fine if I first store the assembly (using AssemblyBuilderAccess.RunAndSave). However, this is not possible if I'm solely using AssemblyBuilde...
Hi,
I have a class with information about a Person. Something like:
public class Contact {
private String name;
private String location;
private String address;
private String email;
private String phone;
private String fax;
public String toString() {
// Something here
}
// Getters and setter...
How can I achieve this without using Compile() but just with normal reflection?
var value = Expression.Lambda(memberExpression).Compile().DynamicInvoke();
I want this to be able to run on an IPhone (MonoTouch), which does not allow dynamic compiling.
UPDATE: Here is more context. This is the code I am working on:
if (expression.Exp...
Hi All,
I need a little help. I am fairly new to reflection. We're using a 3rd party api and it returns a class called "AddressList". It has public properties within it literally called Address1, Address1Name, Address1Desc, Address2, Address2Name, Address2Desc, Address3, Address3Name, Address3Desc,... Address99, Address99Name, Address99D...
Trying to figure out how to create a method that will iterate over the properties of an object, and output them (say console.writeline for now).
Is this possible using reflection?
e.g.
public void OutputProperties(object o)
{
// loop through all properties and output the values
}
...
Does Type.GetProperties() guarantee a certain order for its PropertyInfo[] result? Such as returning them in alphabetical order by property name or the order they appear in code. Or is the order undefined?
...
Suppose you are given a Class.dll assembly compiled from the following simple code:
namespace ClassLibrary
{
public class Class
{
}
}
And consider a different project with the above Class.dll as a project reference and with the following code:
Assembly assembly = Assembly.LoadFrom(@"Class.dll");
Type reflectedType = asse...
In Java 6, is it possible to inject some value into a (@Target(ElementType.PARAMETER) and @Retention(RetentionPolicy.RUNTIME)-meta-annotated) method parameter?
It's entirely possible to find the annotation at runtime using reflection, it's just that there seems to be no way of actually modifying the parameter's value.
Or is that strict...
I am now to the stage of adding validation to a simple app for editing a few SQL tables via data-bound controls. I can see that the BindingSource knows the limits of the table's structure: if I enter, for example, letters in a field that should contain only decimals, up pops a DataError exception with the message that you can only enter ...
Hello everybody.
I need to get the name of generic-type in form of its declaration in code.
For example:
For List<Int32> I want to get string "List<Int32>".
Standart property Type.Name returns "List`1" in this situation.
EDIT: example was fixed
...
Does anyone have any references for building a full Object/Class reflection system in C++ ?
Ive seen some crazy macro / template solutions however ive never found a system which solves everything to a level im comfortable with.
Thanks!
...
For example System.Net.HttpStatusCode Enum , i would like to get the HTTP Status Codes instead of the HTTP Status Text
System.Net.HttpStatusCode.Forbidden should return 403 instead of "Forbidden"
how can i extract the value?
...
If I have some c++ code as a string quantity (data) in a c++ program, can I execute the contents of that string?
As using the CodeDOM in C# or the eval function present in perl, python, etc..
...
Hi,
If I use
sometype.GetProperties();
I get all of the properties from the type and it's parent. However I only want to retrieve the properties defined explicitly in this type (not the parents). I though that was what the BindingFlags.DeclaredOnly option was for. However, when I try this:
sometype.GetProperties(BindingFlags.Dec...
Lets say I have this class
class Child {
public string FirstName { get; set; }
public string LastName { get; set; }
}
class Container {
public List<Child> { get; set; }
}
I'm working on a deserializer of sorts and I want to be able to create and populate the Child list from the data retrieved. I've gotten this far (I've c...
Does anyone know of a good component (C# WinForms) which would allow creating an options (settings) form, given a custom class with a bunch of properties? I am not looking for something shiny, but something merely better than a property grid. I can easily take care of the visual part, but I simply don't want to lose time doing reflection...