Hi folks,
I've got a simple winform test app i'm using to try some Log4Net Dependency Injection stuff.
I've made a simple interface in my Services project :-
public interface ILogging
{
void Debug(string message);
// snip the other's.
}
Then my concrete type will be using Log4Net...
public class Log4NetLogging : ILogging
{...
Hello,
I am writing an application that I am working on a skinning feature to it. What I want to do is allow a user to create an XML document that my code will parse through and set properties of the controls on a form. This is the easy part. Where I am stuck is giving the user a way to find out the control names/types with minimal ...
Hi,
I've got an assembly (loaded as ReflectionOnly) and I want to find all the namespaces in this assembly so I can convert them into "using" ("Imports" in VB) statements for an auto-generated source code file template.
Ideally I'd like to restrict myself to top-level namespaces only, so instead of:
using System;
using System.Collecti...
I have a situation where a user's code is throwing an IllegalAccessException on a field accessed by reflection. Just before accessing the field, setAccessible(true) is called. So, it would seem to me that this method is silently failing.
Under what situations would this happen? Could this have something to do with a security manager...
I'm not sure if I'm totally missing something here but I can't find any way to determine if a parameter is passed by reference or not by using reflection.
ArgumentInfo has a property "IsOut", but no "IsRef". How would I go about to get all reference parameters in a given MethodInfo?
...
I'm currently writing a library that can be used to show the internal state of some running code (mainly fields and properties both public and private). Objects are accessed in a different thread to put their info into a window for the user to see. The problem is, there are times while I'm walking a long IList in which its structure may ...
I have an HtmlHelper CmsEntry that is used like this
<%= Html.CmsEntry("stores.buyourstuff")%>
This helper is used lots of times and I want to generate a list of all views that contain this helper.
The list should contain the Viewname and the key ("stores.buyourstuff").
Is there a tool or some sample code that already does this?
...
Is it possible in Java to access private field str via reflection?
For example to get value of this field.
class Test
{
private String str;
public void setStr(String value)
{
str = value;
}
}
...
Hello,
I am trying to create an expression tree containing a function call to a F# function on a certain module. However, I am missing something because the System.Linq.Expressions.Expression.Call() helper function cant find the function I'm supplying.
The Call() call gives an InvalidOperationException: "No method 'myFunction' on type ...
Say, if I have a Lisp program, which uses (eval 'sym) and looks it up in its symbol-table does it actually perform better than something like aClass.getField("sym", anInstance) in "static" languages?
...
How do I obtain a list of all of the pages within an asp.net mvc project for use in a dropdown list.
I'd also like to obtain a list of all of the controls within that page.
The problem is that I'd be calling this from a different project in the same solution.
Can i use reflection for this????
...
Hi,
I'm afraid that the answer is no, but maybe one of you surprises me.
Thanks.
Edit 1:
I'm aware that the question doesn't make much sense but I think the point was understood and, sadly, the answer is no. Anyway I changed the title of the question adding quotes to the word "reflectively" and I will try to better explain my inte...
Can I set a private property via reflection?
public abstract class Entity
{
private int _id;
private DateTime? _createdOn;
public virtual T Id
{
get { return _id; }
private set { ChangePropertyAndNotify(ref _id, value, x => Id); }
}
public virtual DateTime? CreatedOn
{
get { return ...
Is there a simple way to print the code of a delegate at runtime ? (that "contains one method").
public delegate void SimpleDelegate();
SimpleDelegate delegateInstance =
delegate { DoSomeStuff(); int i = DoOtherStuff() };
Now, I would like to display on the screen the body of delegateInstance. That is to say, doing someth...
I would like to write a function that takes a function f as an argument and returns the System.Reflection.MethodInfo associated to f.
I'm not quite sure if it is feasible or not.
Thanks a lot.
...
I'm new to System.Reflection and I've stumbled on the following.
I am using a third party executable, A, that has a custom interpreter engine class B that allows me to build simple 'tasks' that run on a mobile device. 'A' also has a class C that, when using A's default interface, shows a list of 'tasks' that are running within the inter...
So what I am trying to do is to have a set UI with certain controls, and I want to have some class instance to fill in the values.
For instance:
Classes that can populate the UI:
Sharpen, Blur, Smear, ... : FilterBase
So whenever the user creates an instances of the above classes, I want to automatically fetch the values based on th...
Hi,
I think the title says it all. I want a static helper method to remove magic strings. Of course, I could pack the property method inside the TestContainer, which would remove the need to provide the TestContainer as argument. This is done nicely here.
But I would like to have the helper method in one static class, in case I later d...
I'm currently building a node editor (as in Blender) and am having trouble getting delegates to property accessors from a generic type. So far the question here has brought me closest, but I'm having trouble that I think is specifically related to the type of object being generic.
For reference, a "Node" is synonymous with an object, an...
hi
I need a method that takes a Type and returns the pathes of all assemblies that used in the type.
I wrote this:
public static IEnumerable<string> GetReferencesAssembliesPathes(this Type type)
{
yield return type.Assembly.Location;
foreach (AssemblyName assemblyName in type.Assembly.GetReferencedAssemblies())
{
yield return ...