Exemplo n.º 1
0
 public UdpSender(SynchroGazerVolatileSetting setting, SynchroGazerStatus status)
 {
     setting.PropertyChanged    += OnSettingChanged;
     status.BlinkActionHappened += OnBlinkAction;
     _udpClient = new UdpClient();
     _endPoint  = new IPEndPoint(IPAddress.Loopback, SettingFile.Instance.Setting.PortWpfToUnity);
 }
        public MouseController(
            SettingFile setting,
            SynchroGazerVolatileSetting volatileSetting,
            SynchroGazerStatus status
            )
        {
            _setting         = setting;
            _volatileSetting = volatileSetting;
            _status          = status;

            _status.BlinkActionHappened += OnBlinkAction;
        }
Exemplo n.º 3
0
        public WindowsEventSender(SynchroGazerVolatileSetting setting, SynchroGazerStatus status)
        {
            _mmf = MemoryMappedFile.CreateOrOpen(
                WindowsEventProtocol.MemoryMappedFileWpfToUnity,
                WindowsEventProtocol.MemoryMappedFileByteLength
                );

            _eventHandle = new EventWaitHandle(
                false, EventResetMode.AutoReset, WindowsEventProtocol.EventHandleWpfToUnity
                );

            setting.PropertyChanged    += OnSettingChanged;
            status.BlinkActionHappened += OnBlinkAction;
        }
Exemplo n.º 4
0
        public StatusViewModel(SettingFile setting)
        {
            _setting = setting;

            if (!DesignerProperties.GetIsInDesignMode(Application.Current.MainWindow))
            {
                Status = new SynchroGazerStatus();
            }

            VolatileSetting = new SynchroGazerVolatileSetting();


            ShowLargeMarkAlways = _setting.Setting.ShowLargeMarkAlways;
            ShowFixTargetMark = 
                (_setting.Setting.ShowFixTargetMark && Status.FixDisplayPosition);
            ShowAnimationFeedback = _setting.Setting.ShowAnimationFeedback;

            Status.PropertyChanged += OnStatusChanged;
            _setting.FileSaved += OnSettingChanged;
            _setting.SettingFileContentChanged += OnSettingChanged;
        }
Exemplo n.º 5
0
 public WindowsEventReceiver(SynchroGazerVolatileSetting setting)
 {
     _setting = setting;
     Task.Run(() => ReceiveThread(_cts.Token));
 }