Tags "reflection" Result


I am trying to use reflection to access the private property of OpenFileDialog fileNames property. I have the following code : filedlg.InitialDirectory = directory.Text; filedlg.Filter = "xml files (*.xml)|*.xml" ; filedlg.FileName = "*.xml"; filedlg.ValidateNames = false; if (filedlg.ShowDialog() == DialogResult.Cancel) retu

it1352 1 2019-07-04


How can I write a line of code that sets an object to be an object thats contained on the parent form. Basically, I have a usercontrol, where one of the properties that I have added that can be entered at design time is an object name (on a windows form). I want to be able to set a variable to that object within the control so I can then manipula

it1352 0 2019-10-07

Using Scala reflection with Java reflection

I have a lot of code that has been using Java reflection to invoke arbitrary user-specified methods on Java objects, as part of a DSL. However, a lot of those Java objects, in practice, are Scala objects, and some of the methods on them are marked with the Scala @deprecated annotation. Unfortunately, Java's annotations mechanism cannot see Scala a

it1352 0 2020-07-06

Explanation for - No Reflection involved

I have a very simple question. This is not only true with spray-json but I have read similar claims with argonaut and circe. So please enlighten me. In spray-json, I have come across the statement saying There is no reflection involved. I understand for type class based approach, if the user provides JsonFormat then all is well. But is this claim

it1352 0 2020-07-08

Is it bad practice to use Reflection in Unit testing?

During the last years I always thought that in Java, Reflection is widely used during Unit testing. Since some of the variables/methods which have to be checked are private, it is somehow necessary to read the values of them. I always thought that the Reflection API is also used for this purpose. Last week i had to test some packages and therefore

it1352 1 2019-05-21

How can I turn off registry redirection on Python?

My program is trying to create an key on the HKLM\Software\Microsoft\Shared Tools\MSCONFIG\startupreg\test\ but instead the key is created on the HKLM\Wow6432node\Software\Microsoft\Shared Tools\MSCONFIG\startupreg\test\ and don't work properly... Why? How can I solve it? Solution The docs on reflection-key features in winreg are scarce (and

it1352 0 2019-05-06

In 3 minutes, What is Reflection?

Many .Net interview question lists (including the good ones) contain the question: "What is Reflection?". I was recently asked to answer this in the context of a 5 question, technical test designed to be completed in 15 minutes on a sheet of blank paper handed to me in a cafeteria. My answer went along the lines of "Reflection allows you to discove

it1352 1 2019-05-06

Javascript Reflection

Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object: var Test = function() { // private methods function testOne() {} function testTwo() {} function testThree() {} // public methods function getMethods() { for (i in this) { alert(i); // shows

it1352 0 2019-05-13

reflection question

Hello - I am wanting to print out a "Yes" next to classes that implement "Interface01", otherwise a "No". Here is my code. It crashes with a null reference exception and I am not sure why. Ideas? Thank you for you help. Tony Imports System.Reflection Public Class Form1 Inherits System.Windows.Forms.Form ''''Windows F

it1352 2 2019-06-25