public override void OnAction(Action action) { switch (action.wID) { case Action.ActionType.REMOTE_1: Rated = TraktAPI.TraktRateValue.love; UpdateRating(); break; case Action.ActionType.REMOTE_2: Rated = TraktAPI.TraktRateValue.hate; UpdateRating(); break; case Action.ActionType.ACTION_SELECT_ITEM: IsSubmitted = true; PageDestroy(); return; case Action.ActionType.ACTION_PREVIOUS_MENU: case Action.ActionType.ACTION_CLOSE_DIALOG: case Action.ActionType.ACTION_CONTEXT_MENU: IsSubmitted = false; PageDestroy(); return; } base.OnAction(action); }
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { base.OnClicked(controlId, control, actionType); if (control == btnLove) { Rated = TraktAPI.TraktRateValue.love; IsSubmitted = true; PageDestroy(); return; } else if (control == btnHate) { Rated = TraktAPI.TraktRateValue.hate; IsSubmitted = true; PageDestroy(); return; } }
public override bool OnMessage(GUIMessage message) { switch (message.Message) { case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: base.OnMessage(message); IsSubmitted = false; UpdateRating(); return true; case GUIMessage.MessageType.GUI_MSG_SETFOCUS: if (message.TargetControlId < 100 || message.TargetControlId > 101) break; Rated = (TraktAPI.TraktRateValue)(message.TargetControlId - 100); UpdateRating(); break; } return base.OnMessage(message); }