Esempio n. 1
0
        public static void InitializeConnection()
        {
            currentPath = Path.GetDirectoryName(typeof(Exports).Assembly.Location);
            AppDomain.CurrentDomain.AssemblyResolve += ResolveLibraries;

            service         = new KinectService();
            servicePipe     = NamedPipeStream.Create(SERVICE_NAME, NamedPipeStream.PipeDirection.InOut);
            serviceReceiver = new StreamServiceReceiver <IKinectService>(service, servicePipe);
            thread          = new Thread(StartPipeHandler);
            thread.Start();
        }
Esempio n. 2
0
        void InitializeService()
        {
            Log("Initializing services");

            InitializeConnection();

            Log("Done!");

            listener           = new KinectListener();
            captureServicePipe = NamedPipeStream.Create(LISTENER_NAME, NamedPipeStream.PipeDirection.InOut);
            listenerReceiver   = new StreamServiceReceiver <IKinectListener>(listener, captureServicePipe);
            runnerThread       = new Thread(StartPipeHandler);
            runnerThread.Start();

            listener.Initialize();

            Log("Sending connection request");
            listener.KinectService.SetListener(LISTENER_NAME, ".");
            Log("Connected!");
        }
        private void InitNativeGUI()
        {
            var libPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                       "RuntimeUnityEditor.UI.dll");

            Logger.Log(LogLevel.Info, $"Lib path: {libPath}");
            var lib = NativeUtils.LoadNativeLibrary(libPath);

            if (lib == null)
            {
                Logger.Log(LogLevel.Error, "No UI library found!");
                return;
            }

            ShowGUI = lib.GetFunctionAsDelegate <ShowGUIDelegate>(nameof(ShowGUI));

            receivePipeStream = NamedPipeStream.Create("RuntimeUnityEditor_Service", NamedPipeStream.PipeDirection.InOut, securityDescriptor: "D:(A;OICI;GA;;;WD)");
            serviceReceiver   = new StreamServiceReceiver <IRuntimeUnityEditorService>(new Service(), receivePipeStream);
            receiveThread     = new Thread(ReceiveLoop);
            receiveThread.Start();
        }