bool SetupToggleAction() { List <ITerminalAction> actions = new List <ITerminalAction>(); if (MyAPIGateway.TerminalActionsHelper == null) { return(false); } MyAPIGateway.TerminalActionsHelper.GetActions(myDoor.GetType(), actions, null); string actionName = null; foreach (ITerminalAction item in actions) { actionName = item.Id; if (_DoorToggleActionId.Equals(actionName, StringComparison.InvariantCultureIgnoreCase)) { toggleAction = item; break; } } if (toggleAction == null) { LogMessage("Couldn't find toggle action", true); } return(toggleAction != null); }