private void InternalLoadComponent() { string text = ReactViewRender.NormalizeUrl(this.component.JavascriptSource); string[] array = text.Split(new string[] { "/" }, StringSplitOptions.None); int num = (array.Length >= 2) ? 2 : 1; string str = this.ToFullUrl(string.Join("/", array.Take(array.Length - num))) + "/"; List <string> list = new List <string> { ReactViewRender.Quote(str), ReactViewRender.Array(new string[] { ReactViewRender.Quote(this.component.NativeObjectName), ReactViewRender.Quote(this.component.Name), ReactViewRender.Quote(text) }) }; if (this.DefaultStyleSheet != null) { list.Add(ReactViewRender.Quote(ReactViewRender.NormalizeUrl(this.ToFullUrl(this.DefaultStyleSheet.ToString())))); } else { list.Add("null"); } list.Add(ReactViewRender.AsBoolean(this.enableDebugMode)); list.Add(ReactViewRender.Quote(this.cacheInvalidationTimestamp)); this.webView.RegisterJavascriptObject(this.component.NativeObjectName, this.component.CreateNativeObject(), null, null, false); IViewModule[] array2 = this.Plugins; if (array2 != null && array2.Length != 0) { IViewModule[] array3 = (from p in this.Plugins where !string.IsNullOrEmpty(p.NativeObjectName) select p).ToArray <IViewModule>(); list.Add(ReactViewRender.Array(from m in array3 select ReactViewRender.Array(new string[] { ReactViewRender.Quote(m.Name), ReactViewRender.Quote(m.NativeObjectName) }))); foreach (IViewModule viewModule in array3) { this.webView.RegisterJavascriptObject(viewModule.NativeObjectName, viewModule.CreateNativeObject(), null, null, false); } list.Add(ReactViewRender.Object(from m in this.Plugins select new KeyValuePair <string, string>(ReactViewRender.Quote(m.Name), ReactViewRender.Quote(ReactViewRender.NormalizeUrl(this.ToFullUrl(m.JavascriptSource)))))); } this.ExecuteDeferredScriptFunction("load", list.ToArray()); this.componentLoaded = true; }
private static string Array(IEnumerable <string> elements) { return(ReactViewRender.Array(elements.ToArray <string>())); }