/// <summary>Opens the <see cref="InputBytesForm"/> and calls <paramref name="callback"/> with the result.</summary> /// <param name="title">The title of the input form.</param> /// <param name="callback">The function to call afterwards.</param> private void AskAddOrInsertBytes(string title, Action <int> callback) { Contract.Requires(title != null); Contract.Requires(callback != null); if (memoryViewControl.ClassNode == null) { return; } using (var ib = new InputBytesForm(memoryViewControl.ClassNode.MemorySize)) { ib.Text = title; if (ib.ShowDialog() == DialogResult.OK) { callback(ib.Bytes); } } }
/// <summary>Opens the <see cref="InputBytesForm"/> and calls <paramref name="callback"/> with the result.</summary> /// <param name="title">The title of the input form.</param> /// <param name="callback">The function to call afterwards.</param> private void AskAddOrInsertBytes(string title, Action <int> callback) { Contract.Requires(title != null); Contract.Requires(callback != null); var classNode = CurrentClassNode; if (classNode == null) { return; } using var ib = new InputBytesForm(classNode.MemorySize) { Text = title }; if (ib.ShowDialog() == DialogResult.OK) { callback(ib.Bytes); } }