public class CustomCommand : CommandPublic Class CustomCommand
Inherits Commandtype CustomCommand =
class
inherit Command
endusing System;
using System.Collections.Generic;
using System.Text;
using Firefly.Box;
using Firefly.Box.Testing;
namespace TestFirefly.Box.Documentation
{
public class DifferenceBetweenRaiseAndInvoke
{
public void DemoRaiseAndInvoke()
{
var uic = new UIController
{
View = new Firefly.Box.UI.Form()
};
var myCommand = new CustomCommand();
var h = uic.Handlers.Add(myCommand);
h.Invokes += e =>
{
e.Handled = false;
System.Windows.Forms.MessageBox.Show("First Handler");
};
var h2 = uic.Handlers.Add(myCommand);
h2.Invokes += e =>
{
e.Handled = false;
System.Windows.Forms.MessageBox.Show("Second Handler");
};
var invokeButton = new Firefly.Box.UI.Button
{
Text = "Invoke"
};
invokeButton.Click += (a, b) =>
{
System.Windows.Forms.MessageBox.Show("Before Invoke");
uic.Invoke(myCommand);
System.Windows.Forms.MessageBox.Show("After Invoke");
};
uic.View.Controls.Add(invokeButton);
var raiseButton = new Firefly.Box.UI.Button
{
Text = "Raise",
Top = invokeButton.Bottom + 5
};
raiseButton.Click += (a, b) =>
{
System.Windows.Forms.MessageBox.Show("Before Raise");
uic.Raise(myCommand);
System.Windows.Forms.MessageBox.Show("After Raise");
};
uic.View.Controls.Add(raiseButton);
uic.Run();
}
}
}| CustomCommand | Initializes a new instance of the CustomCommand class. |
| CustomCommand(Boolean) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(Command) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(String) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(Command, Boolean) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(String, Command) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(String, Boolean) | Initializes a new instance of the CustomCommand class. |
| CustomCommand(String, Command, Boolean) | Initializes a new instance of the CustomCommand class. |
| AdditionalShortcuts |
Gets or sets an array of additional shortcut keys for this command.
(Inherited from Command) |
| AllowInvokeByKey | |
| CancelTrigger | |
| Enabled |
Gets a value indicating whether the Command is Enabled.
(Inherited from Command) |
| IgnoreIfUnhandledWithinBusinessProcess | (Overrides CommandIgnoreIfUnhandledWithinBusinessProcess) |
| Key | |
| Name |
The Command Name
(Inherited from Command) |
| Precondition | |
| Shortcut |
Gets or sets a value indicating the shortcut key for this command.
(Inherited from Command) |
| AllowParentViewAccordingToHandlerContext | (Inherited from Command) |
| BindMenuItem(ToolStripButton) | Used to bind between the Command and a menuItem. (Inherited from Command) |
| BindMenuItem(ToolStripMenuItem) | Used to bind between the Command and a menuItem. (Inherited from Command) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetDefaultBehavior | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Command) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| RefreshBoundMenus | (Inherited from Command) |
| SendObjectColumnEventName | (Inherited from Command) |
| ToString | Returns a string that represents the current object. (Inherited from Command) |
| UnbindMenuItem | (Inherited from Command) |
| UnhandledWithinBusinessProcess | (Inherited from Command) |
| EnabledChanged |
Occurs when the Enabled property has changed.
(Inherited from Command) |