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
2
votes
2 answers

dynamic object creation in vector

so i would like to have vector theVector as a member of a BaseClass i am wondering in many ways that i can get a memory leaks... will doing this results in memory leaks? BaseClass::someFunction(){ OtherClassName * c = new…
jujiyangasli
  • 360
  • 3
  • 13
2
votes
2 answers

Cannot assign value to ExpandoObject

Just trying out on dynamic objects and I encountered this compile error ExpandoObject myObj = new ExpandoObject(); myObj.GivenName = "Testing"; System.Dynamic.ExpandoObject' does not contain a definition for 'GivenName' and no extension method…
codingbiz
  • 26,179
  • 8
  • 59
  • 96
2
votes
0 answers

Serializable Dynamic Objects created in C# ( WCF ) not accessible in VB.NET

In my solution I have the webservice (backend) written in C# and served via WCF to the client which is the MVC3 web front-end with VB.NET. For one web service I need to send to the client a list of dynamic objects List.…
markof
  • 51
  • 8
2
votes
2 answers

MVVM DynamicObject + Entity Framework STE entities + Property Change Behavior

I'm in the process of creating a BaseViewModel for my WPF projects, which is derived from DynamicObject, and I'm not really sure how to handle property changes to entities 'related' to the main entity (Navigation Properties of the main entity in the…
Federico Berasategui
  • 43,562
  • 11
  • 100
  • 154
1
vote
1 answer

Access object on another form with the form as a variable

I'm writing a program in Delphi which includes creating the same dynamic object on multiple forms (never simultaneously), and then a procedure in another unit writes certain text to it. How the object (TMemo) is created: memHulp :=…
Wilmer Kluever
  • 109
  • 1
  • 8
1
vote
1 answer

Newtonsoft.Json.JsonSerializationException: 'Unexpected token when deserializing object: Comment with Dynamic Object

I am trying to deserialize the JSON to a object using Newtonsoft.Json. Our input json request has commented line. { "paymentMethodToken": "bb3vph6", "paymentMethodTypes": "ACH", "transactionAmount": "1090.9", "transactionType":…
Chandra Mohan
  • 729
  • 2
  • 10
  • 29
1
vote
1 answer

How does the PropertyGrid control display two levels of nested dynamic JSON objects?

I have a requirement that several of my colleagues' configuration files should be displayed uniformly with the PropertyGrid control, which I have implemented with reference to the following…
Jack Zhang
  • 25
  • 5
1
vote
0 answers

I have an Attribute called "public" and i have to access it

Im making a REST Client for a TradeHouse API, it has a giant object with multiple attributes and i want to Convert it into a Class for me to use. For now as i dont want to make my own deserializer im casting it in a "dynamic" and then taking the…
1
vote
2 answers

When overriding DynamicObject's TryInvokeMember(), how to choose a correct overload to invoke?

How would you implement an algorithm to choose the correct method overload, when overriding the following method on DynamicObject? bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
GregC
  • 7,737
  • 2
  • 53
  • 67
1
vote
0 answers

Why is dynamic object in VB.NET calling TryInvokeMember instead of TryGetMember

I am developing a .dll in C# that makes extensive use of DynamicObject. The .dll in other C# projects works fine, however in VB.NET TryGetMember doesn't seem to be called. Instead TryInvokeMember is called even if the member is a property. Here is…
atsekoff
  • 11
  • 1
1
vote
1 answer

DynamicObject databinding on DataGridView, System.Dynamic namespace

I have some collections of objects that inherits DynamicObject class, all works great with the BindingSource and BindingNavigator, but I don't have the dynamic properties displayed on the DatagridView. The objects inherits DynamicObject and…
Pedro Simões
  • 31
  • 1
  • 4
1
vote
0 answers

Create property dynamically in viewmodel MVVM light and UWP

I would like to create viewmodel properties in runtime. I'm not so familiar with MVVM in UWP. Rather windows forms. In the past I created custom class object with reflection and I had possibility to add properties in runtime. In current project I…
Jakub Okaj
  • 11
  • 1
1
vote
1 answer

JsonConvert.DeserializeObject w/ DynamicObject and TypeCreationConverter

I have a class EntityBase that derives from DynamicObject without an empty default constructor. // this is not the actual type but a mock to test the behavior with public class EntityBase : DynamicObject { public string EntityName { get; private…
user1859022
  • 2,585
  • 1
  • 21
  • 33
1
vote
1 answer

Create a dynamic object that implements my custom interface

I am creating some custom API. What I need is pass some object to the api that have "static" required propreties and dynamic optional properties. I have created a dynamic custom object like this: public class MyDynamicEntity : DynamicObject,…
Simone
  • 2,304
  • 6
  • 30
  • 79
1
vote
1 answer

C# DataBinding / Update DynamicObject property from another thread

Previously I was working on an implementation of DynamicObject data binding (see Dynamic object two way data binding), and the solution works great. Since then I have run into the need to be able to update the values from different threads it seems…
Aaron Murray
  • 1,920
  • 3
  • 22
  • 38