コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: MenuItemToken.cs プロジェクト: moacap/fubumvc
 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);
     }
 }