本文整理汇总了C#中System.Windows.Forms.Form.PopupInsteadOfClosing方法的典型用法代码示例。如果您正苦于以下问题:C# Form.PopupInsteadOfClosing方法的具体用法?C# Form.PopupInsteadOfClosing怎么用?C# Form.PopupInsteadOfClosing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.PopupInsteadOfClosing方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeContent
//.........这里部分代码省略.........
// 3by3 grid
morespace.style.position = IStyle.PositionEnum.absolute;
morespace.style.top = -westContainer.clientHeight + "px";
morespace.style.left = 0 + "px";
morespace.style.width = westContainer.clientWidth + "px";
morespace.style.height = westContainer.clientHeight + "px";
// 3D DOCK
var ff = new Form { Text = "Gallery #" + __index };
ff.StartPosition = FormStartPosition.Manual;
ff.Show();
ff.Left = 8;
ff.Top = westContainer.clientHeight + -27;
ff.Width = westContainer.clientWidth - 16;
ff.Height = westContainer.clientHeight + 27 - 8;
ff.GetHTMLTarget().AttachTo(morespace);
ff.GetHTMLTarget().className = "nolock";
var ffw = new WebBrowser { Dock = DockStyle.Fill };
ffw.AttachTo(ff);
ffw.Navigate(
Native.Document.location.href + src + __index
);
__index++;
ff.PopupInsteadOfClosing(
SpecialNoMovement: true
);
return;
}
new IHTMLIFrame { allowFullScreen = true, src = src, frameBorder = "0" }.AttachTo(westContainer).With(
iframe =>
{
iframe.style.position = IStyle.PositionEnum.absolute;
iframe.style.left = "0px";
iframe.style.top = "0px";
iframe.style.width = "10%";
iframe.style.height = "10%";
iframe.style.transform = "scale(10.0)";
iframe.style.transformOrigin = "0% 0%";
}
);
// disable mouse
new IHTMLDiv { }.AttachTo(westContainer).With(
overlay =>
{
overlay.style.position = IStyle.PositionEnum.absolute;
overlay.style.left = "0px";
overlay.style.top = "0px";
overlay.style.width = "100%";
overlay.style.height = "100%";
overlay.style.backgroundColor = "red";
overlay.style.Opacity = 0;
示例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: Application
//.........这里部分代码省略.........
// X:\jsc.svn\examples\javascript\android\com.abstractatech.appmanager\com.abstractatech.appmanager\Application.cs
// can we pop ourselves out of here too?
// can chrome>extensions do AppWindows?
// on some pages they style our div. shall we use a non div to get nonstyled element?
// or do we need shadow DOM? is it even available yet for us?
var f = new Form { Text = uri, ShowIcon = false };
forms.Add(f);
var w = new WebBrowser();
w.Dock = DockStyle.Fill;
f.Controls.Add(w);
w.Navigate(uri);
f.Show();
f.FormClosed +=
delegate
{
Console.WriteLine("FormClosed " + new { uri });
forms.Remove(f);
};
// if we close it we want it to be gone for good.
// the extension cannot detatch our frame. it may need to ask the app to reopen this virtual tab...
f.PopupInsteadOfClosing(HandleFormClosing: false,
SpecialCloseOnLeft:
delegate
{
// shall we ask app:: to reopen uri in AppWindow?
Notify(xml.ToString());
f.Close();
}
);
}
};
#endregion
#region Connect
object self_chrome_runtime = self_chrome.runtime;
Console.WriteLine(new { self_chrome_runtime });
// 0:39ms { self_chrome_runtime = [object Object] }
if (self_chrome_runtime != null)
{
chrome.runtime.Connect +=
e =>
{
// port
// extension connects to injected tab?
Console.WriteLine("chrome.runtime.Connect " + new { Native.document.domain });
//Console.WriteLine("chrome.runtime.Connect " + new { Native.document.domain, e.sender.id });
示例4: 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)
{
sprite.wmode();
sprite.AttachSpriteToDocument().With(
embed =>
{
embed.style.SetLocation(0, 0);
embed.style.SetSize(Native.Window.Width, Native.Window.Height);
Native.Window.onresize +=
delegate
{
embed.style.SetSize(Native.Window.Width, Native.Window.Height);
};
}
);
#region con
var con = new ConsoleForm();
con.InitializeConsoleFormWriter();
con.Show();
con.Height = 150;
con.Left = Native.Window.Width - con.Width;
con.Top = 0;
Native.Window.onresize +=
delegate
{
con.Left = Native.Window.Width - con.Width;
con.Top = 0;
};
con.Opacity = 0.6;
// !! not compatible yet
con.HandleFormClosing = false;
con.PopupInsteadOfClosing();
#endregion
sprite.fps +=
(fps, nid) =>
{
new { fps, nid }.ToString().ToDocumentTitle();
};
#region context_new_remotegame
sprite.context_new_remotegame +=
remotegame =>
{
var remotegame_con = new ConsoleForm();
remotegame_con.Show();
remotegame_con.Left = 0;
remotegame_con.Top = Native.Window.Height - remotegame_con.Height;
remotegame_con.Opacity = 0.5;
remotegame.AtTitleChange +=
e => remotegame_con.Text = e;
remotegame.AtWriteLine +=
e =>
{
remotegame_con.textBox1.AppendText(e + Environment.NewLine);
remotegame_con.textBox1.ScrollToCaret();
};
remotegame_con.HandleFormClosing = false;
remotegame_con.PopupInsteadOfClosing();
};
#endregion
var sprites_events = new BindingListWithEvents<ApplicationSprite>();
var sprites = sprites_events.Source;
sprites_events.Added +=
(fsprite, i) =>
{
Console.WriteLine(i + "# Console ready!");
fsprite.InitializeConsoleFormWriter(
//.........这里部分代码省略.........
示例5: GooApplication
public GooApplication(IGoo goopage, HistoryScope<ApplicationState> gooscope)
{
// init state! this will be sent to server at every new web call.
this.state = gooscope.state;
FlashTitle();
Native.document.title = state.title;
Native.document.body.style.borderTop = "1em red solid";
Action ShowDataTable =
delegate
{
goopage.output.Clear();
var f = new Form
{
Text = new { this.state.data.TableName }.ToString(),
ControlBox = false,
ShowIcon = false,
//WindowState = FormWindowState.Maximized
};
new DataGridView
{
// script: error JSC1000: No implementation found for this native method, please implement [System.Windows.Forms.DataGridView.set_BorderStyle(System.Windows.Forms.BorderStyle)]
//BorderStyle = BorderStyle.Fixed3D
//AutoSize = true,
AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells,
DataSource = this.state.data,
Dock = DockStyle.Fill
}.AttachTo(f);
// do we need this?
f.GetHTMLTarget().AttachTo(goopage.output);
f.Show();
f.WindowState = FormWindowState.Maximized;
f.PopupInsteadOfClosing(
HandleFormClosing: false
// ,
// does not play well with maximized yet
//SpecialNoMovement: true
);
};
if (this.state.data == null)
{
// can we remove this from history then?
new IHTMLButton { innerText = "a page reload makes us forget DataTable. go back and get new data!" }.AttachTo(goopage.output).WhenClicked(
delegate
{
Native.window.history.back();
}
);
new IHTMLBreak().AttachTo(goopage.output);
new IHTMLButton { innerText = "or get new data, if the server is available" }.AttachTo(goopage.output).WhenClicked(
async delegate
{
Native.document.body.style.borderTop = "1em black solid";
this.reason = "page reload makes us forget DataTable";
//this.state = (await this.DoEnterData()).state;
var x = await this.DoEnterData();
this.state = x.state;
Native.document.body.style.borderTop = "1em red solid";
ShowDataTable();
}
);
}
else
{
ShowDataTable();
}
#region undo
gooscope.With(
async delegate
{
await gooscope;
// time to undo
Native.document.body.style.borderTop = "0.3em yellow solid";
}
//.........这里部分代码省略.........
示例6: Application
//.........这里部分代码省略.........
var DataTable_xml = await x.getAsString();
var DataTable = StringConversionsForDataTable.ConvertFromString(DataTable_xml);
var ff = new Form { Text = new { typeof(DataTable).Name }.ToString() };
var g = new DataGridView { DataSource = DataTable, Dock = DockStyle.Fill };
ff.Controls.Add(g);
ff.Show();
}
);
}
#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
{
示例7: Application
//.........这里部分代码省略.........
// ff.MoveTo(Native.Window.Width + 8, 8).SizeTo(Native.Window.Width - 16, Native.Window.Height - 16);
// // already scrolled...
// if (w.Url.ToString() != "about:blank")
// // docked?
// if (ff.GetHTMLTarget().parentNode != null)
// Native.Window.scrollTo(ff.Left - 8, ff.Top - 8);
// return;
//}
f.MoveTo(16, 16).SizeTo(hh.LeftContainer.clientWidth - 32, Native.window.Height / 3 - 16 - 4);
f1.MoveTo(16, Native.window.Height / 3 + 4).SizeTo(hh.LeftContainer.clientWidth - 32, Native.window.Height / 3 - 8);
f2.MoveTo(16, Native.window.Height / 3 * 2 + 4).SizeTo(hh.LeftContainer.clientWidth - 32, Native.window.Height / 3 - 16);
ff.MoveTo(
Native.window.Width - hh.RightContainer.clientWidth + 16
, 16).SizeTo(hh.RightContainer.clientWidth - 32, Native.window.Height - 32);
//Console.WriteLine("LeftContainer " + new { hh.LeftContainer.clientWidth });
//Console.WriteLine("RightContainer " + new { hh.RightContainer.clientWidth });
};
hh.ValueChanged +=
delegate
{
AtResize();
};
Native.window.onresize +=
delegate
{
AtResize();
};
Native.window.requestAnimationFrame +=
delegate
{
AtResize();
};
#endregion
ff.PopupInsteadOfClosing(SpecialNoMovement: true, NotifyDocked: AtResize);
f.PopupInsteadOfClosing(SpecialNoMovement: true, NotifyDocked: AtResize);
f1.PopupInsteadOfClosing(SpecialNoMovement: true, NotifyDocked: AtResize);
f2.PopupInsteadOfClosing(SpecialNoMovement: true, NotifyDocked: AtResize);
};
#endregion
var tt = default(ScriptCoreLib.JavaScript.Runtime.Timer);
Action done_timeout = delegate
{
if (done == null)
return;
tt.Stop();
done();
done = null;
};
service.get_LocalStorage(
//add_localStorage: (key, value) => Native.Window.localStorage[key] = value,
add_localStorage:
(key, value) =>
{
// what if we are resuming from offline edit.
// merge?
// keep the one we got from localStorage, because it has longer entry?
if (storage[key].Length > value.Length)
return;
storage[key] = value;
},
done: done_timeout
);
// either server responds in 2000 or we consider us offline...
tt = new ScriptCoreLib.JavaScript.Runtime.Timer(
delegate
{
done_timeout();
}
);
tt.StartTimeout(3000);
}
示例8: 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)
{
//content.AttachControlTo(page.Content);
//content.AutoSizeControlTo(page.ContentSize);
FormStyler.AtFormCreated = FormStylerLikeFloat.LikeFloat;
// I want animated background!
new WebGLClouds.Application();
//Native.Document.body.lastChild.MoveNodeToFirst();
var f = new Form();
content.BackColor = Color.Transparent;
content.Dock = DockStyle.Fill;
content.AttachTo(f);
f.Show();
@"Hello world".ToDocumentTitle();
// Send data from JavaScript to the server tier
service.WebMethod2(
@"A string from JavaScript.",
value => value.ToDocumentTitle()
);
Action ResizeMargin = delegate
{
if (f.GetHTMLTarget().parentNode == null)
Native.Document.body.style.marginLeft = 16 + "px";
else
Native.Document.body.style.marginLeft = (f.Width + 32) + "px";
};
Action AtResize = delegate
{
ResizeMargin();
f.MoveTo(16, 16);
f.SizeTo(
f.Width,
f.Height.Min(Native.window.Height - 32)
);
};
// why this not working?
//f.SizeChanged +=
content.ClientSizeChanged +=
delegate
{
ResizeMargin();
};
//new ScriptCoreLib.JavaScript.Runtime.Timer(
// delegate
// {
// }
//).StartInterval();
Native.window.onresize +=
delegate
{
AtResize();
};
AtResize();
f.PopupInsteadOfClosing(SpecialNoMovement: true);
}