Exemplo n.º 1
0
        private void CreateThreads()
        {
            window = new LayeredWindow();
            //WindowThread = new Thread(new ThreadStart(() => Application.Run(window)));
            //WindowThread.IsBackground = true;
            //WindowThread.SetApartmentState(ApartmentState.STA);
            //WindowThread.Start();

            wManager        = new LayeredWindowManager();
            wManager.config = core.config;
            wManager.window = window;
            wManager.HelpPositionChange();
            core.AddControl("窗口控制", wManager);

            cManager = new CfxControl(this);
            core.AddControl("URL", cManager);
        }
Exemplo n.º 2
0
        public void MainThread(object coreInst)
        {
            core = (Core)coreInst;

            window         = core.RequestPlugin("ArkDesktop.LayeredWindow").CreateInstance("ArkDesktop.LayeredWindow") as LayeredWindow;
            manager        = core.RequestPlugin("ArkDesktop.LayeredWindowManager").CreateInstance("ArkDesktop.LayeredWindowManager") as LayeredWindowManager;
            manager.window = window;
            manager.config = core.config;
            manager.HelpPositionChange();
            manager.helpZoomChange = true;
            core.AddControl("渲染窗口", manager);

            if (EnsureConfigCorrect() == false)
            {
                return;
            }

            Lua    lua = new Lua();
            LuaApi api = new LuaApi(this, lua);

            window.Click += (sender, e) => api.OnClick();

            while (true)
            {
                if (launchType == LaunchType.Positive)
                {
                    try
                    {
                        lua.DoString(config.Element(ns + "LuaScript").Value);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("发生异常:" + e.Message + "\n" + e.StackTrace);
                    }
                }
                if (isDisposed)
                {
                    break;
                }
            }
        }