コード例 #1
0
        protected IJsCsGlue Convert(IGlueFactory factory, object @object, IGenericPropertyAcessor propertyAcessor)
        {
            var result = factory.Build(@object, propertyAcessor);

            result.SetAttributes(MapNested(@object, propertyAcessor));
            return(result);
        }
コード例 #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);
        }
コード例 #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);
                }
            };
        }
コード例 #4
0
 public JsGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor)
 {
     _TypePropertyAccessor = typePropertyAccessor;
     CValue = cValue;
 }
コード例 #5
0
 internal static ObjectDescriptor CreateObjectDescriptor(IJsCsGlue father, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
 {
     return(new ObjectDescriptor(father, attributeDescription.AttributeNames, attributeValue));
 }
コード例 #6
0
 public JsMappableGenericObject(object cValue, IGenericPropertyAcessor typePropertyAccessor) :
     base(cValue, typePropertyAccessor)
 {
 }
コード例 #7
0
 public GlueObjectBuilder(CSharpToJavascriptConverter converter, IWebSessionLogger logger, Type type)
 {
     _Converter        = converter;
     _Logger           = logger;
     _PropertyAccessor = type.GetTypePropertyInfo();
 }
コード例 #8
0
 public JsGenericObject Build(object from, IGenericPropertyAcessor typePropertyAccessor)
 {
     return(Cache(from, new JsGenericObject(from, typePropertyAccessor)));
 }
コード例 #9
0
 internal void RequestObjectCreation(IJsCsGlue glue, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
 {
     _ObjectsCreationRequest.AddRequest(EntityDescriptor.CreateObjectDescriptor(glue, attributeDescription, attributeValue), attributeDescription.Observability);
 }
コード例 #10
0
 public void RequestObjectCreation(IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
 {
     _JavascriptObjectBuilder.RequestObjectCreation(_Object, attributeDescription, attributeValue);
 }
コード例 #11
0
        internal void RequestObjectCreation(IJsCsGlue glue, IGenericPropertyAcessor attributeDescription, IReadOnlyList <IJsCsGlue> attributeValue)
        {
            var updatableFromJs = attributeDescription.HasReadWriteProperties;

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