コード例 #1
0
        private void SetResult(IJavascriptObject[] e, IJSCBridgeCache bridge, Task<object> resulttask)
        {
            _IWebView.RunAsync (() =>
                 {
                     if (e.Length < 2)
                         return;

                     IJavascriptObject promise = e[1];
                     if (!resulttask.IsFaulted)
                     {
                         bridge.RegisterInSession(resulttask.Result, (bridgevalue) =>
                         {
                             promise.InvokeAsync("fullfill", _IWebView, bridgevalue.GetJSSessionValue());
                         });
                     }
                     else
                     {
                         string error = (resulttask.IsCanceled) ? "Cancelled" :
                             ((resulttask.Exception == null) ? "Faulted" : resulttask.Exception.Flatten().InnerException.Message);

                         promise.InvokeAsync("reject", _IWebView, _IWebView.Factory.CreateString(error));
                     }

                 });
        }
コード例 #2
0
        internal void RegisterCollectionMapping(IJavascriptObject jsFather, string att, int index, IJavascriptObject child)
        {
            var father = GetGlobalCached(jsFather);
            var jsos = (att == null) ? father : ((JsGenericObject)father).Attributes[att];

            Update(((JSArray)jsos).Items[index] as IJSObservableBridge, child);
        }
コード例 #3
0
 private JsGenericObject(HTMLViewContext context, IJavascriptObject value)
 {
     JSValue = value;
     _MappedJSValue = value;
     CValue = null;
     _HTMLViewContext = context;
 }
コード例 #4
0
 public JsResultCommand(IWebView webView, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _WebView = webView;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand = resultCommand;
     JSValue = _WebView.Factory.CreateObject(true);
 }
コード例 #5
0
        private void MappNested(object from, IJavascriptObject resobject, JsGenericObject gres)
        {
            if (from == null)
                return;

           var propertyInfos = from.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.CanRead);

            foreach (var propertyInfo in propertyInfos)
            {
                var propertyName = propertyInfo.Name;
                object childvalue;
                try
                {
                    childvalue = propertyInfo.GetValue(from, null); 
                }
                catch(Exception e)
                {
                    _Logger.Info(()=> $"Unable to convert property {propertyName} from {@from} exception {e}");
                    continue;
                }

                var childres = UnsafelMap(childvalue);          
                _Context.WebView.Run(() => resobject.SetValue(propertyName, childres.JSValue));
                gres.UpdateCSharpProperty(propertyName, childres);
            }
        }
コード例 #6
0
 private JSGenericObject(IWebView context, IJavascriptObject value)
 {
     JSValue = value;
     _MappedJSValue = value;
     CValue = null;
     _CefV8Context = context;
 }
コード例 #7
0
 public VueJavascriptViewModelUpdater(IWebView webView, IJavascriptObject listener, Lazy<IJavascriptObject> vueHelper, IWebSessionLogger logger)
 {
     _WebView = webView;
     _Listener = listener;
     _VueHelper = vueHelper;
     _Logger = logger;
 }
コード例 #8
0
 public void SpliceCollection(IJavascriptObject array, int index, int number, IJavascriptObject added) 
 {
     _WebView.RunAsync(() => 
     {
         AddUnsafe(array, index, number, added);
     });
 }
コード例 #9
0
        public void Dispose()
        {
            if (_Listener == null)
                return;

            _Listener.Dispose();
            _Listener = null;
        }
コード例 #10
0
        protected override bool LocalComputeJavascriptValue(IJavascriptObjectFactory factory)
        {
            if (JSValue != null)
                return false;

            JSValue = factory.CreateObject(true);
            return true;
        }
コード例 #11
0
 public void ClearAllCollection(IJavascriptObject array)
 {
     _WebView.RunAsync(() =>
     {
         var length = array.GetArrayLength();
         array.Invoke("silentSplice", _WebView, _WebView.Factory.CreateInt(0), _WebView.Factory.CreateInt(length));
     });
 }
コード例 #12
0
 public void MoveCollectionItem(IJavascriptObject array, IJavascriptObject item, int oldIndex, int newIndex)
 {
     _WebView.RunAsync(() => 
     {
         array.Invoke("silentSplice", _WebView, _WebView.Factory.CreateInt(oldIndex), _WebView.Factory.CreateInt(1));
         AddUnsafe(array, newIndex, 0, item);
     });
 }
