private int GetTypeNumber(int i) { ActionList _target = (ActionList)target; int number = 0; if (actionsManager) { for (int j = 0; j < actionsManager.GetActionsSize(); j++) { try { if (_target.actions[i].GetType().ToString() == actionsManager.GetActionName(j)) { number = j; break; } } catch { string defaultAction = actionsManager.GetDefaultAction(); _target.actions[i] = (Action)CreateInstance(defaultAction); } } } return(number); }