Exemplo n.º 1
0
        protected IJsCsGlue Convert(IGlueFactory factory, object @object, IGenericPropertyAcessor propertyAcessor)
        {
            var result = factory.Build(@object, propertyAcessor);

            result.SetAttributes(MapNested(@object, propertyAcessor));
            return(result);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
                }
            };
        }
Exemplo n.º 4
0
 public JsGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor)
 {
     _TypePropertyAccessor = typePropertyAccessor;
     CValue = cValue;
 }
Exemplo n.º 5
0
 internal static ObjectDescriptor CreateObjectDescriptor(IJsCsGlue father, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
 {
     return(new ObjectDescriptor(father, attributeDescription.AttributeNames, attributeValue));
 }
Exemplo n.º 6
0
 public JsMappableGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor) :
     base(cValue, typePropertyAccessor)
 {
 }
Exemplo n.º 7
0
 public GlueObjectBuilder(CSharpToJavascriptConverter converter, IWebSessionLogger logger, Type type)
 {
     _Converter        = converter;
     _Logger           = logger;
     _PropertyAccessor = type.GetTypePropertyInfo();
 }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 10
0
 public void RequestObjectCreation(IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
 {
     _JavascriptObjectBuilder.RequestObjectCreation(_Object, attributeDescription, attributeValue);
 }
Exemplo n.º 11
0
        internal void RequestObjectCreation(IJsCsGlue glue, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
        {
            var updatableFromJs = attributeDescription.HasReadWriteProperties;

            _ObjectsCreationRequest.AddRequest(EntityDescriptor.CreateObjectDescriptor(glue, attributeDescription, attributeValue), updatableFromJs);
        }