ReorderableListControl.HandleCommand Method

Rotorz ReorderableList

ReorderableListControlHandleCommand Method
Invoked to handle context command.

Namespace: Rotorz.ReorderableList
Assembly: Editor.ReorderableList (in Editor.ReorderableList.dll) Version: 0.0.0.0 (0.3.0.0)
Syntax
protected virtual bool HandleCommand(
	string commandName,
	int itemIndex,
	IReorderableListAdaptor adaptor
)
protected virtual function HandleCommand(
	commandName : String,
	itemIndex : int,
	adaptor : IReorderableListAdaptor
) : boolean

Parameters

commandName
Type: SystemString
Name of command. This is the text shown in the context menu.
itemIndex
Type: SystemInt32
Zero-based index of item which was right-clicked.
adaptor
Type: Rotorz.ReorderableListIReorderableListAdaptor
Reorderable list adaptor.

Return Value

Type: Boolean
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:

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

    // Place custom command handling code here...
    switch (commandName) {
        case "Your Command":
            return true;
    }

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

    // Place custom command handling code here...
    switch (commandName) {
        case 'Your Command':
            return true;
    }

    return false;
}
See Also