private void DrawWatchedStores() { var name = string.Empty; IVariableStore add = null; VariableStoreControl remove = null; foreach (var watched in _watchedStores) { watched.Draw(); if (watched.Selected != null) { name = watched.SelectedName; add = watched.Selected; } if (watched.ShouldClose) { remove = watched; } } if (add != null) { AddWatch(name, add); } if (remove != null) { RemoveWatch(remove); } }
private void AddWatch(string name, IVariableStore store) { var control = new VariableStoreControl(); control.Setup(name, store, false, true); _watchedStores.Add(control); }
private void UpdateGlobalStore() { if (CompositionManager.Exists && (_globalStore == null || _globalStore.Store != CompositionManager.Instance.GlobalStore)) { _globalStore = new VariableStoreControl(); _globalStore.Setup(CompositionManager.GlobalStoreName, CompositionManager.Instance.GlobalStore, false, false); } }
private void PlayModeStateChanged(PlayModeStateChange state) { if (state == PlayModeStateChange.ExitingPlayMode) { _globalStore = null; _instructionStores.Clear(); _watchedStores.Clear(); } }
private void UpdateInstructionStores() { if (CompositionManager.Exists) { for (var i = 0; i < _instructionStores.Count; i++) { if (!CompositionManager.TrackingState.Any(data => data.Key.Variables == _instructionStores[i].Store)) { _instructionStores.RemoveAt(i--); } } foreach (var instruction in CompositionManager.TrackingState) { if (!_instructionStores.Any(control => control.Store == instruction.Key.Variables)) { var control = new VariableStoreControl(); control.Setup(instruction.Key.name, instruction.Key.Variables, true, false); _instructionStores.Add(control); } } } }
private void RemoveWatch(VariableStoreControl control) { _watchedStores.RemoveAll(c => c == control); }