public PresentationAssistantSettingsStore(Lifetime lifetime, ISettingsStore settingsStore, DataContexts dataContexts) { this.settingsStore = settingsStore; this.dataContexts = dataContexts; SettingsChanged = new SimpleSignal(lifetime, "Presentation Assistant settings changed"); var key = settingsStore.Schema.GetKey <PresentationAssistantSettings>(); settingsStore.Changed.Advise(lifetime, args => { foreach (var changedEntry in args.ChangedEntries) { if (changedEntry.Parent == key) { if (changedEntry.LocalName == "Enabled") { SettingsChanged.Fire(); } break; } } }); }
public TodoItemsCountPresenter(IShellLocks shellLocks) { _shellLocks = shellLocks; UpdateRequestSignal = new SimpleSignal($"{nameof(TodoItemsCountPresenter)}.{nameof(UpdateRequestSignal)}"); }
public UnityTestsSpecificYamlFileExtensionMapping(Lifetime lifetime) { Changed = new SimpleSignal(lifetime, GetType().Name + "::Changed"); }
public TestTodoItemsCountConsumer() { UpdateRequestSignal = new SimpleSignal($"{nameof(TestTodoItemsCountConsumer)}.{nameof(UpdateRequestSignal)}"); }
public SimpleInputFunc(string name, SimpleSignal callback) : base(name) { this.callback = callback; }
/// <summary> /// Links an editor callback name to a method inside this entity. /// This data is exposed for the I/O system. /// </summary> /// <param name="name">Name.</param> /// <param name = "component"></param> /// <param name="callback">Callback.</param> protected void DefineInputFunc(string name, string component, SimpleSignal callback) { if (!inputFuncs.ContainsKey(component)) { inputFuncs.Add(component, new List<InputFunc>(5)); } this.inputFuncs[component].Add(new SimpleInputFunc(name, callback)); }
/// <summary> /// Выбрать файл /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void selectFileButton_Click(object sender, EventArgs e) { try { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { filePath = openFileDialog.FileName; DataType type; var button = (Button)sender; switch (button.Name) { case "selectFileButton": type = DataType.Test; break; case "selectCardioFileButton": type = DataType.Cardio; break; case "selectReoFileButton": type = DataType.Reo; break; case "selectVeloFileButton": type = DataType.Velo; break; case "selectSpiroFileButton": type = DataType.Spiro; break; case "selectAudioFileButton": type = DataType.Audio; break; default: throw new ArgumentException("Необрабатываемое нажатие клавиши"); } SignalReader signalReader = new SignalReader(); if (type == DataType.Audio) { signal = signalReader.ReadAudioSignalFromFile(filePath); } else { signal = signalReader.ReadSimpleSignalFromFile(filePath, type, 360.0); } fileNameLabel.Text = filePath; MessageBox.Show("Данные успешно загружены", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { signal = null; filePath = null; fileNameLabel.Text = "Файл не загружен"; MessageBox.Show(ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }