本文整理汇总了C#中ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv.Orphanize方法的典型用法代码示例。如果您正苦于以下问题:C# IHTMLDiv.Orphanize方法的具体用法?C# IHTMLDiv.Orphanize怎么用?C# IHTMLDiv.Orphanize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv
的用法示例。
在下文中一共展示了IHTMLDiv.Orphanize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
//.........这里部分代码省略.........
var lon = 0.0;
var phi = 0.0;
var theta = 0.0;
var lat = 15.0;
var isUserInteracting = false;
var scale = 0.0;
#region render
Native.window.onframe += delegate
{
((material_uniforms)material.uniforms).time.value = .00025 * (IDate.Now - start);
scale += .005;
scale %= 2;
lat = Math.Max(-85, Math.Min(85, lat));
phi = (90 - lat) * Math.PI / 180;
theta = lon * Math.PI / 180;
camera.position.x = (float)(100 * Math.Sin(phi) * Math.Cos(theta));
camera.position.y = (float)(100 * Math.Cos(phi));
camera.position.z = (float)(100 * Math.Sin(phi) * Math.Sin(theta));
//mesh.rotation.x += .012;
//mesh.rotation.y += .01;
camera.lookAt(scene.position);
// //renderer.render( bkgScene, bkgCamera );
renderer.render(scene, camera);
// stats.update();
};
#endregion
#region IsDisposed
Dispose = delegate
{
if (IsDisposed)
return;
IsDisposed = true;
container.Orphanize();
};
#endregion
#region AtResize
Action AtResize = delegate
{
container.style.SetLocation(0, 0, Native.window.Width, Native.window.Height);
renderer.setSize(Native.window.Width, Native.window.Height);
camera.projectionMatrix.makePerspective(fov, Native.window.aspect, 1, 1100);
//camera.aspect = Native.Window.Width / Native.Window.Height;
//camera.updateProjectionMatrix();
};
Native.window.onresize +=
delegate
{
AtResize();
};
AtResize();
#endregion
var ze = new ZeProperties();
ze.Show();
ze.treeView1.Nodes.Clear();
ze.Add(() => renderer);
//ze.Add(() => controls);
ze.Add(() => scene);
ze.Left = 0;
}
示例2: GetAwaiter
//.........这里部分代码省略.........
#endregion
//Console.WriteLine(
// new { x.Name, x.loaded, x.total }
//);
#region SetResult
x.source.With(
async source =>
{
// // should we analyze? IFunction
//Console.WriteLine("wall save source to localStorage " + new { __e.Name, source.Length });
// sessionStorage out of memory?
//Native.window.sessionStorage[__e.Name] = source;
//Native.window.eval(
// //x.responseText
// source
//);
bar.style.backgroundColor = "yellow";
await Task.Delay(300);
bar.style.backgroundColor = "red";
await Task.Delay(300);
bar.style.backgroundColor = "yellow";
await Task.Delay(300);
bar.style.backgroundColor = "red";
await Task.Delay(300);
bar.Orphanize();
// { index = 0, name = ScriptCoreLib.dll.js, size = 1330538 } view-source:27530
// view-source:27530
//{ index = 1, name = WorkerInsideSecondaryApplicationWithBackButton.Application+x.exe.js, size = 507500 } view-source:2753
y.SetResult(
new InternalScriptApplicationSource
{
source = source,
references = x.references
}
);
}
);
#endregion
},
function:
tuple =>
{
var progress = tuple.Item1;
var scope = tuple.Item2;
// http://stackoverflow.com/questions/13870853/how-to-upload-files-in-web-workers-when-formdata-is-not-defined
// FormData is not defined
//var f = new FormData();
示例3: DrawRectangleToCanvas
public void DrawRectangleToCanvas(CanvasRectangle c)
{
var x = new IHTMLDiv();
x.style.overflow = IStyle.OverflowEnum.hidden;
c._Dispose =
delegate(CanvasRectangle u)
{
if (x == null)
return;
x.Orphanize();
x = null;
};
c._Update =
delegate(CanvasRectangle u)
{
if (x == null)
return;
var r = u.Location;
x.style.SetLocation(r.Left, r.Top, r.Width, r.Height);
x.style.backgroundColor = u.BackgroundColor;
};
c.Update();
this.Layers.Canvas.appendChild(x);
}
示例4: SpaceInvaders
//.........这里部分代码省略.........
else
UpdatePlayer(Player_X_step);
}
}
).StartInterval(100);
Native.Document.onkeydown += delegate(IEvent ev)
{
Console.WriteLine(new { ev.KeyCode }.ToString());
if (mmenu.Visible)
{
if (ev.IsReturn)
{
ResetGame();
}
return;
}
else
{
if (ev.IsEscape)
{
GameTimer.Stop();
Player.Hide();
mmenu.Visible = true;
foreach (AmmoInfo v in KnownAmmo)
{
v.Visible = false;
}
foreach (Concrete v in KnownConcrete.ToArray())
{
v.Visible = false;
}
foreach (EnemyUnit v in KnownEnemies.ToArray())
{
v.Visible = false;
}
UFO.Visible = false;
gameovermenu.Visible = false;
// the animated gifs would stop after escape key
ev.preventDefault();
GamePaused = false;
}
}
int key_p = 80;
if (ev.KeyCode == key_p)
{
GamePaused = !GamePaused;
}
// player shouldn't really move while game is paused
// its cheating:)
if (GamePaused)
return;
int key_right = 39;
int key_left = 37;
if (ev.KeyCode == key_left)
{
UpdatePlayer(-Player_X_step);
}
else if (ev.KeyCode == key_right)
{
UpdatePlayer(Player_X_step);
}
else if (ev.IsSpaceOrEnterKey())
{
// the animated gifs would stop after escape key
ev.preventDefault();
EgoShoot();
}
else
{
Console.WriteLine(new { UnknownKeyCode = ev.KeyCode }.ToString());
}
};
msg_loading.Orphanize();
}
, 50);
}
示例5: InitializeContent
//.........这里部分代码省略.........
star.position.y = Math_random() * 200 - 100;
star.position.z = Math_random() * 200 - 100;
buildStar(star, state);
scene.add(star);
stars[state].Add(star);
}
}
#endregion
var pointLight = new THREE.PointLight(0xFFFFFF);
pointLight.position.z = 1000;
scene.add(pointLight);
#endregion
#region IsDisposed
Dispose = delegate
{
if (IsDisposed)
return;
IsDisposed = true;
page_song.pause();
page_song2.pause();
container.Orphanize();
};
#endregion
Native.window.onframe +=
delegate
{
f delta = clock.ElapsedMilliseconds * 0.001f;
clock.Restart();
if (running) deltaSum += delta;
if (deltaSum > .07)
{
deltaSum = deltaSum % .07f;
frame = (frame + 1) % 12;
for (var c = 0; c < numStars; c++)
{
var tempX = stars[5][c].position.x;
var tempY = stars[5][c].position.y;
var tempZ = stars[5][c].position.z;
for (var state = 5; state > 0; state--)
{
var star = stars[state][c];
var star2 = stars[state - 1][c];
star.position.x = star2.position.x - 8;
star.position.y = star2.position.y;
star.position.z = star2.position.z;
if (star.position.x < -100)
示例6: InitializeContent
//.........这里部分代码省略.........
__loaded();
}
else
{
}
};
#endregion
Native.window.onframe +=
delegate
{
if (IsDisposed)
return;
render();
};
#endregion
#region IsDisposed
Dispose = delegate
{
if (IsDisposed)
return;
IsDisposed = true;
//page.song.pause();
soundtrack.pause();
container.Orphanize();
};
#endregion
#region AtResize
Action AtResize = delegate
{
container.style.SetLocation(0, 0, Native.window.Width, Native.window.Height);
renderer.setSize(Native.window.Width, Native.window.Height);
camera.aspect = Native.window.Width / Native.window.Height;
camera.updateProjectionMatrix();
};
Native.window.onresize +=
delegate
{
AtResize();
};
AtResize();
#endregion
Native.document.body.onmousedown +=
e =>
{
if (e.MouseButton == IEvent.MouseButtonEnum.Middle)
{
Native.document.body.requestFullscreen();
}
};
#region requestFullscreen
Native.document.body.ondblclick +=
delegate
{
if (IsDisposed)
return;
// http://tutorialzine.com/2012/02/enhance-your-website-fullscreen-api/
Native.document.body.requestFullscreen();
//AtResize();
};
#endregion
}
示例7: 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)
{
// test it
//base.Insert(
// new Abstractatech.JavaScript.Avatar.Design.WebCamAvatarsSheet1Row()
// );
page.Reset.WhenClicked(
delegate
{
this.Reset();
}
);
page.NewImage.WhenClicked(
//async
button =>
{
var overlay = new IHTMLDiv { }.AttachTo(Native.document.documentElement);
overlay.style.position = [email protected];
overlay.style.left = "0";
overlay.style.top = "0";
overlay.style.right = "0";
overlay.style.bottom = "0";
overlay.style.backgroundColor = "black";
var div = new IHTMLDiv { }.AttachTo(overlay);
var css = Native.document.body.css.children;
css.style.display = IStyle.DisplayEnum.none;
Abstractatech.JavaScript.Avatar.ApplicationImplementation.MakeCamGrabber(
div,
sizeToWindow: true,
yield:
y =>
{
overlay.Orphanize();
css.style.display = IStyle.DisplayEnum.empty;
// napta ocr?
// http://projectnaptha.com/
new IHTMLImage { y.Avatar640x480 }.AttachToDocument();
new IHTMLImage { y.Avatar96gif }.AttachToDocument();
// method:Void <.ctor>b__3(Abstractatech.JavaScript.Avatar.Design.WebCamAvatarsSheet1Row), ex = System.InvalidOperationException: Unable to change after type has been created.
//base.Insert(y.Avatar96gif);
base.Insert(y);
}
);
}
);
}
示例8: Application
//.........这里部分代码省略.........
Native.window.requestAnimationFrame += delegate
{
img.style.left = "50px";
};
await 10000;
Native.window.requestAnimationFrame += delegate
{
img.style.left = "-150px";
};
}
}
else
{
page.ImgContainer.Clear();
}
}
else
{
IHTMLImage img = new IHTMLImage();
img.AttachTo(page.ImgContainer);
lastPicture = pic;
img.src = pic.Avatar96frame1;
img.style.left = "-150px";
await 500;
Native.window.requestAnimationFrame += delegate
{
img.style.left = "50px";
};
await 10000;
Native.window.requestAnimationFrame += delegate
{
img.style.left = "-150px";
};
}
await 4000;
}
};
Console.WriteLine("Start");
//getNewPicture();
// new IHTMLDiv { }.AttachToDocument().With(x => ApplicationImplementation.MakeCamGrabber(x, sizeToWindow: true));
// var service = new AvatarNotificationService();
page.ImgContainer.With(x => ApplicationImplementation.MakeimageNotification(page.ImgContainer, this));
var button = new IHTMLButton { innerHTML = "SubmitButton" }.AttachToDocument();
button.onclick += delegate
{
var overlay = new IHTMLDiv { }.AttachTo(Native.document.documentElement);
overlay.style.position = [email protected];
overlay.style.left = "0";
overlay.style.top = "0";
overlay.style.right = "0";
overlay.style.bottom = "0";
overlay.style.backgroundColor = "black";
var div = new IHTMLDiv { }.AttachTo(overlay);
var xcss = Native.document.body.css.children;
xcss.style.display = IStyle.DisplayEnum.none;
Abstractatech.JavaScript.Avatar.ApplicationImplementation.MakeCamGrabber(
div,
sizeToWindow: true,
yield:
y =>
{
overlay.Orphanize();
xcss.style.display = IStyle.DisplayEnum.empty;
Console.WriteLine("InsertNewPicture");
if (y.Avatar640x480.Length >= (1024 * 64))
{
//MessageBox.Show("Picture size too big for now");
return;
}
this.DiagnosticInsertNewPicture(y);
//var z = (__PictureBox)(object)f.pictureBox1;
// dow we like gif of jpg?
//z.InternalElement.src = y.Avatar96gif;
//z.InternalElement.src = y.Avatar96frame1;
}
);
};
}