public void CommunityId_Equeal() { var idA = new CommunityId(123456); var idB = new CommunityId("co123456"); Assert.AreEqual(idA, idB); }
public async ValueTask <IPlaylist> Create(PlaylistId playlistId) { CommunityId communityId = playlistId.Id; var communityInfo = await _communityProvider.GetCommunityInfo(communityId); Guard.IsTrue(communityInfo.IsOK, nameof(communityInfo.IsOK)); return(new CommunityVideoPlaylist(communityId, playlistId, communityInfo.Community.Name, _communityProvider)); }
public void CommunityId_ToNiconicoId() { var idA = new CommunityId(123456); NiconicoId idB = new CommunityId("co123456"); Assert.AreEqual(NiconicoIdType.Community, idB.IdType); Assert.AreEqual(idA, idB); }
public override int GetHashCode() { var hashCode = 944434587; hashCode = hashCode * -1521134295 + CommunityId.GetHashCode(); hashCode = hashCode * -1521134295 + DistrictId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); return(hashCode); }
public string GetCommunityLevelFileNameSuffix() { var leafDir = InternalCommunityPath; if (!string.IsNullOrWhiteSpace(CommunityId) && !CommunityId.Equals(InternalCommunityId)) { leafDir = CommunityId; } return(GetCommunityLevelFileNameSuffix(leafDir)); }
public override int GetHashCode() { var hashCode = -699461029; hashCode = hashCode * -1521134295 + AddressId.GetHashCode(); hashCode = hashCode * -1521134295 + CommunityId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Location); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Zip); return(hashCode); }
public override byte[] GetData() { var nameAsBytes = Encoding.UTF8.GetBytes(Name); var data = new byte[16 + 16 + Address.Length + nameAsBytes.Length]; Buffer.BlockCopy(Id.ToOrderByteArray(), 0, data, 0, 16); Buffer.BlockCopy(CommunityId.ToOrderByteArray(), 0, data, 16, 16); Buffer.BlockCopy(Address, 0, data, 32, Address.Length); Buffer.BlockCopy(nameAsBytes, 0, data, 32 + Address.Length, nameAsBytes.Length); return(data); }
public async Task <(CommunityVideoResponse, CommunityVideoListItemsResponse)> GetCommunityVideoAsync( CommunityId communityId, int?offset, int?limit, CommunityVideoSortKey?sortKey, CommunityVideoSortOrder?sortOrder ) { var listRes = await _niconicoSession.ToolkitContext.Community.GetCommunityVideoListAsync(communityId, offset, limit, sortKey, sortOrder); if (!listRes.IsSuccess) { return(listRes, null); } var itemsRes = await _niconicoSession.ToolkitContext.Community.GetCommunityVideoListItemsAsync(listRes.Data.Contents.Select(x => x.ContentId)); return(listRes, itemsRes); }
protected virtual void ToString(StringBuilder sb) { sb.AppendFormat( "{0}: job title: '{1}', job title expression: '{2}', location: '{3}', salary: {4}, exclude no salary: {5}, community id: '{6}', sort order: {7}, reverse sort order: {8}, include synonyms: {9}, has resume: {10}, is activated: {11}, is contactable {12}, keywords expression: '{13}', industry ids: {14}, recency: {15}, keywords: '{16}', company keywords expression: '{17}', company keywords: '{18}', education keywords expression: {19}, education keywords: {20}, jobs to search: {21}, companies to search: {22}, include relocating: {23}, include international: {24}, ideal job types: '{25}', candidate flags: '{26}', ethnic flags: '{27}', visa status flags: '{28}', desired job title: {29}, in folder: {30}, is flagged: {31}, has notes: {32}, has viewed: {33}, is unlocked: {34}, include similiar names: {35}, name: {36}.", GetType().Name, JobTitle, JobTitleExpression == null ? null : JobTitleExpression.GetRawExpression(), Location, Salary, ExcludeNoSalary, CommunityId == null ? string.Empty : CommunityId.ToString(), SortCriteria.SortOrder, SortCriteria.ReverseSortOrder, IncludeSynonyms, HasResume, IsActivated, IsContactable, KeywordsExpression == null ? null : KeywordsExpression.GetRawExpression(), IndustryIds == null ? null : string.Join(", ", (from i in IndustryIds select i.ToString()).ToArray()), Recency, GetKeywords(), CompanyKeywordsExpression == null ? null : CompanyKeywordsExpression.GetRawExpression(), CompanyKeywords, EducationKeywordsExpression == null ? null : EducationKeywordsExpression.GetUserExpression(), EducationKeywords, JobTitlesToSearch, CompaniesToSearch, IncludeRelocating, IncludeInternational, JobTypes, CandidateStatusFlags, EthnicStatus, VisaStatusFlags, DesiredJobTitleExpression == null ? null : DesiredJobTitleExpression.GetUserExpression(), InFolder, IsFlagged, HasNotes, HasViewed, IsUnlocked, IncludeSimilarNames, Name); }
public override byte[] GetData() { var choices = new List <byte[]>(); foreach (var choice in Choices ?? Array.Empty <Choice>()) { choices.Add(choice.GetData()); } var nameAsBytes = Encoding.UTF8.GetBytes(Name); var data = new byte[16 + 16 + nameAsBytes.Length + 1 + 8 + 8 + choices.Sum(c => c.Length)]; var offset = 0; Buffer.BlockCopy(Id.ToOrderByteArray(), 0, data, offset, 16); offset += 16; Buffer.BlockCopy(CommunityId.ToOrderByteArray(), 0, data, offset, 16); offset += 16; Buffer.BlockCopy(nameAsBytes, 0, data, offset, nameAsBytes.Length); offset += nameAsBytes.Length; data[offset] = Type; offset += 1; var time = BitConverter.GetBytes(EndTime); Array.Reverse(time); Buffer.BlockCopy(time, 0, data, offset, 8); offset += 8; foreach (var choice in choices) { Buffer.BlockCopy(choice, 0, data, offset, choice.Length); offset += choice.Length; } return(data); }
protected void ToString(StringBuilder sb) { sb.AppendFormat( "{0}: ad title: '{1}', location: '{2}', community id: {3}, community only: {4}, include synonyms: {5}, recency: {6}, sort order: {7}, reverse sort order: {8}, keywords: '{9}', advertiser: '{10}', salary range: {11}, job types: {12}, distance: {13}, industry ids: {14}, is flagged: {15}, has viewed: {16}, has notes: {17}, has applied: {18}", GetType().Name, AdTitle, Location == null ? null : (Location.IsCountry ? Location.Country.Name : Location.ToString()), CommunityId.HasValue ? CommunityId.ToString() : String.Empty, CommunityOnly.HasValue ? CommunityOnly.Value.ToString() : String.Empty, IncludeSynonyms, Recency, SortCriteria.SortOrder, SortCriteria.ReverseSortOrder, GetKeywords(), AdvertiserNameExpression == null ? "" : AdvertiserNameExpression.GetUserExpression(), Salary == null ? "(none)" : Salary.ToString(), JobTypes, Distance, IndustryIds == null ? null : string.Join(", ", (from i in IndustryIds select i.ToString()).ToArray()), IsFlagged, HasViewed, HasNotes, HasApplied); }
public Task <CommunityAuthorityResponse> GetCommunityAuthorityAsync(CommunityId id) { return(_niconicoSession.ToolkitContext.Community.GetCommunityAuthorityForLoginUserAsync(id)); }
public async Task <bool> IsFollowingAsync(CommunityId id) { var res = await _niconicoSession.ToolkitContext.Community.GetCommunityAuthorityForLoginUserAsync(id); return(res.Data?.IsMember ?? false); }
get => GetId(CommunityId, UserId);
public Task <CommunityInfoResponse> GetCommunityInfo(CommunityId communityId) { return(_niconicoSession.ToolkitContext.Community.GetCommunityInfoAsync(communityId)); }