Esempio n. 1
0
 private string ComputeInputHash()
 {
     return(Axuno.Tools.Hash.Md5.GetHash(string.Join(string.Empty,
                                                     Id.ToString(),
                                                     MatchDate?.Ticks.ToString() ?? string.Empty,
                                                     MatchTime?.Ticks.ToString() ?? string.Empty,
                                                     VenueId?.ToString() ?? string.Empty)));
 }
Esempio n. 2
0
 public override void ToStream(Stream output)
 {
     output.Write(TLUtils.SignatureToBytes(Signature));
     Flags.ToStream(output);
     GeoPoint.ToStream(output);
     Title.ToStream(output);
     Address.ToStream(output);
     Provider.ToStream(output);
     VenueId.ToStream(output);
     VenueType.ToStream(output);
     ToStream(output, ReplyMarkup, Flags, (int)InputBotInlineMessageFlags.ReplyMarkup);
 }
Esempio n. 3
0
 public override byte[] ToBytes()
 {
     return(TLUtils.Combine(
                TLUtils.SignatureToBytes(Signature),
                Flags.ToBytes(),
                GeoPoint.ToBytes(),
                Title.ToBytes(),
                Address.ToBytes(),
                Provider.ToBytes(),
                VenueId.ToBytes(),
                VenueType.ToBytes(),
                ToBytes(ReplyMarkup, Flags, (int)InputBotInlineMessageFlags.ReplyMarkup)));
 }
Esempio n. 4
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                var hashCode = 41;

                // Suitable nullity checks etc, of course :)
#pragma warning disable CA1307 // Specify StringComparison

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Name != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Name.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (VenueId != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + VenueId.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (SpeakerIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + SpeakerIds.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (TalkIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + TalkIds.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (FriendIds != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + FriendIds.GetHashCode();
                }
#pragma warning restore CA1307 // Specify StringComparison
                return(hashCode);
            }
        }
Esempio n. 5
0
        /// <inheritdoc />
        /// <summary>
        /// Returns true if UpdateMeetupDraftParameters instances are equal
        /// </summary>
        /// <param name="other">Instance of UpdateMeetupDraftParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UpdateMeetupDraftParameters other)
        {
#pragma warning disable IDE0041 // Use 'is null' check
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

#pragma warning disable CA1309                  // Use ordinal stringcomparison
#pragma warning disable CA1307                  // Specify StringComparison
#pragma warning disable SA1515                  // Single-line comment must be preceded by blank line
#pragma warning disable SA1009                  // Closing parenthesis must be spaced correctly
            return
                (#pragma warning disable SA1119 // Statement must not use unnecessary parenthesis
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(Name, other.Name) ||
                     (Name != null && Name.Equals(other.Name))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(VenueId, other.VenueId) ||
                     (VenueId != null && VenueId.Equals(other.VenueId))
                 ) &&
                 (
                     SpeakerIds == other.SpeakerIds ||
                     (SpeakerIds != null && SpeakerIds.SequenceEqual(other.SpeakerIds))
                 ) &&
                 (
                     TalkIds == other.TalkIds ||
                     (TalkIds != null && TalkIds.SequenceEqual(other.TalkIds))
                 ) &&
                 (
                     FriendIds == other.FriendIds ||
                     (FriendIds != null && FriendIds.SequenceEqual(other.FriendIds))
                 ));

#pragma warning restore SA1119 // Statement must not use unnecessary parenthesis
#pragma warning restore SA1009 // Closing parenthesis must be spaced correctly
#pragma warning restore SA1515 // Single-line comment must be preceded by blank line
#pragma warning restore CA1307 // Specify StringComparison
#pragma warning restore CA1309 // Use ordinal stringcomparison
        }
Esempio n. 6
0
 public Seat(SeatId id, VenueId venueId, SeatTypeId seatTyeId)
 {
     Id      = id ?? throw new ArgumentNullException(nameof(id));
     VenueId = venueId ?? throw new ArgumentNullException(nameof(venueId));
     SeatTye = seatTyeId ?? throw new ArgumentNullException(nameof(seatTyeId));
 }