/// <summary> /// Sends the message from a child form to a main form or vice versa. /// </summary> public bool SendMessage(Form source, string message, Dictionary <string, object> arguments = null) { FormMessageEventArgs eventArgs = new FormMessageEventArgs(source, message, arguments); if (source == ChildForm) { OnChildFormMessage(eventArgs); } else { OnMainFormMessage(eventArgs); } return(!eventArgs.Cancel); }
/// <summary> /// Raises the ChildFormMessage event. /// <para>Вызвать событие ChildFormMessage.</para> /// </summary> protected void OnChildFormMessage(FormMessageEventArgs e) { ChildFormMessage?.Invoke(this, e); }
/// <summary> /// Raises a MessageToChildForm event. /// </summary> protected void OnMessageToChildForm(FormMessageEventArgs e) { MessageToChildForm?.Invoke(this, e); MainFormMessage?.Invoke(this, e); }
/// <summary> /// Raises the MainFormMessage event. /// </summary> protected void OnMainFormMessage(FormMessageEventArgs e) { MainFormMessage?.Invoke(this, e); }
/// <summary> /// Raises a MessageFromChildForm event. /// </summary> protected void OnMessageFromChildForm(FormMessageEventArgs e) { MessageFromChildForm?.Invoke(this, e); ChildFormMessage?.Invoke(this, e); }