Class DlrClass
Class which represents an instance of a dlr class for simple using in c#
Inheritance
Implements
Inherited Members
Namespace: Simplic.Dlr
Assembly: Simplic.Dlr.dll
Syntax
public class DlrClass : DynamicObject, IDynamicMetaObjectProvider
Constructors
| Improve this Doc View SourceDlrClass(DlrScriptScope, PythonType, Object[])
Create new dlr class
Declaration
public DlrClass(DlrScriptScope scriptScope, PythonType pythonType, params object[] parameter)
Parameters
Type | Name | Description |
---|---|---|
DlrScriptScope | scriptScope | Scope which contains the class definition and in which the instance will be created |
PythonType | pythonType | Python-Type instance |
System.Object[] | parameter | Arguments for the constructor |
DlrClass(DlrScriptScope, String, Object[])
Create new dlr class
Declaration
public DlrClass(DlrScriptScope scriptScope, string className, params object[] parameter)
Parameters
Type | Name | Description |
---|---|---|
DlrScriptScope | scriptScope | Scope which contains the class definition and in which the instance will be created |
System.String | className | name of the class |
System.Object[] | parameter | Arguments for the constructor |
Properties
| Improve this Doc View SourceInstance
Represents the dynamic class instance
Declaration
public dynamic Instance { get; }
Property Value
Type | Description |
---|---|
System.Object |
ScriptScope
Scope containing the class defn. / instance
Declaration
public DlrScriptScope ScriptScope { get; }
Property Value
Type | Description |
---|---|
DlrScriptScope |
Methods
| Improve this Doc View SourceCallFunction(String, Object[])
Declaration
public dynamic CallFunction(string method, params dynamic[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | method | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
System.Object |
CallFunctionIgnoreCase(String, Object[])
Declaration
public dynamic CallFunctionIgnoreCase(string method, params dynamic[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | method | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
System.Object |
CallMethod(String, Object[])
Declaration
public void CallMethod(string method, params dynamic[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | method | |
System.Object[] | arguments |
GetMember(String)
Declaration
public dynamic GetMember(string member)
Parameters
Type | Name | Description |
---|---|---|
System.String | member |
Returns
Type | Description |
---|---|
System.Object |
SetMember(String, Object)
Declaration
public void SetMember(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Object | value |
TryGetMember(GetMemberBinder, out Object)
Get member over dlr/meta class
Declaration
public override bool TryGetMember(GetMemberBinder binder, out object result)
Parameters
Type | Name | Description |
---|---|---|
System.Dynamic.GetMemberBinder | binder | Binder to the dynamic member |
System.Object | result | Value which should be returned |
Returns
Type | Description |
---|---|
System.Boolean | True if the member exists |
Overrides
TryInvokeMember(InvokeMemberBinder, Object[], out Object)
Invoke a method
Declaration
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
Parameters
Type | Name | Description |
---|---|---|
System.Dynamic.InvokeMemberBinder | binder | Binder to the method |
System.Object[] | args | Arguments for the method |
System.Object | result | Return value of the method |
Returns
Type | Description |
---|---|
System.Boolean | True if calling the method was successfull |
Overrides
TrySetMember(SetMemberBinder, Object)
Set member over dlr/meta class
Declaration
public override bool TrySetMember(SetMemberBinder binder, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Dynamic.SetMemberBinder | binder | Binder to the dynamic member |
System.Object | value | Value which should be set |
Returns
Type | Description |
---|---|
System.Boolean | True if the value was set success full |