Questions tagged [getproperties]
49 questions
2
votes
0 answers
Com type object problems to get properties
I have the following code in VB.net :
Dim objWorkspace As Object
Dim nrobjects As Integer
Dim dataretrieved As Integer
objWorkspace = GetObject("", "Workspace.Application")
objWorkspace.Documents.Open("d:\testimage.grf")
nrobjects =…

user3611433
- 21
- 2
2
votes
4 answers
Looping through classes, and child classes to retrieve properties and values in C#
I'm trying to loop through a class and it's child classes to get the values passed with it.
Here's my class:
public class MainClass
{
bool IncludeAdvanced { get; set; }
public ChildClass1 ChildClass1 { get; set; }
public ChildClass2…

Richard Whitehouse
- 679
- 3
- 14
- 28
2
votes
1 answer
How to take all the properties of a property file as initialized variables inside a java program?
I'm using properties file in my java program.
Currently whenever I'm need of some property from properties file, I'm using propertyFile.getProperty(propertyKeyName);and taking this into some variable: String propertyName1 =…

merlachandra
- 376
- 2
- 17
1
vote
1 answer
How many nanoseconds does a call to GetProperties() take?
In relation to: Big-O of .GetProperties()
How many nanoseconds does the .GetProperties() method take in C#?
EDIT
Tested:
On simple dev computer (nothing fancy), item has 8 properties, and no inheritance:
stopwatch.Start();
for (int i…

Travis J
- 81,153
- 41
- 202
- 273
1
vote
2 answers
Reflection - setting Type of returned obj?
I am populating different types objects with datarows with each attrivute of the relevant object = to the similiarly name field in the datarow.
I'd like to use a generic function to do this. How do I force the Type of the return object from the…

callisto
- 4,921
- 11
- 51
- 92
1
vote
3 answers
How to extract System.Reflection.PropertyInfo names of a class object as first row of a csv file
I'm trying to use System.Reflection to output a first row of column header information for a csv text file before I create the actual generic List from my data source.
public class DocMetaData
{
public const string SEPARATOR = "\t"; //…

John Adams
- 4,773
- 25
- 91
- 131
1
vote
1 answer
How to get all properties of a class with generic type parameter
See the following example. When having properties where the property type is a class with a generic type parameter, how can I list all those properties regardless of generic type parameter?
class Program
{
public static…

Oystein
- 1,232
- 11
- 26
1
vote
0 answers
TypeDescriptor.GetProperties filtering by attribute instances does not work correctly with the objects implementing ICustomTypeDescriptor
Suppose we have two classes A and B. Class A has some browsable and non-browsable properties, class B is derived from A and implements ICustomTypeDescriptor interface (simply through the calls to the TypeDescriptor methods with true passed as…

Serge N
- 96
- 1
- 7
1
vote
1 answer
TypeDescriptor.GetProperties return nothing from a class
I have defined a class TestObject that contains two simple properties num and name. I am trying to use TypeDescriptor.GetProperties() for the object of TestObject class to retrieve the defined properties. But, it doesn't return anything.
public…

Sri Reddy
- 6,832
- 20
- 70
- 112
1
vote
3 answers
List sent as List; how to get the properties?
I have this piece of code
public class Ticket
{
public string strArticleID { get; set; }
public string strArticleDescription { get; set; }
public decimal decArticlePrice { get; set; }
public decimal decArticleVAT…

Mario
- 283
- 2
- 13
1
vote
1 answer
.GetType().GetProperties() returns properties in different order
I want to check our configuration file and see if it is the same as if I were to create a new configuration file. This method is called GetConfig().
After some hours I noticed that if I save my configuration file and then call GetConfig it works,…

SHEePYTaGGeRNeP
- 320
- 3
- 14
1
vote
1 answer
SoapUI & Groovy - How to get properties from different TestCases using Run testCase
Sorry in advance. I am sure this is not a new question but I swear I've been looking for days and have tried several solutions but no one fits exactly what I need. I hope you guys can help me...
My problem:
I have a main script which sends bash…

cin2e
- 23
- 1
- 7
1
vote
1 answer
Get object properties with reflection except instance properties
I want to enumerate all object properties using reflection but i want to exclude the properties that reference objects (this should be fast enough because i'm using in a caching solution using Redis/Booksleve).
Currently i have the following but…

PanKak
- 133
- 12
1
vote
1 answer
Full load product in magento
On product list/grid magento already has collection of products, and get from it products using foreach.
$_productCollection=$this->getLoadedProductCollection();
...
foreach ($_productCollection as $_product):
But these products don't have all…

zhartaunik
- 932
- 12
- 29
1
vote
0 answers
getproperty and getproperties in MapBuilder.cs in ent lib`source code 5.0
i read the MapBuilder.cs source code in the ent lib 5.0;
some code seems so weird for me, i just can`t figurt out whats the purpose of doing so:
public static IMapBuilderContext MapAllProperties()
{
IMapBuilderContext context =…

pinopino
- 264
- 2
- 12