public T this[int index] { get { if (index >= Length) { throw new ArgumentOutOfRangeException(); } var jsObject = arrayWrapper.GetProperty(index.ToString()); var result = context.CreateWrappedJSObject <T>(); result.JSObject = jsObject; return(result); //return (T) arrayWrapper.GetProperty(index.ToString()); } set { if (index >= Length) { throw new ArgumentOutOfRangeException(); } arrayWrapper.SetProperty(index.ToString(), value); } }
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); }
public T this[int index] { get { return((T)arrayWrapper.GetProperty(index.ToString())); } set { if (index >= Length) { throw new ArgumentOutOfRangeException(); } arrayWrapper.SetProperty(index.ToString(), value); } }
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 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]); * } */ }