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


C# JSObject.SetBrowser方法代码示例

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


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

示例1: ChromiumBrowser

        /// <summary>
        /// Creates a ChromiumWebBrowser object with the given initial URL.
        /// If createImmediately is true, then the underlying CfxBrowser is 
        /// created immediately with the default CfxRequestContext.
        /// </summary>
        public ChromiumBrowser(string initialUrl, bool createImmediately)
        {
            if (BrowserProcess.initialized)
            {

                SetStyle(ControlStyles.ContainerControl
                    | ControlStyles.ResizeRedraw
                    | ControlStyles.FixedWidth
                    | ControlStyles.FixedHeight
                    | ControlStyles.StandardClick
                    | ControlStyles.StandardDoubleClick
                    | ControlStyles.UserMouse
                    | ControlStyles.SupportsTransparentBackColor
                    | ControlStyles.EnableNotifyMessage
                    | ControlStyles.DoubleBuffer
                    | ControlStyles.OptimizedDoubleBuffer
                    | ControlStyles.UseTextForAccessibility
                    | ControlStyles.Opaque
                    , false);

                SetStyle(ControlStyles.UserPaint
                    | ControlStyles.AllPaintingInWmPaint
                    | ControlStyles.CacheText
                    | ControlStyles.Selectable
                    , true);

                if (initialUrl == null)
                    this.initialUrl = "about:blank";
                else
                    this.initialUrl = initialUrl;

                client = new BrowserClient(this);

                globalObject = new JSObject();
                globalObject.SetBrowser("window", this);

                if (createImmediately)
                    CreateBrowser();

            }
            else
            {
                BackColor = System.Drawing.Color.White;
                Width = 200;
                Height = 160;
                var label = new Label();
                label.AutoSize = true;
                label.Text = "ChromiumWebBrowser";
                label.Parent = this;
            }
        }
开发者ID:xmcy0011,项目名称:NanUI,代码行数:56,代码来源:ChromiumBrowser.cs

示例2: GlobalObjectForFrame

 /// <summary>
 /// Represents a named frame's global javascript object (window).
 /// Any changes to the global object's properties will be available 
 /// after the next time a V8 context is created in the render process
 /// of this browser for a frame with this name.
 /// </summary>
 public JSObject GlobalObjectForFrame(string frameName)
 {
     JSObject obj;
     if (!frameGlobalObjects.TryGetValue(frameName, out obj))
     {
         obj = new JSObject();
         obj.SetBrowser("window", this);
         frameGlobalObjects.Add(frameName, obj);
     }
     return obj;
 }
开发者ID:xmcy0011,项目名称:NanUI,代码行数:17,代码来源:ChromiumBrowser.cs


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