コード例 #13
0
 public VueVmManager(IWebView webView, IJavascriptObject listener, IWebSessionLogger logger) 
 {
     _WebView = webView;
     _Logger = logger;
     _VueHelperLazy = new Lazy<IJavascriptObject>(GetVueHelper);
     _VueJavascriptSessionInjector =  new VueJavascriptSessionInjector(webView, listener, _VueHelperLazy, _Logger);
     _VueJavascriptViewModelUpdater = new VueJavascriptViewModelUpdater(webView, listener, _VueHelperLazy, _Logger);    
 }
コード例 #14
0
 private async void CanExecuteCommand(IJavascriptObject[] e)
 {
     var parameter = _JavascriptToCSharpConverter.GetFirstArgumentOrNull(e);
     var res = await UIDispatcher.EvaluateAsync(() => _Command.CanExecute(parameter));
     await WebView.RunAsync(() =>
     {
         UpdateProperty("CanExecuteValue", (f) => f.CreateBool(res));
     });
 }
コード例 #15
0
        private void JavascriptColectionChanged(IJavascriptObject[] arguments)
        {
            var values = arguments[1].GetArrayElements();
            var types = arguments[2].GetArrayElements();
            var indexes = arguments[3].GetArrayElements();
            var collectionChange = new JavascriptCollectionChanges(arguments[0], values.Zip(types, indexes, (v, t, i) => new IndividualJavascriptCollectionChange(t.GetStringValue() == "added" ? CollectionChangeType.Add : CollectionChangeType.Remove, i.GetIntValue(), v)));

            _Observer.OnJavaScriptCollectionChanges(collectionChange);
        }
コード例 #16
0
        internal void RegisterMapping(IJavascriptObject father, string att, IJavascriptObject child)
        {
            var global = GetGlobalCached(father);
            if (global is JSCommand)
                return;

            var jso = (JsGenericObject)global;
            Update(jso.Attributes[att] as IJSObservableBridge, child);
        }
コード例 #17
0
        protected override bool LocalComputeJavascriptValue(IJavascriptObjectFactory factory)
        {
            if (JSValue != null)
                return false;

            JSValue = factory.CreateObject(true);
            JSValue.SetValue("CanExecuteValue", factory.CreateBool(_InitialCanExecute));
            JSValue.SetValue("CanExecuteCount", factory.CreateInt(_Count));
            return true;
        }
コード例 #18
0
        public void UpdateCSharpProperty(string PropertyName, IJSCBridgeCache converter, IJavascriptObject newValue)
        {
            PropertyInfo propertyInfo = CValue.GetType().GetProperty(PropertyName, BindingFlags.Public | BindingFlags.Instance);
            if (!propertyInfo.CanWrite)
                return;

            var type = propertyInfo.PropertyType.GetUnderlyingNullableType() ?? propertyInfo.PropertyType;
            IJSCSGlue glue = converter.GetCachedOrCreateBasic(newValue, type);
            _Attributes[PropertyName] = glue;
            propertyInfo.SetValue(CValue, glue.CValue, null);
        }
コード例 #19
0
        private async Task SetError(IJavascriptObject promise, Exception exception)
        {
            if (promise == null)
                return;

            await WebView.RunAsync(async () =>
            {
                var errormessage = exception?.Message ?? "Faulted";
                await promise.InvokeAsync("reject", WebView, WebView.Factory.CreateString(errormessage));
            });
        }
コード例 #20
0
        private async Task SetResult(IJavascriptObject promise, object result)
        {
            if (promise == null)
                return;

            await WebView.RunAsync(async () =>
            {
                var bridgevalue = await _JavascriptToCSharpConverter.RegisterInSession(result);
                await promise.InvokeAsync("fullfill", WebView, bridgevalue.GetJSSessionValue());
            });
        }
