예제 #1
0
        private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText)
        {
            pluginScreenSpace.Text        = "오버레이 & 웹소켓 ";
            asmResolver.ExceptionOccured += (o, e) =>
            {
                //logger.Log(LogLevel.Error, "AssemblyResolver: Error: {0}", e.Exception);
            };
            asmResolver.AssemblyLoaded += (o, e) =>
            {
                //logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName);
            };

            AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs args)
            {
                string asmFile = (args.Name.Contains(",") ? args.Name.Substring(0, args.Name.IndexOf(",")) : args.Name);

                if (!ASMCHK.Contains(asmFile))
                {
                    return(null);
                }

                try
                {
                    if (Environment.Is64BitOperatingSystem)
                    {
                        return(Assembly.LoadFile(Path.Combine(CEFDIR64, asmFile + ".dll")));
                    }
                    else
                    {
                        return(Assembly.LoadFile(Path.Combine(CEFDIR, asmFile + ".dll")));
                    }
                }
                catch
                {
                    return(null);
                }
            };

            var    m = new ACTWebSocketMain();
            string pluginDirectory = GetPluginDirectory();

            m.SetSkinDir(Path.Combine(Environment.CurrentDirectory, "OverlaySkin"));
            m.SetPluginDirectory(pluginDirectory);
            m.InitPlugin(pluginScreenSpace, pluginStatusText);
            main = m;
        }
예제 #2
0
        private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText)
        {
            pluginScreenSpace.Text        = "ACTWebSocket";
            asmResolver.ExceptionOccured += (o, e) =>
            {
                //logger.Log(LogLevel.Error, "AssemblyResolver: Error: {0}", e.Exception);
            };
            asmResolver.AssemblyLoaded += (o, e) =>
            {
                //logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName);
            };

            var    m = new ACTWebSocketMain();
            string pluginDirectory = GetPluginDirectory();
            string pluginPath      = GetPluginPath();

            m.SetPluginPath(pluginPath);
            m.SetSkinDir(Path.Combine(Environment.CurrentDirectory, "OverlaySkin"));
            m.SetScreenShotDir(Path.Combine(Environment.CurrentDirectory, "ScreenShot"));
            m.SetPluginDirectory(pluginDirectory);
            m.InitPlugin(pluginScreenSpace, pluginStatusText);
            main = m;
        }