本文整理汇总了C#中ScriptCoreLib.Take方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptCoreLib.Take方法的具体用法?C# ScriptCoreLib.Take怎么用?C# ScriptCoreLib.Take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib
的用法示例。
在下文中一共展示了ScriptCoreLib.Take方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
/// <summary>
/// This is a javascript application.
/// </summary>
/// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
public Application(IApp page)
{
Native.body.Clear();
new IHTMLAnchor { href = "/jsc", innerText = "enter diagnostic mode" }.AttachToDocument();
new { }.With(
async delegate
{
// Severity Code Description Project File Line
//Error CS7069 Reference to type 'TaskAwaiter<>' claims it is defined in 'mscorlib', but it could not be found GoogleMapsTracker Z:\jsc.svn\examples\javascript\data\GoogleMapsTracker\Application.cs 40
// the new using
// 4.6
// stored at Z:\jsc.svn\examples\javascript\data\packages
// is that where jsc and nuget both agree to store it? no. jsc needs to mimick nuget here.
// did we build it?
await google.maps.api;
var div = new IHTMLDiv
{
//}.AttachTo(Native.document.documentElement);
// future jsc will have the ability to make offline edit and continue changes
}.AttachTo(Native.body);
div.style.position = IStyle.PositionEnum.absolute;
div.style.borderBottom = "1px dashed red";
div.style.height = "400px";
div.style.top = "0px";
div.style.left = "0px";
div.style.right = "0px";
Native.body.style.marginTop = "420px";
// Free until exceeding 25,000 map loads per day for 90 consecutive days
var map = new google.maps.Map(div,
new
{
// https://developers.google.com/maps/documentation/javascript/examples/control-disableUI
disableDefaultUI = true,
center = new { lat = 59.4329527, lng = 24.7023564 },
//https://www.google.ee/maps/@59.4329527,24.7023564,14z?hl=en
zoom = 6.0
}
);
// https://developers.google.com/maps/documentation/javascript/examples/event-simple
var flightPlanCoordinates = new[] {
// Object literals are accepted in place of LatLng objects, as a convenience, in many places
new { lat = 59.4329527 - 0.25, lng = 24.7023564 - 0.5},
new { lat = 59.4329527 - 0.25, lng = 24.7023564 + 0.5 },
// up, right
new { lat = 59.4329527 + 0.25, lng = 24.7023564 + 0.5},
new { lat = 59.4329527 + 0.25, lng = 24.7023564 - 0.5},
// close the line
//new { lat = 59.4329527 - 0.25, lng = 24.7023564 - 0.5},
};
// https://developers.google.com/maps/documentation/javascript/examples/polyline-simple
var flightPath = new google.maps.Polyline(new
{
path = flightPlanCoordinates.Concat(flightPlanCoordinates.Take(1)).ToArray(),
geodesic = true,
strokeColor = "#FF0000",
strokeOpacity = 1.0,
strokeWeight = 2
});
// like a stlus huh.
flightPath.setMap(map);
// alternative is we play a pre recored session.
//.........这里部分代码省略.........