public void ChangeLayout(LayoutType type) { _currentLayout = type; foreach (var mapping in _inputData.Layouts[(int)_currentLayout].Mappings) { _directionEntries[mapping.MoveDir].UpdateKey(mapping.KeyCode); } OnLayoutChanged?.Invoke(_currentLayout); }
void FoldLayoutChanged() { OnLayoutChanged?.Invoke(this, new Microsoft.Maui.Foldable.FoldEventArgs() { isSeparating = IsSeparating, FoldingFeatureBounds = FoldingFeatureBounds, WindowBounds = WindowBounds }); }
public async Task Start() { _client = new HttpClient(); var stream = await _client.GetStreamAsync(Host); var reader = new StreamReader(stream); string eventName = null; string data = null; while (_client != null) { var line = await reader.ReadLineAsync(); if (string.IsNullOrEmpty(line) || line.StartsWith(":")) { eventName = data = null; continue; } if (line.StartsWith("event: ")) { eventName = line.Substring("event: ".Length).Trim(); } else if (line.StartsWith("data: ")) { data = line.Substring("data: ".Length).Trim('"'); switch (eventName) { case "data_changed": OnDataChanged?.Invoke(JsonConvert.DeserializeObject <JToken>(data)); break; case "layout_changed": OnLayoutChanged?.Invoke(data); break; } } } this.Stop(); }