protected IJsCsGlue Convert(IGlueFactory factory, object @object, IGenericPropertyAcessor propertyAcessor) { var result = factory.Build(@object, propertyAcessor); result.SetAttributes(MapNested(@object, propertyAcessor)); return(result); }
private List <IJsCsGlue> MapNested(object parentObject, IGenericPropertyAcessor propertyAcessor) { var properties = propertyAcessor.ReadProperties; var attributes = new List <IJsCsGlue>(properties.Count); foreach (var propertyInfo in properties) { var childvalue = propertyInfo.Get(parentObject); var child = _Converter.Map(childvalue).AddRef(); attributes.Add(child); } return(attributes); }
void IJavascriptObjectBuilder.RequestObjectCreation(IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue) { var value = _Factory.CreateObject(!attributeDescription.HasReadWriteProperties); SetJsValue(value); _AfterChildrenUpdates = () => { var properties = attributeDescription.ReadProperties; var count = properties.Count; for (var i = 0; i < count; i++) { value.SetValue(properties[i].Name, attributeValue[i].JsValue); } }; }
public JsGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor) { _TypePropertyAccessor = typePropertyAccessor; CValue = cValue; }
internal static ObjectDescriptor CreateObjectDescriptor(IJsCsGlue father, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue) { return(new ObjectDescriptor(father, attributeDescription.AttributeNames, attributeValue)); }
public JsMappableGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor) : base(cValue, typePropertyAccessor) { }
public GlueObjectBuilder(CSharpToJavascriptConverter converter, IWebSessionLogger logger, Type type) { _Converter = converter; _Logger = logger; _PropertyAccessor = type.GetTypePropertyInfo(); }
public JsGenericObject Build(object from, IGenericPropertyAcessor typePropertyAccessor) { return(Cache(from, new JsGenericObject(from, typePropertyAccessor))); }
internal void RequestObjectCreation(IJsCsGlue glue, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue) { _ObjectsCreationRequest.AddRequest(EntityDescriptor.CreateObjectDescriptor(glue, attributeDescription, attributeValue), attributeDescription.Observability); }
public void RequestObjectCreation(IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue) { _JavascriptObjectBuilder.RequestObjectCreation(_Object, attributeDescription, attributeValue); }
internal void RequestObjectCreation(IJsCsGlue glue, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue) { var updatableFromJs = attributeDescription.HasReadWriteProperties; _ObjectsCreationRequest.AddRequest(EntityDescriptor.CreateObjectDescriptor(glue, attributeDescription, attributeValue), updatableFromJs); }