本文整理汇总了C#中JsArray.push方法的典型用法代码示例。如果您正苦于以下问题:C# JsArray.push方法的具体用法?C# JsArray.push怎么用?C# JsArray.push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsArray
的用法示例。
在下文中一共展示了JsArray.push方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getAllRandoriSelectorEntries
public JsArray<JsString> getAllRandoriSelectorEntries()
{
var allEntries = new JsArray<JsString>();
foreach (var cssSelector in hashMap) {
allEntries.push(cssSelector);
}
return allEntries;
}
示例2: SetValue
//[JsMethod(UseNativeOverloads = true)]
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[]>());
}
}
示例3: buildSpinner
void buildSpinner(SpinnerData sd)
{
spinnerData = sd;
var canvas = document.getElementsByTagName("canvas")[0].As<HTMLCanvasElement>();
ctx = canvas.getContext("2d").As<CanvasRenderingContext2D>();
index = 0;
degrees = spinnerData.degrees;
degreesList = new JsArray<JsNumber>();
for (var x = 0; x < degrees; x++)
degreesList.push(x);
// reset
index = 0;
// so I can kill it later
canvasTimer = setInterval(draw, 1000 / degrees);
}
示例4: synchronousTranslate
public override JsArray<Translation> synchronousTranslate(JsString domain, JsArray<JsString> keys)
{
var domainKeys = translations[domain];
var response = new JsArray<Translation>();
if ( domainKeys != null ) {
for ( var i=0; i<keys.length;i++) {
var translation = new Translation();
translation.key = keys[i];
translation.value = domainKeys[keys[i]];
response.push(translation);
}
}
return response;
}
示例5: moveBall
public void moveBall(ball ball, JsAction callback)
{
startBottomItem self = this;
var points = new JsArray<point>();
points.push(new point {x = xMed, y = yMed, inSide = ESlide.center});
for (int y = yMed; y < yMax; ++y)
{
points.push(new point {x = xMed, y = y});
}
points.push(new point {x = xMed, y = yMax, inSide = ESlide.bottom});
points = points.reverse();
HtmlElement div = getDiv();
div.appendChild(ball.getDiv());
_moveBallInternal(ball, points, callback);
}
示例6: init
public override void init(angularScope scope, angularHttp http, angularLocation loc, angularFilter filter)
{
base.init(scope, http, loc, filter);
ngFoods = new JsArray<JsArray<ngFoodItem>>();
ngCategories = new JsArray<string>();
ngCategories.push(CategoryNames.Salat);
ngCategories.push(CategoryNames.First);
ngCategories.push(CategoryNames.Garnir);
ngCategories.push(CategoryNames.MeatOrFish);
ngCategories.push(CategoryNames.ComplexDinner);
ngCategories.push(CategoryNames.Breat);
eventManager.inst.subscribe(eventManager.deviceReady, delegate(int n) { refreshFoods(delegate { }); });
eventManager.inst.subscribe(eventManager.orderListChanged, delegate(int n) { _scope.apply(); });
}
示例7: removeFromArray
public void removeFromArray(JsArray items, JsObject obj)
{
JsArray tmpArray = new JsArray();
foreach (JsObject tmp in items)
{
if (tmp != obj)
{
tmpArray.push(tmp);
}
}
while (items.length > 0)
{
items.pop();
}
foreach (object tmp in tmpArray)
{
items.push(tmp);
}
}
示例8: findChildNodesForSelector
private JsArray<HtmlElement> findChildNodesForSelector(JsArray<HtmlElement> elements, JsArray<JsString> selectorArray)
{
var selector = selectorArray.shift();
//We need to actually abstract this so we can deal with IE and Opera returning a collection instead of a NodeList
var newElements = new JsArray<HtmlElement>();
if ( selector.substr( 0, 1 ) == "." ) {
var className = selector.substring( 1 );
//Lets assume this is a class selector
while ( elements.length > 0 ) {
var element = elements.pop();
var nodes = element.getElementsByClassName( className );
for ( var j=0; j<nodes.length; j++) {
newElements.push( nodes[ j ].As<HtmlElement>() );
}
}
} else {
//invalid but going to assume type for now
while (elements.length > 0) {
var element = elements.pop();
var nodes = element.getElementsByTagName(selector);
for (var j = 0; j < nodes.length; j++) {
newElements.push( nodes[j].As<HtmlElement>() );
}
}
}
//Only recurse if there is another selector
if (selectorArray.length > 0) {
newElements = findChildNodesForSelector(newElements, selectorArray);
}
return newElements;
}
示例9: findChildNodesForCompoundSelector
private JsArray<HtmlElement> findChildNodesForCompoundSelector(HtmlElement element, JsString selector)
{
//lets start with simple ones
var selectors = selector.split( " " );
var ar = new JsArray<HtmlElement>();
ar.push(element);
var elements = findChildNodesForSelector( ar, selectors );
return elements;
}
示例10: foo
void foo()
{
var list = new JsArray<object>();
list.push(new object[7]);
list.push(new byte[7]);
list.push(new short[7]);
list.push(new ushort[7]);
list.push(new int[7]);
list.push(new uint[7]);
list.push(new float[7]);
list.push(new double[7]);
var blubb = new object[] { 7, 8, 9 };
list.push(new object[] { 7, 8, 9 });
list.push(new byte[] { 77, 8, 9 });
list.push(new short[] { 7, 8, 9 });
list.push(new ushort[] { 7, 8, 9 });
list.push(new int[] { 7, 8, 9 });
list.push(new uint[] { 7, 8, 9 });
list.push(new float[] { 7, 8, 9 });
list.push(new double[] { 7, 8, 9 });
list.push(new[] { 7, 8, 9 });
list.push(new[] { 7.7, 8.8, 9.9 });
list.push(new[] { 7d, 8d, 9d });
int[] a = { 0, 2, 4, 6, 8 };
}
示例11: provideTranslations
private JsArray<Translation> provideTranslations(JsString domain, JsArray<JsString> keys)
{
JsArray<Translation> translations = new JsArray<Translation>();
Translation translation;
for (int i = 0; i < keys.length; i++) {
translation = new Translation();
translation.key = keys[i];
translation.value = keyValuePairs[keys[i]];
translations.push(translation);
}
return translations;
}
示例12: GetMethods
public JsImplMethodInfo[] GetMethods()
{
VerifyMethods();
var arr = new JsArray();
for (var i = 0; i < _Methods.length; i++)
{
arr.push(_Methods[i]);
}
return arr.As<JsImplMethodInfo[]>();
}
示例13: init
public override void init(angularScope scope, angularHttp http, angularLocation loc, angularFilter filter)
{
base.init(scope, http, loc, filter);
ngFoods = new JsArray<JsArray<ngFoodItem>>();
ngCategories = new JsArray<string>();
ngCategories.push(CategoryNames.Salat);
ngCategories.push(CategoryNames.First);
ngCategories.push(CategoryNames.Garnir);
ngCategories.push(CategoryNames.MeatOrFish);
ngCategories.push(CategoryNames.ComplexDinner);
ngCategories.push(CategoryNames.Breat);
//eventManager.inst.subscribe(eventManager.dayOfWeekChanged, delegate(int n) { refresh(null); });
//eventManager.inst.subscribe(eventManager.userIdChanged, delegate(int n) { refresh(null); });
eventManager.inst.subscribe(eventManager.settingsLoaded, delegate(int n) {
refreshFoods(delegate {
JsFunction fn = HtmlContext.window.As<JsObject>()["initMenu"].As<JsFunction>();
fn.call();
});
});
eventManager.inst.subscribe(eventManager.orderListChanged, delegate(int n) { _scope.apply(); });
}