private void videoButton_CheckedChanged(object sender, EventArgs e) { if (element is MediaElement media) { if (Util.TrySet(ref media.type, MediaElement.Type.Video)) { ElementUpdate?.Invoke(this, new EventArgs()); } } }
private void numericField_ValueChanged(object sender, EventArgs e) { if (element is TextElement text) { if (Util.TrySet(ref text.verse, (int)numericField.Value)) { ElementUpdate?.Invoke(this, new EventArgs()); } } }
private void textField_TextChanged(object sender, EventArgs e) { bool updated = false; if (element is MediaElement media) { updated = Util.TrySet(ref media.url, textField.Text); } else if (element is TitleElement title) { updated = Util.TrySet(ref title.text, textField.Text); } else if (element is TextElement text) { updated = Util.TrySet(ref text.text, textField.Text); } if (updated) { ElementUpdate?.Invoke(this, new EventArgs()); } }