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
1
vote
1 answer

Send ExpandoObject to another AppDomain

I'm trying to send one dynamic object (type ExpandoObject) from the main AppDomain to another, and obviously faced the ExpandoObject is not marked as serializable exception. In addition, this ExpandoObject has inner dictionary member (Dictionary…
1
vote
1 answer

Accessing DynamicJsonArray in F#

I'm looking into F# for personal 'fun' reasons and to explore thinking in a functional way. I'm trying to duplicate the functionality of this other code snippet I wrote this morning: here. I've written this code below, however it seems I can't…
Fuginator
  • 229
  • 3
  • 5
  • 15
1
vote
1 answer

WebApi dynamic object not binding

I'm trying to send a dynamic object to an ApiController. Setting my breakpoint on the return null line, I see that the parameters is always null. The AJAX call: $(':checkbox').click(function (event) { var values =…
Quoter
  • 4,236
  • 13
  • 47
  • 69
1
vote
1 answer

"'System.Dynamic.ExpandoObject' does not contain a definition for "PropertyName"

I have the following code that generates Dynamic object from XML file: C# private static List GetClientObject() { var xDoc = XDocument.Load(new StreamReader(xmlPath + @"\client.xml")); dynamic root = new…
Learner
  • 3,904
  • 6
  • 29
  • 44
1
vote
1 answer

Implementing DynamicObject functionality on a class that extends another class

I need an advise on the best way to simulate multiple inheritance for a C# class that needs to be extended with support for dynamics. I have a class MainClass needs not to be dependent on DLR - all its properties and methods are statically compiled.…
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100
1
vote
0 answers

DynamicObject's property needs to be casted before invoking extension methods?

I created a class that extends DynamicObject: public class DynamicEntity : DynamicObject { private readonly Dictionary values = new Dictionary(); public override bool TryGetMember(GetMemberBinder binder, out…
kazinix
  • 28,987
  • 33
  • 107
  • 157
1
vote
0 answers

Silverlight MVVM binding DataGrid to DynamicObject, reevaluating dynamic members

I have a ViewModel which exposes a DataSource which is an ObservableCollection of DynamicObjects. Upon binding, the DataGrid calls GetDynamicMemberNames() on the first DataSource item to obtain the columns it needs to autogenerate and bind to. So…
Paul Siersma
  • 2,036
  • 1
  • 22
  • 25
1
vote
1 answer

Getting the argument names along with values in a dynamic method invoke

I am implementing a DynamicObject. In the TryInvokeMethod, in addition to the arguments ( passed in to the method), I also need the names for the parameters if they have been used. I can see that binder.CallInfo.ArgumentNames does indeed provides…
manojlds
  • 290,304
  • 63
  • 469
  • 417
1
vote
1 answer

Dynamic Hierarchical Javascript Object Loop

var treeData = {"name" : "A", "children" : [ {"name" : "B", "children": [ {"name" : "C", "children" :[]} ]} ]}; THE ARRAY BEFORE SHOULD BE…
1
vote
2 answers

C# DynamicObject class methods

Is there an easy way to create a class method for a subclass of a DyanamicObject or ExpandoObject? Is resorting back to reflection the only way? What I mean is something like :- class Animal : DynamicObject { } class Bird : Animal { } class Dog :…
mfc
  • 3,018
  • 5
  • 31
  • 43
1
vote
2 answers

Load a class "on-the-fly" with php

I have an existent class and I want to create a system to load "plugins" for it. Those "plugins" are created as files and then included in the file with the main class. Now I think the main class needs to extend those little "plugins" with their own…
Octavian
  • 4,519
  • 8
  • 28
  • 39
0
votes
1 answer

System.Dynamic ExpandoControl is it possible?

I'm trying to figure out how to create a web server control which is basically an ExpandoObject. The desire is to automatically create a property on the control when it is created in the aspx markup. For example:
ChrisS
  • 2,595
  • 3
  • 18
  • 19
0
votes
2 answers

How to Create a dynamic class and add it to project

How I can Create a dynamic class and add it to the project(creating from)? can I create class in Build and Rebuild of my project? I mean can I handle Build and Rebuild events in my project? thanks
Arian
  • 12,793
  • 66
  • 176
  • 300
0
votes
0 answers

Add Properties ya fields in a C# Dynamically based on length of a list

Let's say that I have a a list of elements of 'n' size. I want to add 'n' properties in a dynamic object .How can I achieve this? We can't just hard code it because length of list is dynamic. So an object is required in which I need to add…
0
votes
1 answer

How to look if system.__comobject is open before I run that object?

I have this dynamic Object to get the system.__comobject from Access: dynamic app = Marshal.GetActiveObject("Access.Application"); And now I open a form like this: app.Run("gbOpenDataEditPart", "ediQuali.170013662.Wawi"); and that is…