コード例 #21
0
        public bool GetSimpleValue(IJavascriptObject decoratedValue, out object res, Type iTargetType = null) 
        {
            res = null;
            var value = decoratedValue.Convert();

            if ((value.IsUndefined) || (value.IsNull)) 
            {
                return true;
            }

            if (value.IsString) 
            {
                res = value.StringValue;
                return true;
            }

            if (value.IsBool) 
            {
                res = value.BoolValue;
                return true;
            }

            if (iTargetType.IsUnsigned()) 
            {
                if (value.IsUint)
                    res = value.UintValue;
            }
            else 
            {
                if (value.IsInt)
                    res = value.IntValue;
            }

            if ((res == null) && (value.IsDouble)) 
            {
                res = value.DoubleValue;
            }

            if (res != null) 
            {
                if (iTargetType != null)
                    res = Convert.ChangeType(res, iTargetType);

                return true;
            }

            if (value.IsDate) 
            {
                res = value.DateValue.ToUniversalTime(value.DateValue);
                return true;
            }

            return false;
        }
コード例 #22
0
        public bool GetSimpleValue(IJavascriptObject ijsvalue, out object res, Type iTargetType = null)
        {
            res = null;
            CefV8Value value = CefV8_JavascriptObject.Convert(ijsvalue);

            if ((value.IsUndefined) || (value.IsNull))
            {
                return true;
            }

            if (value.IsString)
            {
                res = ijsvalue.GetStringValue();
                return true;
            }

            if (value.IsBool)
            {
                res = value.GetBoolValue();
                return true;
            }

            if (IsUnsigned(iTargetType))
            {
                if (value.IsUInt)
                    res = value.GetUIntValue();
            }
            else
            {
                if (value.IsInt)
                    res = value.GetIntValue();
            }

            if ((res == null) && (value.IsDouble))
            {
                res = value.GetDoubleValue();
            }

            if (res != null)
            {
                if (iTargetType != null)
                    res = Convert.ChangeType(res, iTargetType);

                return true;
            }

            if (value.IsDate)
            {
                res = value.GetDateValue();
                return true;
            }

            return false;
        }
コード例 #23
0
 public HTMLViewContext(IWebView webView, IDispatcher uiDispatcher, IJavascriptFrameworkManager javascriptFrameworkManager,
                         IJavascriptChangesObserver javascriptChangesObserver, IWebSessionLogger logger)
 {
     WebView = webView;
     _logger = logger;
     UIDispatcher = uiDispatcher;
     var builder = new BinderBuilder(webView, javascriptChangesObserver);
     _Listener = builder.BuildListener();
     _VmManager = javascriptFrameworkManager.CreateManager(WebView, _Listener, _logger);
     ViewModelUpdater = _VmManager.ViewModelUpdater;
     JavascriptSessionInjector = _VmManager.Injector;
 }
コード例 #24
0
        protected void Check(IJavascriptObject coll, IList<Skill> iskill) 
        {
            coll.GetArrayLength().Should().Be(iskill.Count);

            for (int i = 0; i < iskill.Count; i++) 
            {
                var c = coll.GetValue(i);

                (GetSafe(() => GetStringAttribute(c, "Name"))).Should().Be(iskill[i].Name);
                (GetSafe(() => GetStringAttribute(c, "Type"))).Should().Be(iskill[i].Type);
            }
        }
 private static object GetArgument(this IJavascriptToCSharpConverter converter, IJavascriptObject javascriptObject)
 {
     try
     {
         var found = converter.GetCachedOrCreateBasic(javascriptObject, null);
         return found?.CValue;
     }
     catch (Exception)
     {
         return null;
     }
 }
コード例 #26
0
        private IJavascriptObject GetMapper(IJavascriptMapper iMapperListener)
        {
            _IJavascriptMapper.Enqueue(iMapperListener);
    
            if (_Mapper != null)
                return _Mapper;

            _Mapper = _IWebView.Factory.CreateObject(false);

            _Mapper.Bind("Register", _IWebView, (c, o, e) =>
            {
                if (_PullNextMapper)
                { 
                    _Current = _IJavascriptMapper.Dequeue();
                    _PullNextMapper = false;
                }

                if (_Current == null)
                    return;

                int count = e.Length;
                IJavascriptObject registered = e[0];

                switch (count)
                {
                    case 1:
                        _Current.RegisterFirst(registered);
                        break;

                    case 3:
                        _Current.RegisterMapping(e[1], e[2].GetStringValue(), registered);
                        break;

                    case 4:
                        _Current.RegisterCollectionMapping(e[1], e[2].GetStringValue(), e[3].GetIntValue(), registered);
                        break;
                }
             });

            _Mapper.Bind("End", _IWebView, (c, o, e) =>
                {
                    if (_PullNextMapper)
                        _Current = _IJavascriptMapper.Dequeue();

                    if (_Current!=null)
                        _Current.End(e[0]);
                    _Current = null;
                    _PullNextMapper = true;
                });

            return _Mapper;
        }
