Questions tagged [dynamicobject]

A Microsoft .NET Framework (version 4+) base class for specifying dynamic behavior at run time.

The DynamicObject class enables you to define which operations can be performed on dynamic objects and how to perform those operations. The DynamicObject class enables you to override operations like getting or setting a member, calling a method, or performing any binary, unary, or type conversion operation.

Inheritance Hierarchy

System.Object   
  System.Dynamic.DynamicObject

Reference: https://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject%28v=vs.110%29.aspx

171 questions
0
votes
1 answer

C# Approach to create dynamic objects with Intellisense support

I have a client/server application using C#. In my design, the client will request to server some data filtering and gathering that are supported by server through C# classes and methods. I have a single server connection that receives the requests…
Mendes
  • 17,489
  • 35
  • 150
  • 263
0
votes
1 answer

How to Construct Object from Xml string

How to Construct Object from Xml string using DynamicObject and how to use it.
Ahmed Assaf
  • 601
  • 7
  • 25
0
votes
2 answers

Reflection - Sample Code - ClassNotFoundException Error

I was trying this sample code of reflection : import java.lang.reflect.Method; class Test { public Test() { } public void sayHello() { System.out.println("Hello"); } } public class Foo { …
0
votes
0 answers

DynamicObject's TryConvert is not being called for limited-visibility type

I wonder why does changing visiblity of DynamicObject-derived class to private prevent the framework from calling TryConvert. I.e. following code outputs like this: Calling TryGetMember Calling TryConvert But if I change public sealed class…
Cheerkin
  • 43
  • 5
0
votes
1 answer

How to access the object names when they are created randomly

Random objects are created on the screen with the help of code written below. I want to give these random objects name and access it when user taps a particular object, i am actually creating a game when user taps on a particular objects, then only…
dk3611
  • 51
  • 1
  • 5
0
votes
2 answers

Reformat JSON with dynamic object names in jQuery

I have a simple set of JSON that needs to be reformatted since all of the key value pairs are not always output. { "result": [ { "category": "Negative Notification", "event": "open", "result": 2 }, { …
Taylor
  • 75
  • 2
  • 13
0
votes
2 answers

"'object' does not contain a definition for 'property' and no extension method 'property' accepting a first argument of type 'object' could be found"

I've created a simple class that is a descendant of DynamicObject: public class DynamicCsv : DynamicObject { private Dictionary _fieldIndex; private string[] _RowValues; internal DynamicCsv(string[] values,…
BermudaLamb
  • 273
  • 3
  • 5
  • 24
0
votes
2 answers

How to handle a dynamic class differently based on expected return value

Which method of DynamicObject do I have to override in order to get a different behavior (in the dynamic class) based on the context in which the instance is used? Here is an example of what I am trying to accomplish: class DynamicTest :…
rudimenter
  • 3,242
  • 4
  • 33
  • 46
0
votes
1 answer

Custom object list can't add object at runtime gives "Nullpointer Exception"

I am facing some problem while creating one list of custom type objectlist and adding some object in that list. I have one advertise object list public int ajax_GenerateReports(ResourceRequest request, ResourceResponse response) throws Exception { …
BhavikKama
  • 8,566
  • 12
  • 94
  • 164
0
votes
1 answer

Creating Multiple Dynamically Allocated objects in C++

Another question for those far wiser than I: I'm trying to create 3 instances of a Player Class like so: Player *player1 = new Player("Aaron",0.3333333); Player *player2 = new Player("Bob",0.5); Player *player3 = new Player("Charlie",1); You can…
Mike Daoust
  • 25
  • 1
  • 6
0
votes
1 answer

Use Dynamic objects to return different Types from a Method

The Microsoft Unit Test Wizard creates Accessor objects if you need to test a non-public property from another project. Inside my Unit Tests I create helper functions so that I don't repeat the same code just in every Unit Test method. Currently I…
Josh
  • 8,219
  • 13
  • 76
  • 123
0
votes
1 answer

Why my TryInvokeMember is not called?

My DynamicObject implementation looks like this: public class DynCallsite: DynamicObject { public DynCallsite(ScriptPlayer player) { _player = player; } public override bool TryInvokeMember(InvokeMemberBinder binder,…
Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
0
votes
3 answers

Dynamic TImage's in dynamic TPanel's?

OK, I'm trying to create some custom number of TPanel's at runtime on TScrollBox surface like you can see on following image. To get this I'm using following code and that works fine. var pan: array of TPanel; maxp, i, x, y: Integer; ... maxp…
Wh1T3h4Ck5
  • 8,399
  • 9
  • 59
  • 79
0
votes
1 answer

Setting values in tags after retrieving them from Database

I have JSP page. In that page under HTML tags i have tags. Now the values for these input tags are to be set, after they retrieved from the database using JDBC connectivity. Let's say i have a page page1.jsp in which i have a javascript code…
Shantanu Tomar
  • 1,572
  • 7
  • 38
  • 64
-1
votes
1 answer

How to convert List to string?

I have a list of data and want to convert it into string format like headers and values separated. How can I achieve this in c#? Expected Result: dynamic data = { "values": [ [ 5658830, "Support And Training Services Llc", …
Mhd
  • 771
  • 1
  • 8
  • 15
1 2 3
11
12