public void AddSamples(SampleArray samples) { var uint8 = new Uint8Array(samples.Buffer); JsFunction fromCharCode = JsCode("String.fromCharCode").As <JsFunction>(); var b64 = window.btoa(fromCharCode.apply(null, uint8.As <object[]>()).As <string>()); document.getElementById(_swfId).As <IFlashSynthOutput>().AlphaSynthAddSamples(b64); }
public object GetValue(object obj, object[] indexes) { if (_Getter == null) { throw new Exception("Property " + _Name + " doesn't have a getter"); } var value = _Getter.apply(obj, indexes ?? new JsArray().As <object[]>()); return(value); }
public void SetValue(object obj, object value, object[] indexes) { if (_Setter == null) { throw new Exception("Property " + _Name + " doesn't have a setter"); } if (indexes == null || indexes.Length == 0) { _Setter.call(obj, value); } else { var arr = new JsArray(indexes); arr.push(value); _Setter.apply(obj, indexes ?? new JsArray().As <object[]>()); } }