當前位置: 首頁>>代碼示例>>C#>>正文


C# IHTMLDiv.WithinContainer方法代碼示例

本文整理匯總了C#中ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv.WithinContainer方法的典型用法代碼示例。如果您正苦於以下問題:C# IHTMLDiv.WithinContainer方法的具體用法?C# IHTMLDiv.WithinContainer怎麽用?C# IHTMLDiv.WithinContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv的用法示例。


在下文中一共展示了IHTMLDiv.WithinContainer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: VisualStudioView

        public VisualStudioView()
        {
            var ToolbarHeight = "24px";


            var Content = new IHTMLDiv();

            this.Container = Content;
            this.Container.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.absolute;
            this.Container.style.width = "100%";
            this.Container.style.height = "100%";

            new TwentyTenWorkspace().ToBackground(Content.style, true);

            var EditorFrame = VisualStudioView.CreateEditor();

            var ToolbarContainerBackground = new IHTMLDiv().With(
                k =>
                {
                    k.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.absolute;
                    k.style.left = "0px";
                    k.style.right = "0px";
                    k.style.top = "0px";
                    k.style.height = ToolbarHeight;

                    k.style.backgroundColor = Color.White;
                    //k.style.Opacity = 0.5;
                }
            ).AttachTo(Content);

            var ToolbarContainer = new IHTMLDiv().With(
                k =>
                {
                    k.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.absolute;
                    k.style.left = "0px";
                    k.style.right = "0px";
                    k.style.top = "0px";
                    k.style.height = ToolbarHeight;


                }
            ).AttachTo(Content);

            var ToolbarContent = new IHTMLDiv().AttachTo(ToolbarContainer);

            ToolbarContent.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.relative;

            this.PriorityButtons = new IHTMLSpan().AttachTo(ToolbarContent);
            this.ApplyToolbarButtonStyle =
                k =>
                {
                    k.style.verticalAlign = "top";

                    k.style.padding = "0";
                    k.style.margin = "0";
                    k.style.overflow = ScriptCoreLib.JavaScript.DOM.IStyle.OverflowEnum.hidden;
                    k.style.SetSize(24, 24);

                    VisualStudioView.ApplyMouseHoverStyle(k, Color.Transparent);
                };

            Func<IHTMLImage, IHTMLButton> AddButtonDummy =
                (img) =>
                {
                    return new IHTMLButton { img.WithinContainer() }.With(k => ApplyToolbarButtonStyle(k)).AttachTo(ToolbarContent);
                };

            Func<IHTMLImage, Action, IHTMLButton> AddButtonAction =
                (img, command) =>
                {
                    return AddButtonDummy(img).With(
                        k =>
                        {
                            k.onclick +=
                                delegate
                                {
                                    command();
                                };

                        }
                    );
                };

            Func<IHTMLImage, string, IHTMLButton> AddButton =
                (img, command) =>
                {
                    return AddButtonAction(img, () =>
                        EditorFrame.contentWindow.document.execCommand(
                            command, false, null
                        )
                    );
                };

            var RTAButtons = new Dictionary<string, IHTMLImage>
            {
                // http://trac.symfony-project.org/browser/plugins/dmCkEditorPlugin/web/js/ckeditor/_source/plugins?rev=27455

                {"Bold", new RTA_bold()},
                {"Underline", new RTA_underline()},
                {"Strikethrough", new RTA_strikethrough()},
//.........這裏部分代碼省略.........
開發者ID:exaphaser,項目名稱:JSC-Cross-Compiler,代碼行數:101,代碼來源:VisualStudioView.cs


注:本文中的ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv.WithinContainer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。