当前位置: 首页>>代码示例>>C#>>正文


C# IHTMLElement类代码示例

本文整理汇总了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;
        }
开发者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


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