Show / Hide Table of Contents

Class DynamicDocument

Динамический объект.

Inheritance
System.Object
DynamicDocument
DynamicWrapper
Namespace:InfinniPlatform.Dynamic
Assembly:InfinniPlatform.Core.Abstractions.dll
Syntax
public class DynamicDocument : IDynamicMetaObjectProvider, IEnumerable, ICustomTypeDescriptor
Remarks

Обеспечивает поведение, аналогичное поведению объекта в JavaScript. По аналогии можно осуществлять прототипное наследование. Прототип может быть определен, как наследник DynamicDocument с определенными в нем прототипными членами, которые можно будет подменить у конкретного экземпляра - наследника прототипа.

Constructors

| Improve this Doc View Source

DynamicDocument()

Declaration
public DynamicDocument()
| Improve this Doc View Source

DynamicDocument(IDictionary<String, Object>)

Declaration
public DynamicDocument(IDictionary<string, object> properties)
Parameters
Type Name Description
IDictionary<System.String, System.Object> properties

Properties

| Improve this Doc View Source

Item[String]

Возвращает или устанавливает значение члена с заданным именем.

Declaration
public object this[string memberName] { get; set; }
Parameters
Type Name Description
System.String memberName

Имя члена.

Property Value
Type Description
System.Object

Значение члена.

Methods

| Improve this Doc View Source

Add(String, Object)

Устанавливает значение члена с заданным именем.

Declaration
public void Add(string memberName, object memberValue)
Parameters
Type Name Description
System.String memberName

Имя члена.

System.Object memberValue

Значение члена.

Remarks

Метод добавлен для возможности использования красивых инициализаторов.

new DynamicDocument
{
  { "Property1", 1 },
  { "Property2", 2 }
}

| Improve this Doc View Source

Clear()

Удаляет динамические свойства объекта.

Declaration
public void Clear()
| Improve this Doc View Source

ToDictionary()

Возвращает значение свойств объекта в виде словаря.

Declaration
public IDictionary<string, object> ToDictionary()
Returns
Type Description
IDictionary<System.String, System.Object>
| Improve this Doc View Source

TryGetMember(String)

Возвращает значение члена с заданным именем.

Declaration
public virtual object TryGetMember(string memberName)
Parameters
Type Name Description
System.String memberName

Имя члена.

Returns
Type Description
System.Object

Значение члена.

| Improve this Doc View Source

TryInvokeMember(String, Object[])

Вызывает член с заданным именем.

Declaration
public virtual object TryInvokeMember(string memberName, object[] invokeArguments)
Parameters
Type Name Description
System.String memberName

Имя члена.

System.Object[] invokeArguments

Аргументы вызова.

Returns
Type Description
System.Object

Результат вызова.

| Improve this Doc View Source

TrySetMember(String, Object)

Устанавливает значение члена с заданным именем.

Declaration
public virtual object TrySetMember(string memberName, object memberValue)
Parameters
Type Name Description
System.String memberName

Имя члена.

System.Object memberValue

Значение члена.

Returns
Type Description
System.Object

Значение члена.

Extension Methods

DynamicCollectionExtensions.GetItem(Object, Int32)
DynamicCollectionExtensions.SetItem(Object, Int32, Object)
DynamicCollectionExtensions.AddItem(Object, Object)
DynamicCollectionExtensions.InsertItem(Object, Int32, Object)
DynamicCollectionExtensions.RemoveItem(Object, Object)
DynamicCollectionExtensions.RemoveItemAt(Object, Int32)
DynamicCollectionExtensions.MoveItem(Object, Object, Int32)
DynamicObjectExtensions.TryGetPropertyValue(Object, String)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TryGetPropertyValueByPath(Object, String)
DynamicObjectExtensions.TrySetPropertyValueByPath(Object, String, Object)
ReflectionExtensions.IsInstanceOfType(Object, Type)
ReflectionExtensions.GetMemberValue(Object, String)
ReflectionExtensions.SetMemberValue(Object, String, Object)
ReflectionExtensions.InvokeMember(Object, String, Object[], out Object, Type[])
ReflectionExtensions.GetFieldValue(Object, FieldInfo)
ReflectionExtensions.SetFieldValue(Object, FieldInfo, Object)
ReflectionExtensions.GetPropertyValue(Object, PropertyInfo)
ReflectionExtensions.SetPropertyValue(Object, PropertyInfo, Object)
ReflectionExtensions.GetMethodDelegate(Object, MethodInfo)
ReflectionExtensions.GetEventDelegate(Object, EventInfo)
ReflectionExtensions.SetEventDelegate(Object, EventInfo, Object)
CommonExtensions.ExecuteSilent<T>(T, Action<T>)
  • Improve this Doc
  • View Source
Back to top © Copyright Infinnity Solutions Ltd, 2010–2017.