本文整理汇总了C#中IHTMLElement.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IHTMLElement.Dispose方法的具体用法?C# IHTMLElement.Dispose怎么用?C# IHTMLElement.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHTMLElement
的用法示例。
在下文中一共展示了IHTMLElement.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(IHTMLElement Menu, Func<IHTMLImage, string, Type, Action<Type>, IHTMLElement> ConvertImageToControl)
{
var List = new IHTMLElement(IHTMLElement.HTMLElementEnum.ol).AttachTo(Menu);
var ApplicationsWithLoadingImagesQuery =
from t in Applications
let assembly = t.Assembly.GetName().Name
let preview = "assets/" + assembly + "/Preview.png"
let image = new IHTMLImage(preview)
orderby t.Name
select new { t, assembly, preview, image };
var ApplicationsWithLoadingImages = ApplicationsWithLoadingImagesQuery.ToArray();
var LoadingMessage = new IHTMLDiv().AttachTo(Menu);
var DoneLoading = 500.Until(
t =>
{
var count = ApplicationsWithLoadingImages.Count(i => !i.image.complete);
LoadingMessage.innerText = count + " images are still loading...";
return (count == 0 || t.Counter == 6);
}
);
Func<Point> GetCenter =
() => new Point(Native.Window.Width / 2, Native.Window.Height / 2);
Action<Type> TypeClicked = t => { };
DoneLoading +=
delegate
{
var query = from i in ApplicationsWithLoadingImages
let hasimage = i.image.complete && i.image.width > 0
select new { i.image, i.t, i.assembly, hasimage, i.preview }; ;
var WithImages =
from i in query
where i.hasimage
select i;
var WithoutImages =
from i in query
where !i.hasimage
select i;
#region WithImages
DoneLoading = WithImages.ForEachAtInterval(50,
v =>
{
LoadingMessage.innerText = v.t.Name;
var href = v.t.Name + ".htm";
var r = ConvertImageToControl(v.image, href, v.t, TypeClicked);
r.AttachTo(Menu);
}
);
#endregion
DoneLoading +=
delegate
{
LoadingMessage.Dispose();
var clr = new IHTMLBreak();
clr.style.clear = "both";
clr.AttachTo(Menu);
foreach (var v in WithoutImages)
{
new IHTMLDiv("image not found: " + v.preview).AttachTo(Menu);
}
"script".DisposeElementsByTagName();
"noscript".DisposeElementsByTagName();
};
};
TypeClicked +=
t =>
{
Menu.Dispose();
try
{
Activator.CreateInstance(t);
}
catch (Exception exc)
//.........这里部分代码省略.........