public override int GetHashCode()
        {
            int hash = 1;

            if (keyCase_ == KeyOneofCase.ItemName)
            {
                hash ^= ItemName.GetHashCode();
            }
            if (keyCase_ == KeyOneofCase.AncestorName)
            {
                hash ^= AncestorName.GetHashCode();
            }
            if (consolidationStrategy_ != null)
            {
                hash ^= ConsolidationStrategy.GetHashCode();
            }
            if (PageSize != 0)
            {
                hash ^= PageSize.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (Filter.Length != 0)
            {
                hash ^= Filter.GetHashCode();
            }
            hash ^= (int)keyCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ClusterId.Length != 0)
            {
                hash ^= ClusterId.GetHashCode();
            }
            if (PageSize != 0L)
            {
                hash ^= PageSize.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (Filter.Length != 0)
            {
                hash ^= Filter.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #3
0
        /// <summary>
        /// Returns true if InputCredentialsList instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsList to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsList other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UserID == other.UserID ||
                     UserID != null &&
                     UserID.Equals(other.UserID)
                     ) &&
                 (
                     MaxResults == other.MaxResults ||
                     MaxResults != null &&
                     MaxResults.Equals(other.MaxResults)
                 ) &&
                 (
                     PageToken == other.PageToken ||
                     PageToken != null &&
                     PageToken.Equals(other.PageToken)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
Пример #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (UserID != null)
         {
             hashCode = hashCode * 59 + UserID.GetHashCode();
         }
         if (MaxResults != null)
         {
             hashCode = hashCode * 59 + MaxResults.GetHashCode();
         }
         if (PageToken != null)
         {
             hashCode = hashCode * 59 + PageToken.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Parent.Length != 0)
            {
                hash ^= Parent.GetHashCode();
            }
            if (PageSize != 0)
            {
                hash ^= PageSize.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (IncludePastReleases != false)
            {
                hash ^= IncludePastReleases.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (RegistryId.Length != 0)
            {
                hash ^= RegistryId.GetHashCode();
            }
            if (FolderId.Length != 0)
            {
                hash ^= FolderId.GetHashCode();
            }
            if (PageSize != 0L)
            {
                hash ^= PageSize.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (Filter.Length != 0)
            {
                hash ^= Filter.GetHashCode();
            }
            if (OrderBy.Length != 0)
            {
                hash ^= OrderBy.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (PageToken.TryParse((string)value, out var pt))
     {
         return(pt);
     }
     return(base.ConvertFrom(context, culture, value));
 }
 public page_token_from_dictionary()
 {
     var headers = new Dictionary<string, string>() {
        {"x-ms-continuation-NextPartitionKey", "PartitionKey"},
        {"x-ms-continuation-NextRowKey", "RowKey"}
     };
     _token = new PageToken(headers);
 }
        public paged_list()
        {
            var list = new List<string>() {
                                              {"foo"},
                                              {"bar"}
                                          };
            var nextPageToken = new PageToken("row@partition");

            _pagedList = new PagedList<string>(list, nextPageToken);
        }
Пример #10
0
 private void NavigateToPage(PageToken pageToken)
 {
     if (CanNavigateToPage(pageToken))
     {
         if (navigationService.Navigate(pageToken.ToString(), null))
         {
             UpdateCanNavigateLookup(pageToken);
             RaiseCanExecuteChanged();
         }
     }
 }
Пример #11
0
 private void UpdateCanNavigateLookup(PageToken navigatedTo)
 {
     if (navigatedTo == _currentPageToken)
     {
         return;
     }
     _canNavigateLookup[_currentPageToken] = true;
     _canNavigateLookup[navigatedTo]       = false;
     _currentPageToken = navigatedTo;
     ShowMenuButton    =
         _currentPageToken != PageToken.Login &&
         _currentPageToken != PageToken.FileDownload &&
         _currentPageToken != PageToken.FileUpload;
     IsMenuOpen = false;
 }
Пример #12
0
 private void CheckSettingsAndContinue(PageToken requestedPage, IPageParameters pageParameters)
 {
     if (
         string.IsNullOrEmpty(SettingsService.Instance.LocalSettings.ServerAddress) ||
         string.IsNullOrEmpty(SettingsService.Instance.LocalSettings.Username)
         )
     {
         NavigationService.Navigate(PageToken.Login.ToString(), null);
     }
     else
     {
         var vault = new PasswordVault();
         IReadOnlyList <PasswordCredential> credentialList = null;
         try
         {
             credentialList = vault.FindAllByResource(SettingsService.Instance.LocalSettings.ServerAddress);
         }
         catch
         {
             // ignored
         }
         var credential = credentialList?.FirstOrDefault(item => item.UserName.Equals(SettingsService.Instance.LocalSettings.Username));
         if (credential != null)
         {
             credential.RetrievePassword();
             if (!string.IsNullOrEmpty(credential.Password))
             {
                 NavigationService.Navigate(requestedPage.ToString(), pageParameters?.Serialize());
             }
             else
             {
                 NavigationService.Navigate(
                     PageToken.Login.ToString(),
                     null);
             }
         }
         else
         {
             NavigationService.Navigate(
                 PageToken.Login.ToString(),
                 null);
         }
     }
     // Ensure the current window is active
     Window.Current.Activate();
 }
Пример #13
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Parent.Length != 0)
            {
                hash ^= Parent.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (PageSize != 0)
            {
                hash ^= PageSize.GetHashCode();
            }
            return(hash);
        }
Пример #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Query.Length != 0)
            {
                hash ^= Query.GetHashCode();
            }
            if (PageToken.Length != 0)
            {
                hash ^= PageToken.GetHashCode();
            }
            if (PageSize != 0)
            {
                hash ^= PageSize.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 Task <PlatformStreamsDto> IStreamProvider.GetLiveStreams(StreamFilterOptions filterOptions, int pageSize, PageToken pageToken)
 {
     throw new NotImplementedException();
 }
        public async Task <PlatformStreamsDto> GetLiveStreams(StreamFilterOptions filterOptions, int pageSize, PageToken pageToken)
        {
            var liveVideosResult = await youTubeV3Api.SearchGamingVideos(
                filterOptions.GameName, VideoEventType.Live, VideoSortType.ViewCount, pageSize, pageToken);

            var streams = await liveVideosResult.ChainAsync(async videos =>
            {
                var videoIds   = videos.items.Select(v => v.id.videoId);
                var channelIds = videos.items.Select(v => v.snippet.channelId);

                var getVideoDetails  = youTubeV3Api.GetVideos(videoIds.ToArray());
                var getVideoChannels = youTubeV3Api.GetChannels(channelIds.ToArray());

                var videoDetailResults  = await getVideoDetails;
                var videoChannelResults = await getVideoChannels;

                return(streamMapper.Map(videos, videoDetailResults, videoChannelResults));
            });

            return(streams.GetOrElse(PlatformStreamsDto.Empty(StreamPlatformName)));
        }
 public page_token_from_string()
 {
     _tokenString = "row@partition";
     _token = new PageToken(_tokenString);
 }
Пример #18
0
 private void UpdateCanNavigateLookup(PageToken navigatedTo)
 {
     canNavigateLookup[currentPageToken] = true;
     canNavigateLookup[navigatedTo]      = false;
     currentPageToken = navigatedTo;
 }
Пример #19
0
 private bool CanNavigateToPage(PageToken pageToken)
 {
     return(canNavigateLookup[pageToken]);
 }
 public page_token_from_row_and_partition()
 {
     _token = new PageToken("row","partition");
 }
Пример #21
0
        public async Task <PlatformStreamsDto> GetLiveStreams(StreamFilterOptions filterOptions, int pageSize, PageToken pageToken)
        {
            if (!AreFilterOptionsSupported(filterOptions))
            {
                throw new ArgumentException("The Dlive platform does not support these filter options");
            }
            ;

            var liveStreamsResult = await dliveApi.GetLiveStreams(pageSize, pageToken, StreamSortOrder.Trending);

            return(streamMapper.Map(liveStreamsResult, pageSize, pageToken));
        }
 public PageToken GetTokenOrEmpty(string streamPlatformName)
 {
     return(pageTokens.SingleOrDefault(t => t.StreamPlatformName == streamPlatformName) ?? PageToken.Empty(streamPlatformName));
 }
        public async Task <PlatformStreamsDto> GetLiveStreams(StreamFilterOptions filterOptions, int pageSize, PageToken pageToken)
        {
            var liveStreamsResult = await FindLiveStreams(filterOptions, pageSize, pageToken);

            return(streamMapper.Map(liveStreamsResult, pageSize, pageToken));
        }