public bool Equals(FlowPostTransient other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(other.Id == Id && Equals(other.Urn, Urn) && other.UserId.Equals(UserId) && other.DateAdded.RoundToMs().Equals(DateAdded.RoundToMs()) && other.DateModified.RoundToMs().Equals(DateModified.RoundToMs()) && other.TargetUserId.Equals(TargetUserId) && other.ForwardedPostId.Equals(ForwardedPostId) && other.OriginUserId.Equals(OriginUserId) && Equals(other.OriginUserName, OriginUserName) && other.SourceUserId.Equals(SourceUserId) && Equals(other.SourceUserName, SourceUserName) && Equals(other.SubjectUrn, SubjectUrn) && Equals(other.ContentUrn, ContentUrn) && TrackUrns.EquivalentTo(other.TrackUrns) && Equals(other.Caption, Caption) && other.CaptionUserId.Equals(CaptionUserId) && Equals(other.CaptionSourceName, CaptionSourceName) && Equals(other.ForwardedPostUrn, ForwardedPostUrn) && Equals(other.PostType, PostType) && other.OnBehalfOfUserId.Equals(OnBehalfOfUserId)); }
public override int GetHashCode() { unchecked { int result = Id.GetHashCode(); result = (result * 397) ^ (Urn != null ? Urn.GetHashCode() : 0); result = (result * 397) ^ UserId.GetHashCode(); result = (result * 397) ^ DateAdded.GetHashCode(); result = (result * 397) ^ DateModified.GetHashCode(); result = (result * 397) ^ (TargetUserId.HasValue ? TargetUserId.Value.GetHashCode() : 0); result = (result * 397) ^ (ForwardedPostId.HasValue ? ForwardedPostId.Value.GetHashCode() : 0); result = (result * 397) ^ OriginUserId.GetHashCode(); result = (result * 397) ^ (OriginUserName != null ? OriginUserName.GetHashCode() : 0); result = (result * 397) ^ SourceUserId.GetHashCode(); result = (result * 397) ^ (SourceUserName != null ? SourceUserName.GetHashCode() : 0); result = (result * 397) ^ (SubjectUrn != null ? SubjectUrn.GetHashCode() : 0); result = (result * 397) ^ (ContentUrn != null ? ContentUrn.GetHashCode() : 0); result = (result * 397) ^ (TrackUrns != null ? TrackUrns.GetHashCode() : 0); result = (result * 397) ^ (Caption != null ? Caption.GetHashCode() : 0); result = (result * 397) ^ CaptionUserId.GetHashCode(); result = (result * 397) ^ (CaptionSourceName != null ? CaptionSourceName.GetHashCode() : 0); result = (result * 397) ^ (ForwardedPostUrn != null ? ForwardedPostUrn.GetHashCode() : 0); result = (result * 397) ^ PostType.GetHashCode(); result = (result * 397) ^ (OnBehalfOfUserId.HasValue ? OnBehalfOfUserId.Value.GetHashCode() : 0); return(result); } }
public override int GetHashCode() { unchecked { var hashCode = TrackId; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Artist != null ? Artist.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AlbumArtist != null ? AlbumArtist.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Composer != null ? Composer.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Album != null ? Album.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Genre != null ? Genre.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Kind != null ? Kind.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Size.GetHashCode(); hashCode = (hashCode * 397) ^ (PlayingTime != null ? PlayingTime.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TrackNumber.GetHashCode(); hashCode = (hashCode * 397) ^ Year.GetHashCode(); hashCode = (hashCode * 397) ^ DateModified.GetHashCode(); hashCode = (hashCode * 397) ^ DateAdded.GetHashCode(); hashCode = (hashCode * 397) ^ BitRate.GetHashCode(); hashCode = (hashCode * 397) ^ SampleRate.GetHashCode(); hashCode = (hashCode * 397) ^ PlayCount.GetHashCode(); hashCode = (hashCode * 397) ^ PlayDate.GetHashCode(); hashCode = (hashCode * 397) ^ PartOfCompilation.GetHashCode(); return(hashCode); } }
public virtual int CompareTo(object o) { // CategorizedItems are sorted by date if (o is CategorizedItem) { return(DateAdded.CompareTo(((CategorizedItem)o).DateAdded)); } return(0); }
public bool IsDownloadable() { if (DateAdded.HasValue && DateAdded.HasElapsed(TimeSpan.FromDays(3))) { return(false); } return(ContentType == FileContentTypes.Video || ContentType == FileContentTypes.Image || ContentType == FileContentTypes.Html); }
protected bool Equals(Track other) { return(TrackId == other.TrackId && string.Equals(Name, other.Name) && string.Equals(Artist, other.Artist) && string.Equals(AlbumArtist, other.AlbumArtist) && string.Equals(Composer, other.Composer) && string.Equals(Album, other.Album) && string.Equals(Genre, other.Genre) && string.Equals(Kind, other.Kind) && Size == other.Size && string.Equals(PlayingTime, other.PlayingTime) && TrackNumber == other.TrackNumber && Year == other.Year && DateModified.Equals(other.DateModified) && DateAdded.Equals(other.DateAdded) && BitRate == other.BitRate && SampleRate == other.SampleRate && PlayCount == other.PlayCount && PlayDate.Equals(other.PlayDate) && PartOfCompilation == other.PartOfCompilation); }
public int CompareTo(Bookmark other) { if (ReferenceEquals(this, other)) { return(0); } int val = DateAdded.CompareTo(other.DateAdded); val = val == 0 ? DateLastVisited.CompareTo(other.DateLastVisited) : val; return(val == 0 ? FfnAddress.CompareTo(other.FfnAddress) : val); }
public User(string name, string password, string email, string description) { Name = name; Description = description; Email = email; DateAdded = DateTime.Now; ImageUri = string.Empty; VerificationByTime = DateAdded.AddMinutes(15); Random rand = new Random((int)DateAdded.Ticks); VerificationCode = rand.Next(100000, 999999); Verified = false; byte[] salt = null; PasswordHash = SimpleHash.ComputeHash(password, HashAlgorithm, ref salt); }
/// <summary> /// Returns a string field /// </summary> /// <param name="name">Name of field</param> /// <returns></returns> public string this[string name] { get { switch (name.ToLower()) { case "title": return(Title); case "artist": return(Artist); case "album": return(Album); case "genre": return(Genre); case "rating": return(RatingString); case "length": return(LengthString); case "play count": return(PlayCount.ToString()); case "date added": return(DateAdded.ToShortTimeString()); case "last played": return(LastPlayed.ToShortDateString()); case "track number": return(TrackNumber.ToString()); case "disc number": return(DiscNumber.ToString()); default: return(null); } } }
public bool Equals(Track other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(TrackId == other.TrackId && string.Equals(Name, other.Name) && string.Equals(Artist, other.Artist) && string.Equals(AlbumArtist, other.AlbumArtist) && string.Equals(Composer, other.Composer) && string.Equals(Album, other.Album) && string.Equals(Genre, other.Genre) && string.Equals(Kind, other.Kind) && Size == other.Size && string.Equals(PlayingTime, other.PlayingTime) && TrackNumber == other.TrackNumber && Year == other.Year && DateModified.Equals(other.DateModified) && DateAdded.Equals(other.DateAdded) && BitRate == other.BitRate && SampleRate == other.SampleRate && PlayCount == other.PlayCount && PlayDate.Equals(other.PlayDate) && PartOfCompilation == other.PartOfCompilation && Location == other.Location); }
public override string ToString() { return("Added by: '" + Username + "', " + "On Date: '" + DateAdded.ToString("r")); }
public override string ToString() { return($"StockItem: StockItemId = {StockItemId}, StockItemGroupId = {StockItemGroupId}, ItemId = {ItemId}, Name = '{Name}', " + $"ShortName = '{ShortName}', DateAdded = {DateAdded.ToString(ArtsApi.DATE_FORMAT)}, IsTracked = {IsTracked}"); }
public string GetDate() { string[] splitedDate = DateAdded.Replace('.', ' ').Split(' '); return(splitedDate[0] + " " + Enum.GetName(typeof(Months), int.Parse(splitedDate[1])).ToString() + " " + splitedDate[2]); }