本文整理汇总了C#中JsAction类的典型用法代码示例。如果您正苦于以下问题:C# JsAction类的具体用法?C# JsAction怎么用?C# JsAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsAction类属于命名空间,在下文中一共展示了JsAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SendInternal
private void SendInternal(string httpMethod, string type, JsString url, object data,
JsAction<object, JsString, jqXHR> success,
JsAction<JsError, JsString, jqXHR> failed)
{
url = addTimeToUrl(url);
JsObject headers = new JsObject();
AjaxSettings ajaxSettings = new AjaxSettings
{
type = httpMethod,
dataType = type,
data = data,
url = jsUtils.inst.getLocation() + "/" + url,
headers = headers,
success = delegate(object o, JsString s, jqXHR arg3) { success(o, s, arg3); },
error = delegate(jqXHR xhr, JsString s, JsError arg3) { failed(arg3, s, xhr); }
};
bool isString = data.As<JsObject>()["toLowerCase"] != null;
if (isString)
{
ajaxSettings.processData = true;
ajaxSettings.contentType = (type.As<JsString>().toLowerCase() == "xml")
? "application/xml"
: "application/json";
}
jQuery.ajax(
ajaxSettings);
}
开发者ID:mgerasika,项目名称:gam-gam,代码行数:29,代码来源:ajaxHlp.cs
示例2: SendGet
public void SendGet(string type, JsString url, JsAction<object, JsString, jqXHR> success,
JsAction<JsError, JsString, jqXHR> failed)
{
url = addTimeToUrl(url);
JsObject headers = new JsObject();
jQuery.ajax(new AjaxSettings
{
type = "GET",
dataType = type,
url = jsUtils.inst.getLocation() + "/" + url,
headers = headers,
success = delegate(object o, JsString s, jqXHR arg3) { success(o, s, arg3); },
error = delegate(jqXHR xhr, JsString s, JsError arg3) { failed(arg3, s, xhr); }
});
}
开发者ID:mgerasika,项目名称:gam-gam,代码行数:16,代码来源:ajaxHlp.cs
示例3: removeListener
/// <summary>
/// Removes an event handler. ...
/// </summary>
public object removeListener(JsString eventName, JsAction handler, object scope=null){return null;}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Tree.cs
示例4: mun
/// <summary>
/// Shorthand for removeManagedListener. ...
/// </summary>
public object mun(object item, object ename, JsAction fn, object scope){return null;}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Tree.cs
示例5: addManagedListener
/// <summary>
/// Adds listeners to any Observable object (or Element) which are automatically removed when this Component is
/// destroyed. ...
/// </summary>
public object addManagedListener(object item, object ename, JsAction fn=null, object scope=null, object opt=null){return null;}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:5,代码来源:Tree.cs
示例6: getConnectionStatus
/// <summary>
/// The method returns the connection status of the device by invoking a callback function with the status passed.
/// The status is retrieved by trying to insert an image (tag) into the DOM whose reference URL is a remote stored image
/// (by default the google logo of google.de is used - we assume that if google is down, you're not connected.
/// If this is not reliable enough, simply pass your URL as second parameter to the method call).
/// </summary>
/// <param name="callback">The callback object defining target and action.
/// It is also possible to just pass a function to action instead of a string naming the method in a controller.
/// A constant string (M.ONLINE or M.OFFLINE) is passed to the callback as parameter defining whether the device is online or offline.</param>
/// <param name="url"> A URL defining a location of an image that is tried to include. If nothing is passed, a default url is used.</param>
public void getConnectionStatus(JsAction callback, JsString url) { }
开发者ID:hultqvist,项目名称:SharpKit-SDK,代码行数:11,代码来源:TheMProject.cs
示例7: func2
public void func2(JsAction<string> callback)
{
}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:3,代码来源:NamedParameters.cs
示例8: getSub
/// <summary>
/// Returns the value of a subcookie.
/// </summary>
public object getSub(object name, object subName, JsAction converter){return null;}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Cookie.cs
示例9: requestCanRefund
private void requestCanRefund(int day, JsAction complete)
{
JsService.Inst.MoneyApi.CanRefund(day, delegate(bool res) {
ngEntry.canRefund = jsCommonUtils.inst.toBool(res);
HtmlContext.console.log("request can refund for day = " + day + " response = " + ngEntry.canRefund);
if (null != complete) {
complete();
}
});
}
开发者ID:mgerasika,项目名称:gam-gam,代码行数:11,代码来源:ngMoneyController.cs
示例10: requestGetMoney
public void requestGetMoney(string userId, JsAction<decimal> complete)
{
JsService.Inst.MoneyApi.GetMoney(userId, delegate(decimal res) {
if (null != complete) {
complete(res);
}
});
}
开发者ID:mgerasika,项目名称:gam-gam,代码行数:8,代码来源:ngMoneyController.cs
示例11: each
/// <summary>
/// Applies the given function to each Node in the NodeList.
/// </summary>
public void each(JsAction fn, object context){}
开发者ID:hultqvist,项目名称:SharpKit-SDK,代码行数:4,代码来源:NodeList.cs
示例12: transition
/// <summary>
/// Animate one or more css properties to a given value. Requires the "transition" module.
/// <pre>example usage:
/// Y.all('.demo').transition({
/// duration: 1, // in seconds, default is 0.5
/// easing: 'ease-out', // default is 'ease'
/// delay: '1', // delay start for 1 second, default is 0
/// height: '10px',
/// width: '10px',
/// opacity: { // per property
/// value: 0,
/// duration: 2,
/// delay: 2,
/// easing: 'ease-in'
/// }
/// });
/// </pre>
/// </summary>
public void transition(object config, JsAction callback){}
开发者ID:hultqvist,项目名称:SharpKit-SDK,代码行数:19,代码来源:NodeList.cs
示例13: toggleView
/// <summary>
/// Displays or hides each node.
/// If the "transition" module is loaded, toggleView optionally
/// animates the toggling of the nodes using either the default
/// transition effect ('fadeIn'), or the given named effect.
/// </summary>
public void toggleView(object on, JsAction callback){}
开发者ID:hultqvist,项目名称:SharpKit-SDK,代码行数:7,代码来源:NodeList.cs
示例14: some
/// <summary>
/// Executes the function once for each node until a true value is returned.
/// </summary>
public object some(JsAction fn, object context){return null;}
开发者ID:hultqvist,项目名称:SharpKit-SDK,代码行数:4,代码来源:NodeList.cs
示例15: max
/// <summary>
/// Returns the maximum value in the Array. ...
/// </summary>
public static object max( object array, JsAction comparisonFn = null ) { return null; }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Array.cs
示例16: requestPermission
public void requestPermission(JsAction callback) {}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:NotificationCenter.cs
示例17: requestGetUsers
private void requestGetUsers(JsAction complete)
{
JsService.Inst.UsersApi.GetUsers(delegate(JsArray<ngUserModel> res) {
JsArray<ngUserModel> tmp = new JsArray<ngUserModel>();
foreach (ngUserModel user in res) {
if (-1 != user.Email.As<JsString>().indexOf("darwins")) {
tmp.Add(user);
}
}
ngUsers = tmp;
if (null != complete) {
complete();
}
});
}
开发者ID:mgerasika,项目名称:gam-gam,代码行数:16,代码来源:ngMoneyController.cs
示例18: func1
public void func1(JsAction callback)
{
}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:3,代码来源:NamedParameters.cs
示例19: sort
/// <summary>
/// Sorts the elements of an Array. ...
/// </summary>
public static JsArray sort( JsArray array, JsAction sortFn = null ) { return null; }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Array.cs
示例20: each
/// <summary>
/// Iterates an array or an iterable value and invoke the given callback function for each item. ...
/// </summary>
public static bool each( object iterable, JsAction fn, object scope, bool reverse ) { return false; }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:4,代码来源:Array.cs
注:本文中的JsAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论