private void textBox1_TextChanged(object sender, EventArgs e) { if (IsButtonPressed) { ClearRedoes?.Invoke(this, EventArgs.Empty); TextUpdate?.Invoke(this, EventArgs.Empty); toolStripButton1.Enabled = true; toolStripButton2.Enabled = false; } }
/// <inheritdoc /> public void SendTextUpdate(string newText) { Text = newText; //Possible user methods try { TextUpdate?.Invoke(newText); } catch (Exception e) { Urho.IO.Log.Write(Urho.LogLevel.Warning, $"There was an unexpected exception during the invocation of {nameof(TextUpdate)}: {e.Message}"); } parent?.SendTextUpdate(newText); }
/// <summary> /// Raises the TextUpdate event. /// </summary> /// <param name="e">An EventArgs containing the event data.</param> protected virtual void OnTextUpdate(EventArgs e) { TextUpdate?.Invoke(this, e); }