本文整理汇总了C#中System.Windows.Forms.Form.GetHTMLTargetContainer方法的典型用法代码示例。如果您正苦于以下问题:C# Form.GetHTMLTargetContainer方法的具体用法?C# Form.GetHTMLTargetContainer怎么用?C# Form.GetHTMLTargetContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.GetHTMLTargetContainer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
//.........这里部分代码省略.........
return;
x.game_postMessage(xml);
}
);
};
#endregion
};
sprites.Add(sprite);
#region game_InitializeFrameDiagnostics
sprite.game_InitializeFrameDiagnostics(
__FrameDiagnostics =>
{
Console.WriteLine("new FrameDiagnostics");
var x = new FrameDiagnostics();
x.Show();
Console.WriteLine("new FrameDiagnostics Show, can you see it?");
Native.Window.onresize +=
delegate
{
x.Left = Native.Window.Width - x.Width;
x.Top = Native.Window.Height - x.Height;
};
x.Initialize(__FrameDiagnostics);
// Error 8 'Abstractatech.ConsoleFormPackage.Library.ConsoleForm' does not contain a definition for 'PopupInsteadOfClosing' and no extension method 'PopupInsteadOfClosing' accepting a first argument of type 'Abstractatech.ConsoleFormPackage.Library.ConsoleForm' could be found (are you missing a using directive or an assembly reference?) X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeekerWithStarlingB2\Application.cs 85 17 FlashHeatZeekerWithStarlingB2
// wtf?
x.PopupInsteadOfClosing();
x.Opacity = 0.7;
// can we pop it up?
x.JoinMultiplayer.Click +=
delegate
{
var f = new Form();
// make it small
f.Height = 200;
var fsprite = new ApplicationSprite();
fsprite.src_fixup();
fsprite.wmode();
var fspriteelement = fsprite.AttachSpriteTo(
f.GetHTMLTargetContainer()
);
#region ClientSizeChanged / PopupInsteadOfClosing has a bug
f.ClientSizeChanged +=
delegate
{
var cs = f.ClientSize;
fspriteelement.style.SetSize(cs.Width,
cs.Height
);
};
#endregion
f.Show();
f.PopupInsteadOfClosing();
// do events break if popup mode is changed?
fsprite.fps +=
(fps, nid) =>
{
new { fps, nid }.ToString().ToTitle(f);
};
sprites.Add(fsprite);
// what if we have more of these?
};
}
);
#endregion
}
示例2: Application
/// <summary>
/// This is a javascript application.
/// </summary>
/// <param name="document">HTML document rendered by the web server which can now be enhanced.</param>
public Application(IApp document)
{
//
//document.body.AsXElement().Elements("script").Remove();
//document.body.AsXElement().Elements("script").WithEach(k => k.Remove());
var f = new Form { Text = "Visual Editor" };
f.PopupInsteadOfClosing(HandleFormClosing: true);
f.Width = 600;
var diagnostics = new IHTMLDiv().AttachTo(document.body.parentNode);
//var diagnostics = new IHTMLBody().AttachTo(Native.document.body.parentNode);
diagnostics.style.backgroundColor = "rgba(0, 0, 0, 0)";
diagnostics.style.position = IStyle.PositionEnum.absolute;
diagnostics.style.overflow = IStyle.OverflowEnum.hidden;
diagnostics.style.left = "0px";
diagnostics.style.top = "-100%";
diagnostics.style.width = "100%";
diagnostics.style.height = "100%";
f.Show();
f.GetHTMLTarget().AttachTo(diagnostics);
//Uncaught TypeError: Cannot call method 'write' of null
var editor = new TextEditor(f.GetHTMLTargetContainer());
var snd = new HTML.Audio.FromAssets.SAMPLES036();
snd.load();
var snd2 = new HTML.Audio.FromAssets.Hammertime();
snd2.load();
Action reverse = delegate { };
Action Hide =
delegate
{
//
(document.body.style as dynamic).webkitFilter = "";
diagnostics.style.top = "-100%";
diagnostics.style.backgroundColor = "rgba(0, 0, 0, 0)";
snd2.play();
snd2 = new HTML.Audio.FromAssets.Hammertime();
snd2.load();
reverse();
};
Action Show =
delegate
{
if (diagnostics.style.top != "-100%")
return;
// { -webkit-filter: grayscale(0.5) blur(10px);
(document.body.style as dynamic).webkitFilter = "grayscale(0.5) blur(2px)";
diagnostics.style.top = "0%";
diagnostics.style.backgroundColor = "rgba(0, 0, 0, 0.5)";
snd.play();
snd = new HTML.Audio.FromAssets.SAMPLES036();
snd.load();
// using undo context? save load and store ops to revert them
editor.InnerHTML = document.body.innerHTML;
reverse = delegate
{
document.body.innerHTML = editor.InnerHTML;
reverse = delegate { };
};
};
Hide();
// http://www.w3schools.com/css3/css3_transitions.asp
diagnostics.style.transition = "all 0.2s ease-in-out";
//.........这里部分代码省略.........
示例3: ApplicationContent
//.........这里部分代码省略.........
"Web Files".ToDocumentTitle();
return;
}
//ff.Text = w.DocumentTitle;
ff.Text = Native.window.unescape(
w.Url.ToString().SkipUntilLastIfAny("/").TakeUntilLastIfAny(".")
);
ff.Text.ToDocumentTitle();
};
ff.FormClosing +=
(sender, e) =>
{
Console.WriteLine(new { e.CloseReason });
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
w.Navigate("about:blank");
}
};
#endregion
var content = f.GetHTMLTargetContainer();
var hh = new HorizontalSplit
{
Minimum = 0.05,
Maximum = 0.95,
Value = 0.4,
};
hh.Container.AttachToDocument();
hh.Container.style.position = IStyle.PositionEnum.absolute;
hh.Container.style.left = "0px";
hh.Container.style.top = "0px";
hh.Container.style.right = "0px";
hh.Container.style.bottom = "0px";
hh.Split.Splitter.style.backgroundColor = "rgba(0,0,0,0.0)";
#region AtResize
Action AtResize = delegate
{
Native.Document.getElementById("feedlyMiniIcon").Orphanize();
Native.Document.body.style.minWidth = "";
if (ff.GetHTMLTarget().parentNode == null)
{
Native.window.scrollTo(0, 0);
f.MoveTo(8, 8).SizeTo(Native.window.Width - 16, Native.window.Height - 16);
示例4: Application
//.........这里部分代码省略.........
);
}
#endregion
#region files
evt.dataTransfer.files.AsEnumerable().WithEachIndex(
(f, index) =>
{
Console.WriteLine(
new
{
f.name,
f.size,
f.lastModifiedDate
}
);
var ff = new Form();
ff.PopupInsteadOfClosing(HandleFormClosing: false);
ff.Text = new { f.type, f.name, f.size }.ToString();
ff.Show();
ff.MoveTo(
evt.CursorX + 32 * index,
evt.CursorY + 24 * index
);
var fc = ff.GetHTMLTargetContainer();
fc.title = ff.Text;
#region image
var i = default(IHTMLImage);
if (f.type.StartsWith("image/"))
{
// um would we have a timing issue here?
f.ToDataURLAsync(
src =>
{
i = new IHTMLImage { src = src }.AttachTo(fc);
i.style.width = "100%";
i.InvokeOnComplete(
delegate
{
ff.ClientSize = new System.Drawing.Size(
// keep it reasonable!
i.width.Min(600),
i.height.Min(400)
);
}
);
}
);
}
#endregion
示例5: InitializeContent
//.........这里部分代码省略.........
// https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20151115/audio
//f.PopupInsteadOfClosing();
f.MoveTo(pos.X, pos.Y);
//f.SizeTo(
//var dialog = new IHTMLDiv();
//dialog.style.SetLocation(pos.X, pos.Y);
//dialog.style.backgroundColor = Color.Gray;
//dialog.style.padding = "1px";
//var caption = new IHTMLDiv().AttachTo(dialog);
//caption.style.backgroundColor = Color.Blue;
//caption.style.width = width;
//caption.style.height = "0.5em";
//caption.style.cursor = IStyle.CursorEnum.move;
//var drag = new DragHelper(caption);
//drag.Position = pos;
//drag.Enabled = true;
//drag.DragMove +=
// delegate
// {
// dialog.style.SetLocation(drag.Position.X, drag.Position.Y);
// };
var _content = new IHTMLDiv().AttachTo(f.GetHTMLTargetContainer());
_content.style.textAlign = IStyle.TextAlignEnum.center;
_content.style.backgroundColor = Color.White;
_content.style.padding = "1px";
//dialog.AttachToDocument();
return new
{ //Dialog = dialog,
Content = _content,
Width = width
};
}
);
#endregion
#region dialog
var toolbar = CreateDialogAt(new Point(2, 2), "8em");
var combo = new IHTMLSelect();
var build = new IHTMLButton();
build.style.SetSize(72, 72);
build.style.padding = "0px";
var avatar = new IHTMLImage().AttachTo(build);
var remove = new IHTMLButton("Remove");
combo.AttachTo(toolbar.Content);
new IHTMLBreak().AttachTo(toolbar.Content);
build.AttachTo(toolbar.Content);
示例6: Application
//.........这里部分代码省略.........
delegate
{
f2.Text = "Navigating";
};
w.Navigated +=
delegate
{
if (w.Url.ToString() == "about:blank")
{
f2.Text = "...";
return;
}
//ff.Text = w.DocumentTitle;
f2.Text = Native.window.unescape(
w.Url.ToString().SkipUntilLastIfAny("/").TakeUntilLastIfAny(".")
);
};
Native.window.requestAnimationFrame +=
delegate
{
var layout = new Abstractatech.JavaScript.FileStorage.HTML.Pages.App();
layout.Container.AttachTo(f1.GetHTMLTargetContainer());
Abstractatech.JavaScript.FileStorage.ApplicationContent.Target = w.GetHTMLTarget().name;
new Abstractatech.JavaScript.FileStorage.ApplicationContent(
layout,
service.service
);
};
var LeftScrollable = new IHTMLDiv { className = "SidebarForButtons" }.AttachTo(f.GetHTMLTargetContainer());
LeftScrollable.style.backgroundColor = "white";
var CreateNew = new IHTMLButton { innerText = "+ create new", className = "SidebarButton" }.AttachTo(
LeftScrollable
);
var ff = new Form
{
StartPosition = FormStartPosition.Manual,
SizeGripStyle = SizeGripStyle.Hide
};
f.Show();
ff.Show();
示例7: a
public a(IBeforeLogin ee)
{
//FormStyler.AtFormCreated = FormStyler.LikeVisualStudioMetro;
//FormStyler.AtFormCreated = FormStylerLikeFloat.LikeFloat;
var ff = new Form { FormBorderStyle = FormBorderStyle.None };
var ScrollArea = new App().ScrollArea.AttachTo(ff.GetHTMLTargetContainer());
//ScrollArea.style.backgroundColor = "#185D7B";
//ScrollArea.style.backgroundColor = "#185D7B";
ScrollArea.style.backgroundColor = "#105070";
var SidebarWidth = 172;
ff.MoveTo(SidebarWidth, 0);
Action AtResize = delegate
{
ff.SizeTo(Native.window.Width - SidebarWidth, Native.window.Height);
};
Native.window.onresize +=
delegate
{
AtResize();
};
AtResize();
var iii = global::CSSMinimizeFormToSidebar.ApplicationExtension.InitializeSidebarBehaviour(
ff,
// should be handle close instead!
HandleClosed: true,
HandleDragToLeft: false
);
iii.SidebarText.className = "AppPreviewText";
//iii.SidebarText.innerText = "My Appz";
//iii.SidebarText.innerText = "Synchronizing...";
//var finish = iii.SidebarText.ToASCIIStyledLoadAnimation("My Appz");
//Native.Document.body.style.backgroundColor = "#105070";
Native.document.body.style.backgroundColor = "#185D7B";
Native.window.onresize +=
delegate
{
// lets not centerize
//ff.Show();
};
//var page = new App();
//page.ScrollArea.AttachToDocument();
var count = 0;
var yield_BringToFront = false;
var icon_throttle = 0;
#region yield
yield_ACTION_MAIN yield = (
packageName,
name,
__IsCoreAndroidWebServiceActivity,
label
) =>
{
if (string.IsNullOrEmpty(label))
label = packageName;
var IsCoreAndroidWebServiceActivity = System.Convert.ToBoolean(__IsCoreAndroidWebServiceActivity);
count++;
var a = new AppPreview();
#region icon
if (packageName != "foo")
{
// see also: X:\jsc.svn\examples\javascript\ImageCachedIntoLocalStorageExperiment\ImageCachedIntoLocalStorageExperiment\Application.cs
// extension to the system
// data.icon[packageName].With
Action loadicon = delegate
{
new ScriptCoreLib.JavaScript.Runtime.Timer(
delegate
{
//.........这里部分代码省略.........