コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: WinControl.cs プロジェクト: 2mik/wincontrol
 /// <summary>
 /// Raises the ChildFormMessage event.
 /// <para>Вызвать событие ChildFormMessage.</para>
 /// </summary>
 protected void OnChildFormMessage(FormMessageEventArgs e)
 {
     ChildFormMessage?.Invoke(this, e);
 }
コード例 #3
0
 /// <summary>
 /// Raises a MessageToChildForm event.
 /// </summary>
 protected void OnMessageToChildForm(FormMessageEventArgs e)
 {
     MessageToChildForm?.Invoke(this, e);
     MainFormMessage?.Invoke(this, e);
 }
コード例 #4
0
 /// <summary>
 /// Raises the MainFormMessage event.
 /// </summary>
 protected void OnMainFormMessage(FormMessageEventArgs e)
 {
     MainFormMessage?.Invoke(this, e);
 }
コード例 #5
0
 /// <summary>
 /// Raises a MessageFromChildForm event.
 /// </summary>
 protected void OnMessageFromChildForm(FormMessageEventArgs e)
 {
     MessageFromChildForm?.Invoke(this, e);
     ChildFormMessage?.Invoke(this, e);
 }