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


C# IHTMLDiv.Dispose方法代码示例

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


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

示例1: Program


//.........这里部分代码省略.........
                    #endregion

                    this.Session.ClientName = e;


                    var a = new ArenaControl();
                    var m = new ArenaMinimapControl();

                    a.Control.AttachToDocument();

                    a.Layers.Canvas.style.backgroundColor = Color.FromRGB(0, 0x80, 0);

                    // set the map to be somewhere left
                    a.SetLocation(Rectangle.Of(32, 32, 640, 480));


                    // set tha map canvas size to be something big
                    a.SetCanvasSize(new Point(8000, 8000));

                    #region DrawTextWithTimeout
                    System.Action<string, Color> DrawTextWithTimeout =
                                   delegate(string text, Color color)
                                   {
                                       var z = new IHTMLDiv(new ITextNode(text));

                                       z.style.color = color;
                                       z.style.backgroundColor = Color.Black;

                                       a.Layers.Info.appendChild(z);

                                       this.SessionTimer[TimerEvent.DelayOnce(9000)] =
                                           delegate
                                           {
                                               z.Dispose();
                                           };
                                   };
                    #endregion

                    this.SessionTimer[TimerEvent.DelayOnce(1000)] =
                       delegate
                       {
                           a.DrawTextToInfo("just some data", new Point(46, 246), Color.Black);
                           a.DrawTextToInfo("just some data", new Point(45, 245), Color.Yellow);

                           DrawTextWithTimeout("hello world", Color.Red);
                       };



                    var data = new List<Pair<Rectangle, Color>>();

                    #region minimap


                    m.Zoom.Validate += delegate
                    {
                        if (a.CurrentCanvasSize.X > a.CurrentCanvasSize.Y)
                        {
                            var w = m.CurrentLocation.Width / a.CurrentCanvasSize.X;

                            if (m.Zoom.Value < w)
                                m.Zoom.Value = w;
                        }
                        else
                        {
                            var h = m.CurrentLocation.Height / a.CurrentCanvasSize.Y;
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:67,代码来源:Program.cs

示例2: DemoControl

        public DemoControl(IHTMLElement e)
        //: base(e)
        {
            //Native.DebugBreak();

            //Console.EnableActiveXConsole();
            // Console.WriteLine("!!!");

            ImportStyleSheet("fx/css/cnc.css");


            var loading = new IHTMLDiv("Connecting to server...");

            loading.style.fontSize = "36pt";
            loading.style.backgroundColor = Color.Black;
            loading.style.padding = "2em";

            Native.Document.body.appendChild(loading);

            Native.Document.body.style.color = Color.White;
            Native.Document.body.style.backgroundColor = Color.Black;


            this.CurrentSession = new ClientSession();
            this.CurrentSession.Control = this;

            Debugger.Break();

            this.CurrentSession.MethodA("a1", "a2",
                delegate(string text)
                {
                    loading.innerHTML = "Entering lobby...";

                    this.CurrentSession.IServer_EnterLobby(
                        delegate(string str)
                        {
                            this.CurrentSession.ClientName = str;

                            Native.Document.title = str;

                            Console.WriteLine("i am: " + str);

                            loading.innerHTML = "Loading gfx... " + text;

                            new IHTMLImage("fx/gfx/logo/636.jpg").InvokeOnComplete(
                                delegate(IHTMLImage bg)
                                {
                                    var bs = Native.Document.body.style;

                                    bs.backgroundImage = "url(" + bg.src + ")";
                                    bs.backgroundRepeat = "no-repeat";


                                    Setup(
                                        delegate
                                        {

                                            loading.innerHTML = "ready!";
                                            loading.Dispose();








                                        }

                                            );
                                }
                                    );
                        });

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

示例3: DisplayNotification

        // _1483b5833155c53585239c5e871e940c_600000c	2496	93.55%	871.254ms	1041.498ms	0.417ms

        public void DisplayNotification(string text, Color color)
        {
            var x = new IHTMLDiv(new ITextNode(text));

            x.style.color = color;

            x.style.backgroundColor = Color.Black;

            x.style.padding = "1em";
            x.style.zIndex = 1000;

            x.AttachToDocument();

            new Timer(
                delegate
                {
                    x.Dispose();
                }, 15000, 0);


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

示例4: Initialize

        public void Initialize(IHTMLElement Menu, Func<IHTMLImage, string, Type, Action<Type>, IHTMLElement> ConvertImageToControl)
        {
            var List = new IHTMLElement(IHTMLElement.HTMLElementEnum.ol).AttachTo(Menu);

            var ApplicationsWithLoadingImagesQuery =
                from t in Applications
                let assembly = t.Assembly.GetName().Name
                let preview = "assets/" + assembly + "/Preview.png"
                let image = new IHTMLImage(preview)
                orderby t.Name
                select new { t, assembly, preview, image };

            var ApplicationsWithLoadingImages = ApplicationsWithLoadingImagesQuery.ToArray();

            var LoadingMessage = new IHTMLDiv().AttachTo(Menu);

            var DoneLoading = 500.Until(
                t =>
                {
                    var count = ApplicationsWithLoadingImages.Count(i => !i.image.complete);

                    LoadingMessage.innerText = count + " images are still loading...";

                    return (count == 0 || t.Counter == 6);
                }
            );

            Func<Point> GetCenter =
                () => new Point(Native.Window.Width / 2, Native.Window.Height / 2);

            Action<Type> TypeClicked = t => { };

            DoneLoading +=
                delegate
                {
                    var query = from i in ApplicationsWithLoadingImages
                                let hasimage = i.image.complete && i.image.width > 0
                                select new { i.image, i.t, i.assembly, hasimage, i.preview }; ;

                    var WithImages =
                        from i in query
                        where i.hasimage
                        select i;


                    var WithoutImages =
                        from i in query
                        where !i.hasimage
                        select i;

                    #region WithImages
                    DoneLoading = WithImages.ForEachAtInterval(50,
                        v =>
                        {
                            LoadingMessage.innerText = v.t.Name;

                            var href = v.t.Name + ".htm";

                            var r = ConvertImageToControl(v.image, href, v.t, TypeClicked);

                            r.AttachTo(Menu);

                        }
                    );
                    #endregion

                    DoneLoading +=
                        delegate
                        {
                            LoadingMessage.Dispose();

                            var clr = new IHTMLBreak();

                            clr.style.clear = "both";
                            clr.AttachTo(Menu);

                            foreach (var v in WithoutImages)
                            {
                                new IHTMLDiv("image not found: " + v.preview).AttachTo(Menu);
                            }


                            "script".DisposeElementsByTagName();
                            "noscript".DisposeElementsByTagName();

                            
                        };

                };

            TypeClicked +=
                t =>
                {
                    Menu.Dispose();

                    try
                    {
                        Activator.CreateInstance(t);
                    }
                    catch (Exception exc)
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:ExampleGalleryAbstract.cs


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