本文整理汇总了C#中IHTMLElement类的典型用法代码示例。如果您正苦于以下问题:C# IHTMLElement类的具体用法?C# IHTMLElement怎么用?C# IHTMLElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHTMLElement类属于命名空间,在下文中一共展示了IHTMLElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldVisitParent
static bool ShouldVisitParent(IHTMLElement e)
{
if (e.parentNode == null)
return false;
return e.parentNode != Native.Document;
}
示例2: AutoSizeSpriteTo
public static IHTMLElement AutoSizeSpriteTo(this Sprite e, IHTMLElement shadow)
{
var i = e.ToHTMLElement();
Action Update =
delegate
{
var w = shadow.scrollWidth;
var h = shadow.scrollHeight;
i.style.SetSize(w, h);
};
Native.window.onresize +=
delegate
{
Update();
};
Update();
return i;
}
示例3: ApplyZoomedSize
public ZoomedPoint ApplyZoomedSize(IHTMLElement e)
{
e.style.width = ZoomedXpx;
e.style.height = ZoomedYpx;
return this;
}
示例4: AsTextArea
public static TextArea AsTextArea(IHTMLElement e) {
IHTMLTextAreaElement e2 = e as IHTMLTextAreaElement;
if (e2 != null) {
return new TextArea(e);
}
return null;
}
示例5: Of
public static List<GetPositionData> Of(IHTMLElement e)
{
var a = new List<GetPositionData>();
var x = 0;
var y = 0;
while (ShouldVisitParent(e))
{
x += e.offsetLeft;
y += e.offsetTop;
a.Add(
new GetPositionData
{
Element = e,
X = x,
Y = y
}
);
e = (IHTMLElement)e.parentNode;
}
return a;
}
示例6: MineSweeperGame
public MineSweeperGame(MineSweeperSettings _Data = null, IHTMLElement _Owner = null)
{
this.Data = _Data;
if (this.Data == null)
this.Data = DefaultData;
var Settings = new
{
X = this.Data.X.ToInt32(8),
Y = this.Data.Y.ToInt32(8),
Mines = this.Data.Mines.ToDouble(0.2)
};
Panel = new MineSweeperPanel(
Settings.X,
Settings.Y,
Settings.Mines,
new Assets()
);
if (_Owner == null)
Panel.Control.AttachToDocument();
else
_Owner.replaceWith(Panel.Control);
}
示例7: GetApplicableFunctions
public List<FunctionPage> GetApplicableFunctions(IHTMLElement element, AppSettings.CodeLanguages language)
{
List<FunctionPage> applicable = new List<FunctionPage>();
foreach (FunctionPage page in Functions)
{
if (page.IsApplicable(element, language))
{
applicable.Add(page);
}
}
if (applicable.Count==0)
{
// load the default page
applicable.Add(GetPageFromTitle("Default"));
}
foreach (FunctionPage page in Functions)
{
if (page.ShowOnAll && page.Languages.Contains(language.ToString()))
{
applicable.Add(page);
}
}
return applicable;
}
示例8: FadeOut
static public void FadeOut(IHTMLElement target, int waittime, int fadetime)
{
target.style.Opacity = 1;
new Timer(
delegate
{
Timer a = null;
a = new Timer(
delegate
{
target.style.Opacity = 1 - (a.Counter / a.TimeToLive);
if (a.Counter == a.TimeToLive)
{
target.Hide();
}
}
);
a.StartInterval(fadetime / 25, 25);
}
).StartTimeout(waittime);
}
示例9: Fade
/// <summary>
/// fades an element and provides async callback
/// </summary>
/// <param name="target"></param>
/// <param name="waittime"></param>
/// <param name="fadetime"></param>
/// <param name="done"></param>
static public void Fade(IHTMLElement target, int waittime, int fadetime, System.Action done)
{
// if IE
target.style.height = target.clientHeight + "px";
new Timer(
delegate
{
Timer a = null;
a = new Timer(
delegate
{
target.style.Opacity = 1 - (a.Counter / a.TimeToLive);
if (a.Counter == a.TimeToLive)
{
if (done != null)
done();
}
}
);
a.StartInterval(fadetime / 25, 25);
}
).StartTimeout(waittime);
}
示例10: AsAnchorLink
public static AnchorLink AsAnchorLink(IHTMLElement e) {
if ( e is IHTMLAnchorElement2 ) {
return new AnchorLink( e );
} else {
return null;
}
}
示例11: AvalonExampleGalleryContainer
//AvalonExampleGallery.JavaScript.AvalonExampleGalleryDocument Reference;
public AvalonExampleGalleryContainer(IHTMLElement e)
{
var lookup = new Dictionary<string, AvalonExampleGallery.Shared.AvalonExampleGalleryCanvas.OptionPosition>();
e.childNodes.Where(k => k.nodeName.ToLower() == "div").Select(k => (IHTMLDiv)k).ForEach(
k =>
{
var p = new AvalonExampleGallery.Shared.AvalonExampleGalleryCanvas.OptionPosition
{
X = k.Bounds.Left,
Y = k.Bounds.Top
};
p.Clear = () => k.Dispose();
lookup[k.className] = p;
}
);
new AvalonExampleGallery.Shared.AvalonExampleGalleryCanvas(false,
Text =>
{
if (lookup.ContainsKey(Text))
return lookup[Text];
return null;
}
).AttachToContainer(e);
}
示例12: __Button
// code creates class, we create element.
public __Button()
{
InternalDisplayObject = new IHTMLElement(ElementName);
var s = InternalDisplayObject.createShadowRoot();
var button = new IHTMLButton();
button.AttachTo(s);
button.onclick +=
delegate
{
InternalRaiseClick();
};
this.InternalVirtualSetContent =
value =>
{
// what aboout? shadow dom ContentElement?
// X:\jsc.svn\examples\javascript\Avalon\Test\TestShadowTextBox\TestShadowTextBox\ApplicationCanvas.cs
button.innerText = "" + value;
};
}
示例13: CreateJSONData
private string CreateJSONData(IHTMLElement element)
{
StringBuilder sbJSON = new StringBuilder();
string strLanguage = System.Enum.GetName(typeof(AppSettings.CodeLanguages), wscript.settings.CodeLanguage);
sbJSON.Append("{");
sbJSON.Append("\"CodeLanguage\": \"" + strLanguage + "\",");
sbJSON.Append("\"tagName\": \"" + element.tagName+"\"");
IHTMLDOMNode node = element as IHTMLDOMNode;
foreach (IHTMLDOMAttribute attr in node.attributes)
{
if (attr.specified)
{
sbJSON.AppendFormat(",\"{0}\": \"{1}\"", attr.nodeName, System.Uri.EscapeDataString(attr.nodeValue.ToString()));
}
}
if (element.innerText != null)
{
sbJSON.Append(",\"innerText\": \"" + System.Uri.EscapeDataString(element.innerText) + "\"");
}
sbJSON.Append("}");
return sbJSON.ToString();
}
示例14: SetElement
public void SetElement(IHTMLElement ele)
{
if (this._element != ele)
{
this._element = ele;
this._isClick = false;
this._couldClick = false;
HTMLAnchorEvents2_Event event2 = ele as HTMLAnchorEvents2_Event;
if (event2 != null)
{
this._couldClick = true;
event2.onclick += (new HTMLAnchorEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
else
{
HTMLInputTextElementEvents2_Event event3 = ele as HTMLInputTextElementEvents2_Event;
if (event3 != null)
{
this._couldClick = true;
event3.onclick += (new HTMLInputTextElementEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
else
{
HTMLButtonElementEvents2_Event event4 = ele as HTMLButtonElementEvents2_Event;
if (event4 != null)
{
this._couldClick = true;
event4.onclick += (new HTMLButtonElementEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
else
{
HTMLControlElementEvents2_Event event5 = ele as HTMLControlElementEvents2_Event;
if (event5 != null)
{
this._couldClick = true;
event5.onclick += (new HTMLControlElementEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
else
{
HTMLImgEvents2_Event event6 = ele as HTMLImgEvents2_Event;
if (event6 != null)
{
this._couldClick = true;
event6.onclick += (new HTMLImgEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
else
{
HTMLElementEvents2_Event event7 = ele as HTMLElementEvents2_Event;
if (event7 != null)
{
this._couldClick = true;
event7.onclick += (new HTMLElementEvents2_onclickEventHandler(this.HtmlElement1_Click));
}
}
}
}
}
}
}
}
示例15: AsImageElement
public static ImageElement AsImageElement(IHTMLElement e) {
if ( e is HTMLImgClass ) {
return new ImageElement(e);
} else {
return null;
}
}