• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IHTMLElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IHTMLElement的典型用法代码示例。如果您正苦于以下问题:C# IHTMLElement类的具体用法?C# IHTMLElement怎么用?C# IHTMLElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IHTMLElement类属于命名空间,在下文中一共展示了IHTMLElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ShouldVisitParent

        static bool ShouldVisitParent(IHTMLElement e)
        {
            if (e.parentNode == null)
                return false;

            return e.parentNode != Native.Document;
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:7,代码来源:ApplicationCanvas.cs


示例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;
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:25,代码来源:SpriteExtensions.cs


示例3: ApplyZoomedSize

        public ZoomedPoint ApplyZoomedSize(IHTMLElement e)
        {
            e.style.width = ZoomedXpx;
            e.style.height = ZoomedYpx;

            return this;
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:7,代码来源:ZoomedPoint.cs


示例4: AsTextArea

 public static TextArea AsTextArea(IHTMLElement e) {
     IHTMLTextAreaElement e2 = e as IHTMLTextAreaElement;
     if (e2 != null) {
         return new TextArea(e);
     }
     return null;
 }
开发者ID:ctsyolin,项目名称:ieunit,代码行数:7,代码来源:TextArea.cs


示例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;
                }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:26,代码来源:IEventExtensions.cs


示例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);
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:27,代码来源:MineSweeperGame.cs


示例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;
        }
开发者ID:pusp,项目名称:o2platform,代码行数:27,代码来源:FunctionManager.cs


示例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);
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:29,代码来源:Fader.cs


示例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);
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:38,代码来源:Fader.cs


示例10: AsAnchorLink

 public static AnchorLink AsAnchorLink(IHTMLElement e) {
     if ( e is IHTMLAnchorElement2 ) {
         return new AnchorLink( e );
     } else {
         return null;
     }
 }
开发者ID:ctsyolin,项目名称:ieunit,代码行数:7,代码来源:AnchorLink.cs


示例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);
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:33,代码来源:AvalonExampleGalleryContainer.cs


示例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;
				};
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:26,代码来源:Button.cs


示例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();
        }
开发者ID:pusp,项目名称:o2platform,代码行数:28,代码来源:frmFunctionChooser.cs


示例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));
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:purplecow,项目名称:AutoBroswer,代码行数:60,代码来源:ClickEvent.cs


示例15: AsImageElement

 public static ImageElement AsImageElement(IHTMLElement e) {
     if ( e is  HTMLImgClass ) {
         return new ImageElement(e);
     } else {
         return null;
     }
 }
开发者ID:ctsyolin,项目名称:ieunit,代码行数:7,代码来源:ImageElement.cs


示例16: UltraApplication

		public UltraApplication(IHTMLElement e)
		{
			var Title = new IHTMLDiv
				{
					innerHTML = @"
<img border='0' src='http://www.w3schools.com/images/compatible_ie.gif' width='31' height='30' alt='Internet Explorer' title='Internet Explorer' />
<img border='0' src='http://www.w3schools.com/images/compatible_firefox.gif' width='31' height='30' alt='Firefox' title='Firefox' />
<img border='0' src='http://www.w3schools.com/images/compatible_opera.gif' width='28' height='30' alt='Opera' title='Opera' />
<img border='0' src='http://www.w3schools.com/images/compatible_chrome.gif' width='31' height='30' alt='Google Chrome' title='Google Chrome' />
<img border='0' src='http://www.w3schools.com/images/compatible_safari.gif' width='28' height='30' alt='Safari' title='Safari' />
"
				};


			var TitleLogo = new IHTMLImage("assets/ScriptCoreLib/jsc.png");
			var TitleText = new IHTMLSpan("UltraApplication");
			TitleText.style.fontFamily = ScriptCoreLib.JavaScript.DOM.IStyle.FontFamilyEnum.Verdana;
			TitleText.style.paddingLeft = "2em";
			TitleText.style.fontSize = "xx-large";
			TitleLogo.style.verticalAlign = "middle";


			Title.appendChild(TitleLogo);
			Title.appendChild(TitleText);

			Title.style.height = "128px";

			Title.AttachToDocument();
			Title.FadeIn(2500, 1000,
				delegate
				{
					1500.AtDelay(ContinueBuildingApplication);
				}
			);
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:35,代码来源:UltraApplication.cs


示例17: getSelectedAnchor

        public IHTMLElement getSelectedAnchor(IHTMLElement currentSelectedElement)
        {
            // Is a valid anchor element currently selected in the editor?
            IHTMLElement selectedAnchor = this.TryGetAnchorFromSelection();

            if (selectedAnchor == null)
            {
                // No achor is currently selected, but one might be contained within the currently
                // selected element:
                IHTMLElementCollection children = (IHTMLElementCollection)currentSelectedElement.children;
                foreach (IHTMLElement child in children)
                {
                    if (child.tagName == "A")
                    {
                        selectedAnchor = child;
                    }
                }

                // Otherwise . . .
                if (selectedAnchor == null)
                {
                    // . . . Create one:
                    selectedAnchor = this.CreateNewSelectedAnchor(currentSelectedElement);
                }
            }
            return selectedAnchor;
        }
开发者ID:xivSolutions,项目名称:StaticAnchorManager,代码行数:27,代码来源:WLWEditorContent.cs


示例18: Of

            public static List<GetPositionData> Of(IHTMLElement e)
            {
                var a = new List<GetPositionData>();

                var x = 0;
                var y = 0;

                while ((INode)e.parentNode != Native.Document)
                {
                    x += e.offsetLeft;
                    y += e.offsetTop;

                    a.Add(
                        new GetPositionData
                        {
                            Element = e,
                            X = x,
                            Y = y
                        }
                    );

                    e = (IHTMLElement)e.parentNode;
                }

                return a;
            }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:26,代码来源:MouseEventArgs.cs


示例19: AsTextBlock

 public static TextBlock AsTextBlock(IHTMLElement e) {
     string txt = e.innerText;
     if ( (txt == null) || (txt.Length==0)) {
         return null;
     }
     return new TextBlock(e, txt);
 }
开发者ID:ctsyolin,项目名称:ieunit,代码行数:7,代码来源:TextBlock.cs


示例20: SoundTest

        public SoundTest(IHTMLElement e)
        //: base(e)
        {
            Native.Document.body.appendChild(Control);



            Control.style.color = Color.Red;

            Control.onmouseup += delegate(IEvent ev)
            {
                var w = new System.Text.StringBuilder();

                w.AppendLine("mousebutton: " + ev.MouseButton);

                Native.Window.alert(w.ToString());

                Native.PlaySound("assets/CardGames/sounds/hint.wav");


            };



        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:25,代码来源:SoundTest.cs



注:本文中的IHTMLElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IHTMLEventObj类代码示例发布时间:2022-05-24
下一篇:
C# IHTMLDocument2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap