reflection Questions

5

Solved

I am using castle DynamicProxy and was wondering if there is a way of detecting if a Type is a proxy without referencing Castle DynamicProxy? So while I am using Castle DynamicProxy as an example ...
Nolte asked 28/7, 2009 at 11:1

4

Solved

Imagine I have the following struct: type MyGeneric[T string | int] struct { } I want to check whether the generic used to instantiate that struct was a string or a int when creating a new MyGener...
Leukoderma asked 27/9, 2022 at 8:45

1

Solved

In C# it's trivial to determine whether a value type is nullable. Specifically, you can obtain this information from the Type itself; for example: public static bool IsNullable(this Type type) =&gt...
Chaparajos asked 9/9 at 12:41

2

Is there any way, using reflection or otherwise, to change a readonly property that has already been set? We sometimes do that in tests, and we don't want to avoid using readonly props just for tes...
Hon asked 18/3, 2022 at 17:12

4

Solved

I want to call a private functions of class SomeClass from outside of this class: class SomeClass { private fun somePrivateFunction() { //... } private fun somePrivateFunctionWithParams(text: ...
Gaucherie asked 17/12, 2019 at 9:12

2

Solved

In C++, object constructors cannot be const-qualified. But - can the constructor of an object of class A know whether it's constructing a const A or a non-const A? Motivated by a fine point in the ...
Vedis asked 2/7, 2021 at 15:46

2

Solved

In Excel, I have a VBA module called MyModule which has a function as such Public Function MyFunction(Param1 As Range, Param2 As Range) As String ' some implementation End Function At runtime...
Throes asked 7/1, 2013 at 17:0

3

Solved

I want to write my enum with custom attributes, for example: public enum SomeEnum: long { [SomeAttribute<MyClass1>] Sms = 1, [SomeAttribute<MyClass2>] Email = 2 } but attributes ...
Plebeian asked 23/10, 2014 at 5:9

5

Solved

I would like to use autoload to use an existings database. I know how to do it without declarative syntax (model/_init_.py): def init_model(engine): """Call me before using any of the tables or c...
Uttermost asked 24/12, 2010 at 13:2

13

Solved

I have a php file which contains only one class. how can I know what class is there by knowing the filename? I know I can do something with regexp matching but is there a standard php way? (the fil...
Rotenone asked 22/8, 2011 at 20:8

3

Solved

I want to populate a drop down with the public properties of a particular object, which I have done fine. But now when the user selects the value from the dropdown, I want it to group the DB table ...
Aquileia asked 23/10, 2013 at 11:41

4

For a collision algorithm I am developing, I need to find out how to reflect a line over another. Line 1: y=ax+b Line 2: y=cx+d Line 3: (a result of reflecting line 1 over line 2) y=e...
Procto asked 30/6, 2013 at 23:42

2

Solved

I have a dynamic module which gets types added to it as my application runs. The module is created via the following code: var assemblyName = new AssemblyName("MyAssembly"); var assemblyBuilder = ...
Promulgate asked 22/8, 2013 at 17:26

5

I have multiple structs in my application using golang. Some fields in a struct have maxsize tags, some does not have. for e.g: type structone struct { fieldone string `valid:MaxSize(2)` fieldtw...
Novosibirsk asked 22/11, 2019 at 7:30

11

Solved

Suppose I only want one or two fields to be included in the generated equals and hashCode implementations (or perhaps exclude one or more fields). For a simple class, e.g.: data class Person(val id...
Topminnow asked 12/4, 2015 at 22:18

6

Solved

I have following: Assembly asm = Assembly.GetAssembly(this.GetType()); foreach (Type type in asm.GetTypes()) { MyAttribute attr = Attribute.GetCustomAttribute(type, typeof(MyAttribute)) as MyAtt...
Kramatorsk asked 2/12, 2010 at 11:57

6

I am testing a method which is protected. In my test case I've used Reflection to access the method but I am not exactly sure whether I am doing it in a right way. Method to be tested: protected ...
Reprovable asked 3/2, 2016 at 20:6

3

Solved

I am doing a project that where I need to register all the properties, because of the system being so huge it would require a lot of work to register all the properties that i want to be dependent ...
Stpeter asked 22/12, 2010 at 0:33

11

Solved

After seeing this: Do access modifiers affect reflection also? I tried using this, but it doesn't work: How can I prevent reflection from executing my private methods?
Selfconfessed asked 2/12, 2011 at 14:0

2

Why calling method toString() on function reference results in an error KotlinReflectionInternalError fun main() { fun foo(){} ::foo.toString() } output: Exception in thread "main" kot...
Woundwort asked 18/11, 2022 at 8:54

4

Solved

I want to exclude all inherited methods from trait(s) from the list that are not overriden in a class So how to know if a class member is inherited from trait? Yes, I can check it like this: if ...
Dustpan asked 5/6, 2015 at 8:38

3

Is there a way in js to list all the builtin functions and some info on their parameterlists? I couldn't really find anything about reflection to do this sort of thing edit: The functions such as ...
Barton asked 1/1, 2012 at 15:54

25

Solved

This exception occurs in a wide variety of scenarios when running an application on Java 9. Certain libraries and frameworks (Spring, Hibernate, JAXB) are particularly prone to it. Here's an exampl...
Mildredmildrid asked 21/12, 2016 at 14:34

5

Solved

Is it possible to get a Type via Type.GetType() when the assembly-qualified name passed into GetType() specifies a different Version than the version of the DLL that's actually loaded? If so, what ...
Schuler asked 21/7, 2009 at 13:55

7

Solved

I'm building a custom property grid that displays the properties of items in a collection. What I want to do is show only the properties in the grid that are common amongst each item. I am assuming...
Inca asked 9/12, 2008 at 16:44

© 2022 - 2024 — McMap. All rights reserved.