JSObjectWrapper GetArrayWrapper() { if (arrayWrapper == null) { arrayWrapper = new JSObjectWrapper(Context, Context.CreateJSArray()); owner.SetProperty(propertyName, arrayWrapper.JSObject); } return(arrayWrapper); }
public JSTypedPrimitiveArray(IJSContext context, object existingJSObject = null) { this.context = context; arrayWrapper = new JSObjectWrapper(context, existingJSObject ?? Context.CreateEmptyJSArray()); if (existingJSObject == null) { arrayWrapper.Activated += OnElementActivated; } }
public BibliographyResult MakeBibliography() { var bib = CallMethod(MakeBibliographyCommand); if (bib is Boolean) { if (!(bool)bib) { return(null); } } var results = ConvertToArray <object>(bib); var jsParameters = new JSObjectWrapper(this, results[0]); return(new BibliographyResult(jsParameters, ExtractJSArray <string>(results[1]))); }
public BibliographyResult(JSObjectWrapper parameters, string[] entries) { MaxOffset = parameters.GetProperty(MaxOffsetName, 0); EntrySpacing = parameters.GetProperty(EntrySpacingName, 1); LineSpacing = parameters.GetProperty(LineSpacingName, 1); HangingIndent = parameters.GetProperty(HangingIndentName, 0) == 2; SecondFieldAlign = parameters.GetProperty(SecondFieldAlignName, string.Empty) ?? string.Empty; Prefix = parameters.GetProperty(BibStartName, string.Empty); Suffix = parameters.GetProperty(BibEndName, string.Empty); Entries = entries; /* * for (var i = 0; i < entries.Length; i++) * { * entries[i] = HtmlHelper.DecodeHtml(entries[i]); * } */ }
protected T[] ExtractJSArray <T>(object jsSource) { var jsObject = new JSObjectWrapper(this, jsSource); var arrayLength = jsObject.GetProperty(LengthProperty, 0); if (arrayLength == -1) { return(null); } var result = new T[arrayLength]; for (var i = 0; i < arrayLength; i++) { result[i] = (T)jsObject.GetProperty(i.ToString()); } return(result); }
protected List <object> ExtractJSArray(object source) { var jsObject = new JSObjectWrapper(this, source); var arrayLength = jsObject.GetProperty(LengthProperty, 0); if (arrayLength == -1) { return(null); } var result = new List <object>(arrayLength); for (var i = 0; i < arrayLength; i++) { var elementValue = jsObject.GetProperty(i.ToString()); result.Add(elementValue); } return(result); }
public JSPrimitiveArrayWrapper(JSObjectWrapper owner, string propertyName) { this.owner = owner; this.propertyName = propertyName; }
public JSOwnedItemWrapper(JSObjectWrapper owner, string propertyName) { this.owner = owner; this.propertyName = propertyName; }