コード例 #27
0
        private IJavascriptObject GetKo()
        {
            if (_Ko != null)
                return _Ko;

            _Ko = _WebView.GetGlobal().GetValue("ko");
            if ((_Ko == null) || (!_Ko.IsObject))
                throw ExceptionHelper.Get("ko object not found! You should add a link to knockout.js script to the HML document!");

            _Ko.Bind("log", _WebView, (e) => _logger.Info(() => string.Join(" - ", e.Select(s => (s.GetStringValue().Replace("\n", " "))))));

            return _Ko;
        }
コード例 #28
0
        public void UpdateProperty(IJavascriptObject father, string propertyName, IJavascriptObject value)
        {
            var silenter = GetSilenter(father, propertyName);
            if (silenter != null)
            {
                Silent(silenter, value);
                return;
            }

            _WebView.RunAsync(() =>
            {
                silenter = GetOrCreateSilenter(father, propertyName);
                Silent(silenter, value);
            });
        }
コード例 #29
0
        private async void Execute(IJavascriptObject[] e)
        {
            var argument = _JavascriptToCSharpConverter.GetFirstArgumentOrNull(e);
            var promise = (e.Length > 1) ? e[1] : null;

            try
            {
                var res = await _JSResultCommand.Execute(argument);
                await SetResult(promise, res);
            }
            catch (Exception exception)
            {
                SetError(promise, exception).DoNotWait();
            }
        }
コード例 #30
0
        internal JavascriptSessionInjector(IWebView iWebView, IJavascriptListener iJavascriptListener)
        {
            _IWebView = iWebView;
            _IJavascriptListener = iJavascriptListener;

            _IWebView.Run(() =>
                {
                    _Listener = _IWebView.Factory.CreateObject(false);

                    if (_IJavascriptListener != null)
                    {
                        _Listener.Bind("TrackChanges", _IWebView, (c, o, e) => _IJavascriptListener.OnJavaScriptObjectChanges(e[0], e[1].GetStringValue(), e[2]));
                        _Listener.Bind("TrackCollectionChanges", _IWebView, (c, o, e) => _IJavascriptListener.OnJavaScriptCollectionChanges(e[0], e[1].GetArrayElements(), e[2].GetArrayElements(), e[3].GetArrayElements()));
                    }
                });
        }
コード例 #31
0
 public override void SetJsValue(IJavascriptObject value, IJavascriptSessionCache sessionCache)
 {
     SetJsValue(value);
 }
コード例 #32
0
        public void OnJavaScriptObjectChanges(IJavascriptObject objectchanged, string propertyName, IJavascriptObject newValue)
        {
            try
            {
                var res = _SessionCache.GetGlobalCached(objectchanged) as JsGenericObject;
                if (res == null)
                {
                    return;
                }

                var propertyAccessor = new PropertyAccessor(res.CValue, propertyName, _Logger);
                if (!propertyAccessor.IsSettable)
                {
                    _Logger.Info(() => $"Unable to set C# from javascript object: property: {propertyName} is readonly.");
                    return;
                }


                var targetType = propertyAccessor.GetTargetType();
                var glue       = GetCachedOrCreateBasic(newValue, targetType);

                using (_IsListening ? _ListenerRegister.GetPropertySilenter(res.CValue) : null)
                {
                    propertyAccessor.Set(glue.CValue);
                    res.UpdateCSharpProperty(propertyName, glue);
                }
            }
            catch (Exception e)
            {
                _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}");
            }
        }
コード例 #33
0
 public void SetMappedJsValue(IJavascriptObject jsobject)
 {
     _MappedJsValue = jsobject;
     UpdateJsObject(_MappedJsValue);
 }
