public USB2SNESComponent(LiveSplitState state)
        {
            _state    = state;
            _settings = new ComponentSettings();
            _model    = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);

            _splits  = null;
            _inTimer = false;
            _error   = false;

            _update_timer = new Timer()
            {
                Interval = 33
            };
            _update_timer.Tick   += (sender, args) => UpdateSplits();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            _usb2snes       = new USB2SnesW.USB2SnesW();
        }
        private void Init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _usb2snes     = usb2snesw;
            _mystate      = MyState.NONE;
            _proto_state  = ProtocolState.NONE;
            _stateChanged = false;

            _state    = state;
            _settings = new ComponentSettings();
            _model    = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;
            _fs_watcher           = new FileSystemWatcher();
            _fs_watcher.Changed  += async(sender, args) => {
                await Task.Delay(200);

                _do_reload = true;
            };
            _splits  = new List <Split>();
            _inTimer = false;

            HorizontalWidth = 3;
            VerticalHeight  = 3;
        }
Exemple #3
0
        private void init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _state           = state;
            _config_state    = ConfigState.NONE;
            _proto_state     = ProtocolState.NONE;
            _ready_timer     = new Stopwatch();
            _attached_device = string.Empty;
            _settings        = new ComponentSettings(_state)
            {
                Dock = DockStyle.Fill,
            };
            _model = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _stateChanged = false;
            _splits       = new List <string>();
            _inTimer      = false;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            HorizontalWidth = 3;
            VerticalHeight  = 3;
            _usb2snes       = usb2snesw;
        }
        private void init(LiveSplitState state, USB2SnesW.USB2SnesW usb2snesw)
        {
            _state       = state;
            _mystate     = MyState.NONE;
            _proto_state = ProtocolState.NONE;
            _settings    = new ComponentSettings();
            _model       = new TimerModel()
            {
                CurrentState = _state
            };
            _state.RegisterTimerModel(_model);
            _stateChanged   = false;
            _splits         = null;
            _inTimer        = false;
            _config_checked = false;
            _valid_config   = false;

            _update_timer = new Timer()
            {
                Interval = 1000
            };
            _update_timer.Tick   += (sender, args) => UpdateSplitsWrapper();
            _update_timer.Enabled = true;

            _state.OnReset += _state_OnReset;
            _state.OnStart += _state_OnStart;
            HorizontalWidth = 3;
            VerticalHeight  = 3;
            _usb2snes       = usb2snesw;
        }