本文整理汇总了C#中ScriptCoreLib.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptCoreLib.GetType方法的具体用法?C# ScriptCoreLib.GetType怎么用?C# ScriptCoreLib.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib
的用法示例。
在下文中一共展示了ScriptCoreLib.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
{
// X:\jsc.svn\examples\javascript\test\TestMemberInitExpression\TestMemberInitExpression\Application.cs
// {{ Name = foo, FieldType = [native] String }}
var x = new { foo = new xSpecial() };
var f = x.GetType().GetFields()[0];
new IHTMLPre { new { f.Name, f.FieldType } }.AttachToDocument();
var xf = new sFieldInfo { InternalField = f };
new IHTMLPre { new { xf.Name, xf.FieldType } }.AttachToDocument();
}
示例2: 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)
{
{
byte[] bytes =
{
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
};
new IHTMLPre { new { bytes } }.AttachToDocument();
new IHTMLPre { new { bytes.Length } }.AttachToDocument();
new IHTMLPre { bytes.GetType() }.AttachToDocument();
}
{
var bytes = new byte[16];
new IHTMLPre { new { bytes } }.AttachToDocument();
new IHTMLPre { new { bytes.Length } }.AttachToDocument();
new IHTMLPre { bytes.GetType() }.AttachToDocument();
}
{
float[] floats =
{
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
};
new IHTMLPre { new { floats } }.AttachToDocument();
new IHTMLPre { new { floats.Length } }.AttachToDocument();
new IHTMLPre { floats.GetType() }.AttachToDocument();
}
{
var floats = new float[16];
new IHTMLPre { new { floats } }.AttachToDocument();
new IHTMLPre { new { floats.Length } }.AttachToDocument();
new IHTMLPre { floats.GetType() }.AttachToDocument();
}
{
// using a local non const variable
// makes C# not use the InitializeArray helper?
//var cubesize = 1.0f * 0.05f;
const float cubesize = 1.0f * 0.05f;
//h = 0.05;
//j = [
// (-h),
var vertices = new[]{
// Front face
-cubesize, -cubesize, cubesize,
cubesize, -cubesize, cubesize,
cubesize, cubesize, cubesize,
-cubesize, cubesize, cubesize,
// Back face
-cubesize, -cubesize, -cubesize,
-cubesize, cubesize, -cubesize,
cubesize, cubesize, -cubesize,
cubesize, -cubesize, -cubesize,
// Top face
-cubesize, cubesize, -cubesize,
-cubesize, cubesize, cubesize,
cubesize, cubesize, cubesize,
cubesize, cubesize, -cubesize,
// Bottom face
-cubesize, -cubesize, -cubesize,
cubesize, -cubesize, -cubesize,
cubesize, -cubesize, cubesize,
-cubesize, -cubesize, cubesize,
// Right face
cubesize, -cubesize, -cubesize,
cubesize, cubesize, -cubesize,
cubesize, cubesize, cubesize,
cubesize, -cubesize, cubesize,
// Left face
-cubesize, -cubesize, -cubesize,
-cubesize, -cubesize, cubesize,
-cubesize, cubesize, cubesize,
-cubesize, cubesize, -cubesize
};
// { { Length = 72 } }
//.........这里部分代码省略.........