HandleCommand Method (commandName, itemIndex, adaptor)

Invoked to handle context command.
protected virtual bool HandleCommand(
	string commandName,
	int itemIndex,
	IReorderableListAdaptor adaptor
)

Parameters

commandName (String)
Name of command. This is the text shown in the context menu.
itemIndex (Int32)
Zero-based index of item which was right-clicked.
adaptor (IReorderableListAdaptor)
Reorderable list adaptor.

Return Value

A value of true if command was known; otherwise false.

Remarks

It is important to set the value of GUI.changed to true if any changes are made by command handler.

Default command handling functionality can be inherited:

C# UnityScript
CopyC#
protected override bool HandleCommand(string commandName, int itemIndex, IReorderableListAdaptor adaptor) {
    if (base.HandleCommand(itemIndex, adaptor))
        return true;

    // Place default command handling code here...
    switch (commandName) {
        case "Your Command":
            break;
    }

    return false;
}
CopyUnityScript
function HandleCommand(commandName:String, itemIndex:int, adaptor:IReorderableListAdaptor):boolean {
    if (base.HandleCommand(itemIndex, adaptor))
        return true;

    // Place default command handling code here...
    switch (commandName) {
        case 'Your Command':
            break;
    }

    return false;
}