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


C# IHTMLElement.WithEach方法代码示例

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


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

示例1: 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(IDefaultPage page)
        {
            Func<string> GetText1 = () => page.Text1.value;

            page.Text1.onfocus += delegate
            {
                GetText1 = () => page.Text1.value;
            };
            page.Text1AutoSize.onfocus += delegate
            {
                GetText1 = () => page.Text1AutoSize.value;
            };

            Func<string> GetText2 = () => page.Text2.value;


            page.Text2.onfocus += delegate
            {
                GetText2 = () => page.Text2.value;
            };
            page.Text2AutoSize.onfocus += delegate
            {
                GetText2 = () => page.Text2AutoSize.value;
            };


            Action Update =
                delegate
                {
                    var FontFamily = (IStyle.FontFamilyEnum)(object)page.FontFamily.GetSelectionText();

                    var u = new IHTMLElement[]
                    {
                        page.Text1,
                        page.Text1Shadow,
                        page.Text1AutoSize,
                        page.Text2,
                        page.Text2Shadow,
                        page.Text2AutoSize,
                    };

                    foreach (var item in u)
                    {
                        item.style.padding = "0px";
                        item.style.margin = "0px";
                        item.style.borderWidth = "0px";
                        item.style.fontFamily = FontFamily;
                        item.style.fontSize = page.FontSize.GetSelectionText() + page.FontSizeUnit.GetSelectionText();
                        item.style.color = page.Foreground.GetSelectionText();
                        item.style.backgroundColor = page.Background.GetSelectionText();
                        item.style.lineHeight = page.LineHeight.GetSelectionText();
                        item.style.whiteSpace = IStyle.WhiteSpaceEnum.pre;
                        item.style.display = IStyle.DisplayEnum.inline_block;
                        item.style.overflow = IStyle.OverflowEnum.hidden;
                        item.style.resize = "none";



                    }

                    page.Text2.wrap = "off";
                    page.Text2AutoSize.wrap = "off";

                    var Shadows = new IHTMLElement[]
                    {
                         page.Text2ShadowContainer,
                          page.Text1ShadowContainer
                    };

                    Shadows.WithEach(
                        k =>
                        {
                            if ([email protected])
                            {
                                //page.Text2ShadowContainer.style.display = IStyle.DisplayEnum.none;

                                k.style.position = IStyle.PositionEnum.absolute;
                                k.style.overflow = IStyle.OverflowEnum.hidden;
                                k.style.width = "0px";
                                k.style.height = "0px";
                            }   
                            else
                            {   
                                k.style.display = IStyle.DisplayEnum.empty;
                                k.style.position = IStyle.PositionEnum.relative;
                                k.style.overflow = IStyle.OverflowEnum.auto;
                                k.style.width = "";
                                k.style.height = "";
                            }
                        }
                    );

                    page.Text1Shadow.innerText = GetText1();

                    GetText2().Replace("\r", "").With(
                        value =>
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs


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