本文整理汇总了C#中JsNumber类的典型用法代码示例。如果您正苦于以下问题:C# JsNumber类的具体用法?C# JsNumber怎么用?C# JsNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsNumber类属于命名空间,在下文中一共展示了JsNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReady
static void OnReady()
{
var start_counter = new jQuery("#event-start");
var drag_counter = new jQuery("#event-drag");
var stop_counter = new jQuery("#event-stop");
var counts = new JsNumber[3] { 0, 0, 0 };
new jQuery("#draggable").draggable(new DraggableOptions
{
start = (e, ui) =>
{
counts[0]++;
updateCounterStatus(drag_counter, counts[0]);
},
drag = (e, ui) =>
{
counts[1]++;
updateCounterStatus(drag_counter, counts[1]);
},
stop = (e, ui) =>
{
counts[2]++;
updateCounterStatus(drag_counter, counts[2]);
}
});
}
示例2: getPrefix
public string getPrefix(JsNumber price)
{
JsString res = price.As<JsString>();
if (res.indexOf(".") > 0) {
res = res.substr(0, res.indexOf("."));
}
return res;
}
示例3: updateCounterStatus
static void updateCounterStatus(jQuery event_counter, JsNumber new_count)
{
if (!event_counter.hasClass("ui-state-hover"))
{
event_counter.addClass("ui-state-hover")
.siblings().removeClass("ui-state-hover");
}
// ...then update the numbersKD
new jQuery("span.count", event_counter).text(new_count.As<JsString>());
}
示例4: 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);
}
示例5: round
//TODO: type parameter's type?
/// <summary>
/// The method returns rounded version of the given input number.
/// The type of rounding is defined by the second parameter: type. With the optional third parameter decimals, you can specify the number of decimal digits to be returned.
/// For example round(1.2345, M.FLOOR, 3) would return 1.234. The default for this parameter is 0.
/// </summary>
/// <param name="input"> The input value.</param>
/// <param name="type">The type of rounding. Needs to be one of these three:
/// M.FLOOR: Returns the next lower integer, so 2.1 and 2.9 both would return 2.
/// M.CEIL: Returns the next higher integer, so 2.1 and 2.9 both would return 3.
/// M.ROUND: Returns the nearest integer, so 2.1 would return 2 and 2.9 would return 3.</param>
/// <returns>The rounded number.</returns>
public JsNumber round(JsNumber input, object type) { return null; }
示例6: random
//TODO: parametrs type?
/// <summary>
/// The method returns a random number within the range given by the min property and the max property, including the min and max value.
/// A test with 100.000 iterations for random(1, 3) created the following distribution:
/// - 1: 33.2%
/// - 2: 33.2%
/// - 3: 33.6%
/// </summary>
/// <param name="min"> The minimal value.</param>
/// <param name="max">The maximal value.</param>
/// <returns>A random number between the passed range.</returns>
public JsNumber random(JsNumber min, JsNumber max) { return null; }
示例7: log
/// <summary>
/// Logs the passed message on the console. The type of output is defined via an optional passed logging level. If no level is passed, M.DEBUG is used by default.
/// The method also takes care, that things don't blow up, when this object is used in browsers that don't support this or don't have a console.
/// </summary>
/// <param name="msg">The logging message.</param>
/// <param name="level">level (Number, optional): The logging level, as a number from 0 to 3. Can be passed via constant:
/// M.INFO: 0
/// M.DEBUG: 1
/// M.WARN: 2
/// M.ERR: 3</param>
public void log(JsString msg, JsNumber level) { }
示例8: getDatesOfCalendarWeek
/// <summary>
/// This method returns an array containing all dates within one calendar week as an M.Date object..
/// If no parameters are given, the calendar week of the current date is taken.
/// </summary>
/// <param name="calendarWeek">The calendar week. Note: Pass 'null' if you use this method on an existing M.Date object.</param>
/// <returns></returns>
public JsArray getDatesOfCalendarWeek(JsNumber calendarWeek) { return null; }
示例9: getCalendarWeek
/// <summary>
/// This method computes the calendar week of a date. It can either be executed on a M.Date object,
/// to get the calendar week of that date, or you can pass parameters to get the calendar week for the specified date.
/// </summary>
/// <param name="year"> The year part of the date, e.g. 2011. Must be four digits.</param>
/// <param name="month">The month part of the date: 0-11. Must be one/two digit.</param>
/// <param name="day">The day part of the date: 1-31. Must be one/two digits.</param>
/// <returns></returns>
public JsNumber getCalendarWeek(JsNumber year, JsNumber month, JsNumber day) { return null; }
示例10: secondsFromDate
/// <summary>
/// This method returns a date in the future or past, based on seconds and the current date.
/// Basically it adds or subtracts x times the milliseconds of a second,
/// but also checks for clock changes and automatically includes these into the calculation of the future or past date.
/// </summary>
/// <param name="seconds">The number of seconds to be added to or subtracted from the current date.</param>
/// <returns></returns>
public Date secondsFromDate(JsNumber seconds) { return null; }
示例11: getHeaderAtIndex
/// <summary>
/// Get a leaf level header by index regardless of what the nesting
/// structure is.
/// </summary>
/// <param name="The"><p>column index for which to retrieve the column.</p>
/// </param>
public void getHeaderAtIndex(JsNumber The){}
示例12: getPrintData
/// <summary>
/// Gets the data for printing a template row
/// </summary>
/// <param name="index"><p>The index in the template</p>
/// </param>
/// <returns>
/// <span><see cref="Array">Array</see></span><div><p>The template values</p>
/// </div>
/// </returns>
private JsArray getPrintData(JsNumber index){return null;}
示例13: setPageSize
/// <summary>
/// Sets the number of menu items per submenu "page size".
/// </summary>
/// <param name="pageSize"><p>The page size</p>
/// </param>
public void setPageSize(JsNumber pageSize){}
示例14: setMaxText
/// <summary>
/// Sets the maximum text size for each menu item.
/// </summary>
/// <param name="t"><p>The max text per each menu item.</p>
/// </param>
public void setMaxText(JsNumber t){}
示例15: CylinderGeometry
public CylinderGeometry(JsNumber radiusTop, JsNumber radiusBottom) { }