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


C# WebView.LoadFile方法代码示例

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


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

示例1: Load

        public virtual void Load(int width, int height)
        {
            Width = width;
            Height = height;
            _page = new Texture();
            GUIShader = Assets.Fetch<ShaderProgram>("GUI");
            GUIShader.AddUniform("scale");
            VBO = new VBO<VertexPositionNormalTexture>();
            VAO = new VAO<VertexPositionNormalTexture>();
            VBO.Buffer(new[]{
                new VertexPositionNormalTexture{Position = new Vector3(0, Height, 0f),Normal = Vector3.UnitZ,TexCoord = new Vector2(0, Height)},
                new VertexPositionNormalTexture{Position = new Vector3(Width, Height, 0f),Normal = Vector3.UnitZ,TexCoord = new Vector2(Width, Height)},
                new VertexPositionNormalTexture{Position = new Vector3(Width, 0, 0f),Normal = Vector3.UnitZ,TexCoord = new Vector2(Width, 0)},
                new VertexPositionNormalTexture{Position = new Vector3(0, 0, 0),Normal = Vector3.UnitZ,TexCoord = new Vector2(0,0)}
            });
            VAO.Setup(GUIShader, VBO);
            _webView = WebCore.CreateWebView(Width, Height);
            WebCore.BaseDirectory = Path.Combine(Directory.GetCurrentDirectory(), "GUI");
            _webView.FlushAlpha = false;
            _webView.IsTransparent = true;
            _webView.CreateObject("console");
            _webView.SetObjectCallback("console", "log", (sender, e) => Bus.Add(new DebugMessage(Timer.LastTickTime, e.Arguments[0].ToString())));

            _webView.CreateObject("GUI");
            _webView.CreateObject("Bus");

            _webView.LoadFile("index.htm");
        }
开发者ID:veggielane,项目名称:SharpEngine,代码行数:28,代码来源:AwesomiumGUI.cs

示例2: Initialize

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        public override void Initialize()
        {
            webView = WebCore.CreateWebView(WindowSize.Width, WindowSize.Height);
            webView.LoadCompleted += OnFinishLoading;

            WebCore.BaseDirectory = Environment.CurrentDirectory;

            string path = @"\test.htm";
            if (!webView.LoadFile(path))
            {
                throw new ApplicationException("Error loading html file.");
            }

            base.Initialize();
        }
开发者ID:Wydra,项目名称:WickedEngine,代码行数:21,代码来源:Window.cs


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