コード例 #34
0
        protected async Task CallAsync(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter)
        {
            await _WebView.RunAsync(() => value.Invoke(functionName, _WebView, parameter));

            await WaitAnotherWebContextCycle();
        }
コード例 #35
0
 protected void Call(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter)
 {
     _WebView.Run(() => value.Invoke(functionName, _WebView, parameter));
 }
コード例 #36
0
ファイル: JsResultCommand.cs プロジェクト: jawn/Neutronium
        public void UpdateJsObject(IJavascriptObject javascriptObject)
        {
            IExecutableGlue executable = this;

            javascriptObject.Bind("Execute", WebView, executable.Execute);
        }
コード例 #37
0
ファイル: JsDecimal.cs プロジェクト: zengfr/Neutronium
 void IJsCsGlue.SetJsValue(IJavascriptObject value, IJavascriptSessionCache cache) => base.SetJsValue(value);
コード例 #38
0
 protected void AddAttribute(IJavascriptObject father, string attributeName, IJavascriptObject value)
 {
     _JavascriptFrameworkExtractor.AddAttribute(father, attributeName, value);
 }
コード例 #39
0
 public void SetValue(int index, IJavascriptObject element)
 {
     _CefV8Value.SetValue(index, Convert(element));
 }
コード例 #40
0
ファイル: JSArray.cs プロジェクト: mustafaasaber/Neutronium
 private void MoveJavascriptCollection(IJavascriptViewModelUpdater viewModelUpdater, IJavascriptObject item, int oldIndex, int newIndex)
 {
     viewModelUpdater?.MoveCollectionItem(CachableJsValue, item, oldIndex, newIndex);
 }
コード例 #41
0
 protected string GetStringAttribute(IJavascriptObject value, string attributeName)
 {
     return(_JavascriptFrameworkExtractor.GetAttribute(value, attributeName).GetStringValue());
 }
コード例 #42
0
 public IJavascriptObject ExecuteFunction(IWebView webView, IJavascriptObject context, params IJavascriptObject[] parameters)
 {
     return(_CfrV8Value.ExecuteFunction(context?.Convert(), parameters.Convert()).Convert());
 }
コード例 #43
0
        protected async Task SetAttributeAsync(IJavascriptObject father, string attributeName, IJavascriptObject value)
        {
            await _JavascriptFrameworkExtractor.SetAttributeAsync(father, attributeName, value);

            await WaitAnotherWebContextCycle();
        }
コード例 #44
0
 protected IJavascriptObject GetCollectionAttribute(IJavascriptObject value, string attributeName)
 {
     return(_JavascriptFrameworkExtractor.GetCollectionAttribute(value, attributeName));
 }
コード例 #45
0
 protected bool GetBoolAttribute(IJavascriptObject value, string attributeName)
 {
     return(_JavascriptFrameworkExtractor.GetBoolAttribute(value, attributeName));
 }
コード例 #46
0
        protected async Task <double> GetDoubleAttributeAsync(IJavascriptObject value, string attributeName)
        {
            var jsObject = await GetAttributeAsync(value, attributeName);

            return(jsObject.GetDoubleValue());
        }
コード例 #47
0
 protected double GetDoubleAttribute(IJavascriptObject value, string attributeName)
 {
     return(_JavascriptFrameworkExtractor.GetDoubleAttribute(value, attributeName));
 }
