public DynamicFieldVector(ISimObject pSimObject, string pFieldName, int pCount, GetterFunction pGetterFunction, SetterFunction pSetterFunction) { _OwnerObject = pSimObject; _FieldName = pFieldName; _Count = pCount; _GetterFunction = pGetterFunction; _SetterFunction = pSetterFunction; }
public PrimitiveFieldVector(SimObject pSimObject, int pCount, OutGetterFunction pOutGetterFunction, SetterFunction pSetterFunction) { _OwnerObject = pSimObject; _Count = pCount; _GetterFunction = null; _OutGetterFunction = pOutGetterFunction; _SetterFunction = pSetterFunction; }
protected void AddInstanceProperty(ObjectInstance target, string name, Func <T, JsValue> get, Action <T, JsValue> set, bool enumerable, bool configurable) { GetterFunction getter = null; if (get != null) { getter = new GetterFunction(Engine, get); } SetterFunction setter = null; if (set != null) { setter = new SetterFunction(Engine, set); } target.DefineOwnProperty(name, new PropertyDescriptor(getter, setter, enumerable, configurable), false); }
/// <summary> /// The base constructor for specifying the getter and setter. /// </summary> /// <param name="getter">The method that will be used as the indexer's getter.</param> /// <param name="setter">The method that will be used as the indexer's setter.</param> public NamedIndexerBase(GetterFunction getter, SetterFunction setter = null) { _getter = getter; _setter = setter; }