コード例 #1
0
        // You can override methods here to change the plug-in behavior on
        // loading and shut down, add options pages to the Rhino _Option command
        // and maintain plug-in wide options in a document.

        protected override LoadReturnCode OnLoad(ref string errorMessage)
        {
            CheckCefDependencies();

            Panels.RegisterPanel(this, typeof(SampleCsCefSharpVuePanel), "SampleCsCefSharpVue",
                                 SampleCsCefSharpVue.Properties.Resources.icon);

            if (!Cef.IsInitialized)
            {
                InitializeCef();
            }

            // initialise one browser instance
            InitializeCefSharp();

            Interop = new SampleCsCefSharpInterop(Browser);

            // make them talk together
            Browser.RegisterAsyncJsObject("Interop", Interop);

            Browser.IsBrowserInitializedChanged += Browser_IsBrowserInitializedChanged;

            Rhino.RhinoDoc.AddRhinoObject += RhinoDoc_AddRhinoObject;

            return(base.OnLoad(ref errorMessage));
        }