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


C# IHTMLDiv.Clear方法代码示例

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


在下文中一共展示了IHTMLDiv.Clear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(IApp page)
        {
            var l = new NotificationLayout().layout;

            l.AttachToDocument();

            var div0 = new IHTMLDiv().AttachToDocument();

            new { }.With(
                async delegate
                {

                    do
                    {
                        div0.Clear();

                        new IHTMLHorizontalRule().AttachToDocument();

                        Task<ISVGSVGElement> n = l;

                        var svg = await n;

                        IHTMLImage i = svg;

                        var c = new CanvasRenderingContext2D(l.clientWidth, l.clientHeight);
                        c.drawImage(i, 0, 0, l.clientWidth, l.clientHeight);
                        c.canvas.AttachTo(div0);
                    }
                    while (await l.async.onmutation);

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

示例2: RefreshComments

        public static void RefreshComments(this IBacicInterface intFace, IHTMLDiv commentDiv)
        {
            commentDiv.Clear();

            Action refresh = async delegate
            {
                var comments = await intFace.GetAllViewComments(Native.document.location.hash);
                if (comments != null)
                {
                    for (var r = 0; r < comments.Rows.Count; r++)
                    {
                        var row = (global::Abstractatech.Comments.Schema.CommentCommentTableRow)comments.Rows[r];
                        var container = new CommentRow();
                        container.name.innerText = row.Name;
                        container.email.innerText = row.Email;
                        container.time.innerText = row.Timestamp.ToString("dd.MM.yyyy HH:mm:ss");
                        container.content.style.whiteSpace = IStyle.WhiteSpaceEnum.pre;
                        container.content.innerText = row.Comment;

                        container.AttachTo(commentDiv);
                    }
                }
            };
            refresh();
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:25,代码来源:Application.cs

示例3: Application

		public Application(IAbout a)
		{
			var s = new InternalSaveActionSprite();

			s.AttachSpriteTo(a.Content);

			s.WebService = new ApplicationWebService();

			var pp = new ProjectNameInput();

			pp.AttachControlTo(a.Content);

			var Files = new IHTMLDiv().AttachTo(a.Content);

			s.WhenReady(
				i =>
				{
					Action Update = delegate
					{
						var sln = new SolutionBuilder
						{
							Name = pp.ProjectName.Text
						};

						i.FileName = sln.Name + ".zip";
						i.Clear();

						Files.Clear();

						sln.WriteTo(
							(SolutionFile f) =>
							{
								new IHTMLPre { innerText = f.Name }.AttachTo(Files);

								i.Add(f.Name, f.Content);
							}
						);
					};

					pp.UpdateButton.TextChanged +=
						delegate
						{
						};

					pp.UpdateButton.Click +=
						delegate
						{
							Update();
						};

					Update();
				}
			);
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:54,代码来源:Application.cs

示例4: Application

        //public readonly ApplicationWebService service = new ApplicationWebService();

        /// <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(IDefault page)
        {
            var service = this;

            #region pre
            Func<string, IHTMLDiv, IHTMLElement> pre =
                (value, output) =>
                {
                    return new IHTMLPre { innerText = value }.AttachTo(output);
                };
            #endregion

            #region pre
            Func<string, IHTMLDiv, IHTMLElement> browse = null;

            browse =
                (path, output) =>
                {

                    var list = new IHTMLButton { innerText = path }.AttachTo(output);


                    var group = new IHTMLDiv().AttachTo(output);




                    list.onclick +=
                        delegate
                        {
                            group.style.margin = "1em";
                            group.style.paddingLeft = "1em";
                            group.style.border = "1px solid gray";

                            list.disabled = true;

                            service.File_list(path,
                                ydirectory: value =>
                                {
                                    browse(path + "/" + value, group);
                                },

                                yfile: value =>
                                {
                                    var link = new IHTMLAnchor { href = "/io" + path + "/" + value, innerText = value };

                                    link.style.display = IStyle.DisplayEnum.block;
                                    link.AttachTo(group);
                                }
                            );
                        };

                    return group;
                };
            #endregion



            #region f
            Action<string, string, Action<string, Action<string>>, Func<string, IHTMLDiv, IHTMLElement>> f =
                (text, arg1, c, y) =>
                {
                    var btn = new IHTMLButton(text).AttachToDocument();
                    var output = new IHTMLDiv().AttachToDocument();

                    btn.onclick +=
                        e =>
                        {
                            btn.style.color = JSColor.Red;

                            output.Clear();

                            c(arg1,
                                value =>
                                {
                                    btn.style.color = JSColor.Blue;


                                    y(value, output);
                                }
                            );
                        }
                    ;
                };
            #endregion

            #region ff
            Action<string, Func<Task<string>>, Func<string, IHTMLDiv, IHTMLElement>> ff =
                (text, c, y) =>
                {
                    var btn = new IHTMLButton(text).AttachToDocument();
                    var output = new IHTMLDiv().AttachToDocument();

                    btn.WhenClicked(
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs

示例5: MakeCamGrabber


//.........这里部分代码省略.........
                                // { Avatar640x480 = 54843, Avatar96gif = 54734 } 
                                new
                                {
                                    Avatar640x480 = base64.Length,
                                    Avatar96gif = gif.Length
                                }
                            );


                            if (yield != null)
                                yield(
                                    new WebCamAvatarsSheet1Row
                                    {
                                        Avatar640x480 = base64,
                                        Avatar96frame1 = Native.window.localStorage[localStorageKeys.frames[0]],
                                        // do we want to report frames?
                                        Avatar96gif = gif
                                    }
                                );


                            atgif(gif);
                        }
                        );
                }

            }
            #endregion

            Console.WriteLine("await c.async.onclick");
            await c.async.onclick;
            Console.WriteLine("await c.async.onclick done");

            c.Clear();

            css.content = "awaiting for video";




            var v = await Native.window.navigator.async.onvideo;


            v.AttachTo(c);
            v.play();


            var mask_css = c.css[IHTMLElement.HTMLElementEnum.canvas];



            newmask();

            var z96 = new CanvasRenderingContext2D(96, 96);

            z96.canvas.AttachTo(c);
            //z96.canvas.style.backgroundColor = "gray";
            z96.canvas.style.SetLocation(96 * 5, 480);

            z96.canvas.style.zIndex = 300;


            var ok = c.async.onclick;

            #region frames
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:66,代码来源:Application.cs

示例6: 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(IApp page)
        {
            #region += Launched chrome.app.window
            dynamic self = Native.self;
            dynamic self_chrome = self.chrome;
            object self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                if (!(Native.window.opener == null && Native.window.parent == Native.window.self))
                {
                    Console.WriteLine("chrome.app.window.create, is that you?");

                    // pass thru
                }
                else
                {
                    // should jsc send a copresence udp message?
                    chrome.runtime.UpdateAvailable += delegate
                    {
                        new chrome.Notification(title: "UpdateAvailable");

                    };

                    chrome.app.runtime.Launched += async delegate
                    {
                        // 0:12094ms chrome.app.window.create {{ href = chrome-extension://aemlnmcokphbneegoefdckonejmknohh/_generated_background_page.html }}
                        Console.WriteLine("chrome.app.window.create " + new { Native.document.location.href });

                        new chrome.Notification(title: "Launched2");

                        var xappwindow = await chrome.app.window.create(
                               Native.document.location.pathname, options: null
                        );

                        //xappwindow.setAlwaysOnTop

                        xappwindow.show();

                        await xappwindow.contentWindow.async.onload;

                        Console.WriteLine("chrome.app.window loaded!");
                    };


                    return;
                }
            }
            #endregion

            // 
            // http://stackoverflow.com/questions/13076272/how-do-i-give-webkitgetusermedia-permission-in-a-chrome-extension-popup-window
            // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20150712
            new { }.With(
                async delegate
                {
                    Native.body.Clear();
                    Native.document.documentElement.style.overflow = IStyle.OverflowEnum.auto;

                    new IHTMLPre
                    {
                        "GearVR should send analog and digital signal to start parallax tracking only if near zero rotation."
                    }.AttachToDocument();

                    // would it be easy to do head tracking via webcam for VR?
                    // the app would run on android, yet
                    // two sattelites could spawn on two laptops to track the head.

                    // would we be able to thread hop between camera devices and android?

                    // http://shopap.lenovo.com/hk/en/laptops/lenovo/u-series/u330p/
                    // The U330p's integrated 720p HD webcam


                    // HD wont work for chrome app?
                    var v = await Native.window.navigator.async.onvideo;
                    v.AttachToDocument();

                    v.play();

                    new IHTMLButton { "stop" }.AttachToDocument().onclick += delegate
                    {
                        //v.src = null;
                        v.src = "";
                        //v.pause();
                        //v.stop();
                    };

                    var sw = Stopwatch.StartNew();

                    while (v.videoWidth == 0)
                        await Native.window.async.onframe;


                    const int zoomx = 2;
                    //const int zoomy = 4;
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs

示例7: MakeimageNotification

        public static async void MakeimageNotification(IHTMLDiv c, IAvatarNotificationInterface service)
        {
            WebCamAvatarsSheet1Row lastPicture = null;

            //new IStyle(page.ImgContainer.css + IHTMLElement.HTMLElementEnum.img)
            //{
            //    transition = "left linear 2000ms",
            //    position = IStyle.PositionEnum.absolute,
            //    Opacity = 1
            //};

            while (true)
            {
                var pic = await service.GetLastUserImage();

                if (lastPicture != null)
                {
                    if (pic != null)
                    {
                        Console.WriteLine(pic.Key.ToString());
                        Console.WriteLine(lastPicture.Key.ToString());
                        if (pic.Key == lastPicture.Key)
                        {
                            c.Clear();
                        }
                        else
                        {
                            IHTMLImage img = new IHTMLImage();
                            img.AttachTo(c);
                            img.src = pic.Avatar96frame1;
                            img.style.left = "-150px";
                            lastPicture = pic;

                            await 500;

                            Native.window.requestAnimationFrame += delegate
                            {
                                img.style.left = "50px";

                            };

                            await 10000;

                            Native.window.requestAnimationFrame += delegate
                            {
                                img.style.left = "-150px";

                            };
                        }
                    }
                    else
                    {
                        c.Clear();
                    }
                }
                else
                {
                    IHTMLImage img = new IHTMLImage();
                    img.AttachTo(c);
                    lastPicture = pic;
                    img.src = pic.Avatar96frame1;
                    img.style.left = "-150px";

                    await 500;

                    Native.window.requestAnimationFrame += delegate
                    {
                        img.style.left = "50px";

                    };

                    await 10000;

                    Native.window.requestAnimationFrame += delegate
                    {
                        img.style.left = "-150px";

                    };
                }
                await 4000;
            }

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


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