private static MenuItemState determineAvailability(T target, Endpoint endpoint, IContextualAction <T> definition) { var authorized = endpoint.IsAuthorized ? MenuItemState.Available : definition.UnauthorizedState; var available = definition.IsAvailable(target); return(MenuItemState.Least(authorized, available)); }
public override int GetHashCode() { unchecked { int result = (Key != null ? Key.GetHashCode() : 0); result = (result * 397) ^ (Text != null ? Text.GetHashCode() : 0); result = (result * 397) ^ (Url != null ? Url.GetHashCode() : 0); result = (result * 397) ^ (MenuItemState != null ? MenuItemState.GetHashCode() : 0); return(result); } }