コード例 #1
0
ファイル: Program.cs プロジェクト: ndepoel/OculusTray
        private static void RunCommand(string[] args)
        {
            if (args.Length < 2)
            {
                return;
            }

            var service = OculusUtil.FindOculusService();

            if (service == null)
            {
                Error(Resources.Error_VR_Service_Not_Found);
                return;
            }

            var oculusService = new OculusService(service);

            switch (args[1].ToLowerInvariant())
            {
            case OculusService.StartCommand:
                oculusService.Start();
                break;

            case OculusService.StopCommand:
                oculusService.Stop();
                break;

            case OculusService.RestartCommand:
                oculusService.Restart();
                break;
            }
        }
コード例 #2
0
        public OculusTrayIcon(OculusService oculusService, FileInfo oculusClientPath)
        {
            _oculusService    = oculusService;
            _oculusClientPath = oculusClientPath;

            _notifyIcon = new NotifyIcon
            {
                ContextMenuStrip = CreateContextMenu(),
                Text             = Resources.Oculus_VR_Service,
                Visible          = true,
            };

            _notifyIcon.DoubleClick += ToggleService;

            UpdateStatus();
            PollServiceStatus();
        }