コード例 #48
0
        public async void OnJavaScriptObjectChanges(IJavascriptObject objectchanged, string propertyName, IJavascriptObject newValue)
        {
            try
            {
                var currentfather = _SessionCache.GetCached(objectchanged) as JsGenericObject;
                if (currentfather == null)
                {
                    return;
                }

                var propertyUpdater = currentfather.GetPropertyUpdater(propertyName);
                if (!propertyUpdater.IsSettable)
                {
                    LogReadOnlyProperty(propertyName);
                    return;
                }

                var targetType    = propertyUpdater.TargetType;
                var glue          = GetCachedOrCreateBasic(newValue, targetType);
                var bridgeUpdater = new BridgeUpdater(_SessionCache);

                await Context.RunOnUiContextAsync(() =>
                {
                    using (_ListenerRegister.GetPropertySilenter(currentfather.CValue, propertyName))
                    {
                        var oldValue = propertyUpdater.GetCurrentChildValue();

                        try
                        {
                            propertyUpdater.Set(glue.CValue);
                        }
                        catch (Exception exception)
                        {
                            LogSetError(propertyName, targetType, glue.CValue, exception);
                        }

                        var actualValue = propertyUpdater.GetCurrentChildValue();

                        if (Equals(actualValue, glue.CValue))
                        {
                            var old = currentfather.UpdateGlueProperty(propertyUpdater, glue);
                            bridgeUpdater.Remove(old);
                            bridgeUpdater.CleanAfterChangesOnUiThread(_ListenerRegister.Off);
                            return;
                        }

                        if (!Equals(oldValue, actualValue))
                        {
                            OnCSharpPropertyChanged(currentfather.CValue, new PropertyChangedEventArgs(propertyName));
                        }
                    }
                });

                if (!bridgeUpdater.HasUpdatesOnJavascriptContext)
                {
                    return;
                }

                await Context.RunOnJavascriptContextAsync(() =>
                {
                    bridgeUpdater.UpdateOnJavascriptContext(Context.ViewModelUpdater);
                });
            }
            catch (Exception exception)
            {
                LogJavascriptSetException(exception);
            }
        }
コード例 #49
0
 internal static CefV8Value Convert(IJavascriptObject iIJavascriptObject)
 {
     return((iIJavascriptObject as CefV8_JavascriptObject)._CefV8Value);
 }
コード例 #50
0
 public IJSCSGlue GetCachedOrCreateBasic(IJavascriptObject globalkey, Type iTargetType)
 {
     return(_Context.WebView.Evaluate(() => GetCachedOrCreateBasicUnsafe(globalkey, iTargetType)));
 }
コード例 #51
0
 public void SetValue(string AttributeName, IJavascriptObject element, CreationOption ioption = CreationOption.None)
 {
     _CefV8Value.SetValue(AttributeName, Convert(element), Convert(ioption));
 }
コード例 #52
0
 protected IJavascriptObject CallWithRes(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter)
 {
     return(_WebView.Evaluate(() => value.Invoke(functionName, _WebView, parameter)));
 }
コード例 #53
0
 public void ExecuteFunctionNoResult(IWebView webView, IJavascriptObject context, params IJavascriptObject[] parameters)
 {
     _CfrV8Value.ExecuteFunction(context?.Convert(), parameters.Convert());
 }
コード例 #54
0
 internal RawGlueMapable(object source, IJavascriptObject javascriptObject)
 {
     Source            = source;
     _JavascriptObject = javascriptObject;
 }
コード例 #55
0
 public JavascriptCollectionChanges(IJavascriptObject collection, IEnumerable <IndividualJavascriptCollectionChange> changes)
 {
     Collection = collection;
     Changes    = changes.ToArray();
 }
コード例 #56
0
        protected async Task <IJavascriptObject> CallWithResAsync(IJavascriptObject value, string functionName, params IJavascriptObject[] parameter)
        {
            await WaitAnotherWebContextCycle();

            return(await _WebView.EvaluateAsync(() => value.Invoke(functionName, _WebView, parameter)));
        }
コード例 #57
0
 public void SetMappedJSValue(IJavascriptObject jsobject)
 {
     _MappedJSValue = jsobject;
     _MappedJSValue.Bind("Execute", WebView, Execute);
 }
コード例 #58
0
        protected async Task <IJavascriptObject> GetCollectionAttributeAsync(IJavascriptObject value, string attributeName)
        {
            await WaitAnotherWebContextCycle();

            return(await _JavascriptFrameworkExtractor.GetCollectionAttributeAsync(value, attributeName));
        }
コード例 #59
0
ファイル: JsResultCommand.cs プロジェクト: jawn/Neutronium
 public virtual void SetJsValue(IJavascriptObject value, IJavascriptSessionCache sessionCache)
 {
     SetJsValue(value);
     sessionCache.Cache(this);
 }
コード例 #60
0
ファイル: MobxExtractor.cs プロジェクト: zengfr/Neutronium
 public void SetAttribute(IJavascriptObject father, string attibutename, IJavascriptObject value)
 {
     _WebView.Run(() => father.SetValue(attibutename, value));
 }