public override bool Equals(object obj)
        {
            var header = obj as TransportChannelCloseHeader;

            return(header != null &&
                   ChannelId.Equals(header.ChannelId) &&
                   EqualityComparer <CompletionHeader> .Default.Equals(Completion, header.Completion));
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            var header = obj as TransportFrameHeader;

            return(header != null &&
                   ChannelId.Equals(header.ChannelId) &&
                   Length == header.Length &&
                   HasMore == header.HasMore);
        }
Пример #3
0
        public Task SetupAsync(IMessageHub messageHub)
        {
            MessageHub = messageHub;

            _writeValueHandler = MessageHub
                                 .Handle <WriteChannelValueMessage>()
                                 .Where(msg => ChannelId.Equals(msg.ChannelId))
                                 .Register(async msg => await WriteValueAsync(msg.Value));

            return(Task.CompletedTask);
        }
Пример #4
0
 internal void ClearTransmittingSession(ChannelId channelId)
 {
     if (_transmittingSession == null)
     {
         return;
     }
     if (_transmittingSession.Equals(channelId))
     {
         _transmittingSession = null;
     }
 }
Пример #5
0
 public bool Equals(Emit <T> other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(ChannelId.Equals(other.ChannelId) && Timestamp.Equals(other.Timestamp) && EqualityComparer <T> .Default.Equals(Payload, other.Payload));
 }
Пример #6
0
        internal void ClearTransmittingChannel(ChannelId channelId)
        {
            if (_transmittingChannel == null)
            {
                return;
            }
            if (_transmittingChannel.Equals(channelId))
            {
                _transmittingChannel = null;
            }

            _transmissionType = TransmissionMode.None;
        }
Пример #7
0
 public bool Equals(Message other)
 {
     return(Id.Equals(other.Id) && ChannelId.Equals(other.ChannelId) && GuildId.Equals(other.GuildId) &&
            Author.Equals(other.Author) && Member.Equals(other.Member) && Content == other.Content &&
            Timestamp.Equals(other.Timestamp) && Nullable.Equals(EditedTimestamp, other.EditedTimestamp) &&
            TTS == other.TTS && MentionEveryone == other.MentionEveryone && Equals(Mentions, other.Mentions) &&
            Equals(MentionRoles, other.MentionRoles) && Equals(MentionChannels, other.MentionChannels) &&
            Equals(Attachments, other.Attachments) && Equals(Embeds, other.Embeds) &&
            Equals(Reactions, other.Reactions) && Pinned == other.Pinned &&
            Nullable.Equals(WebhookId, other.WebhookId) && Type == other.Type &&
            Nullable.Equals(Activity, other.Activity) && Nullable.Equals(Application, other.Application) &&
            Nullable.Equals(MessageReference, other.MessageReference) && Flags == other.Flags);
 }
        /// <summary>
        /// Returns true if ConversationReference instances are equal
        /// </summary>
        /// <param name="other">Instance of ConversationReference to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ConversationReference other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ActivityId == other.ActivityId ||
                     ActivityId != null &&
                     ActivityId.Equals(other.ActivityId)
                     ) &&
                 (
                     User == other.User ||
                     User != null &&
                     User.Equals(other.User)
                 ) &&
                 (
                     Bot == other.Bot ||
                     Bot != null &&
                     Bot.Equals(other.Bot)
                 ) &&
                 (
                     Conversation == other.Conversation ||
                     Conversation != null &&
                     Conversation.Equals(other.Conversation)
                 ) &&
                 (
                     ChannelId == other.ChannelId ||
                     ChannelId != null &&
                     ChannelId.Equals(other.ChannelId)
                 ) &&
                 (
                     ServiceUrl == other.ServiceUrl ||
                     ServiceUrl != null &&
                     ServiceUrl.Equals(other.ServiceUrl)
                 ));
        }
Пример #9
0
 private bool EqualsInternal(PlayerLocation other)
 {
     return(ChannelId.Equals(other.ChannelId) &&
            MapId.Equals(other.MapId));
 }
Пример #10
0
 public bool Equals(IChannel other)
 => other != null && ChannelId.Equals(other.ChannelId);
Пример #11
0
        /// <summary>
        /// Returns true if Activity instances are equal
        /// </summary>
        /// <param name="other">Instance of Activity to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Activity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Timestamp == other.Timestamp ||
                     Timestamp != null &&
                     Timestamp.Equals(other.Timestamp)
                 ) &&
                 (
                     LocalTimestamp == other.LocalTimestamp ||
                     LocalTimestamp != null &&
                     LocalTimestamp.Equals(other.LocalTimestamp)
                 ) &&
                 (
                     ServiceUrl == other.ServiceUrl ||
                     ServiceUrl != null &&
                     ServiceUrl.Equals(other.ServiceUrl)
                 ) &&
                 (
                     ChannelId == other.ChannelId ||
                     ChannelId != null &&
                     ChannelId.Equals(other.ChannelId)
                 ) &&
                 (
                     From == other.From ||
                     From != null &&
                     From.Equals(other.From)
                 ) &&
                 (
                     Conversation == other.Conversation ||
                     Conversation != null &&
                     Conversation.Equals(other.Conversation)
                 ) &&
                 (
                     Recipient == other.Recipient ||
                     Recipient != null &&
                     Recipient.Equals(other.Recipient)
                 ) &&
                 (
                     TextFormat == other.TextFormat ||
                     TextFormat != null &&
                     TextFormat.Equals(other.TextFormat)
                 ) &&
                 (
                     AttachmentLayout == other.AttachmentLayout ||
                     AttachmentLayout != null &&
                     AttachmentLayout.Equals(other.AttachmentLayout)
                 ) &&
                 (
                     MembersAdded == other.MembersAdded ||
                     MembersAdded != null &&
                     MembersAdded.SequenceEqual(other.MembersAdded)
                 ) &&
                 (
                     MembersRemoved == other.MembersRemoved ||
                     MembersRemoved != null &&
                     MembersRemoved.SequenceEqual(other.MembersRemoved)
                 ) &&
                 (
                     TopicName == other.TopicName ||
                     TopicName != null &&
                     TopicName.Equals(other.TopicName)
                 ) &&
                 (
                     HistoryDisclosed == other.HistoryDisclosed ||
                     HistoryDisclosed != null &&
                     HistoryDisclosed.Equals(other.HistoryDisclosed)
                 ) &&
                 (
                     Locale == other.Locale ||
                     Locale != null &&
                     Locale.Equals(other.Locale)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Speak == other.Speak ||
                     Speak != null &&
                     Speak.Equals(other.Speak)
                 ) &&
                 (
                     InputHint == other.InputHint ||
                     InputHint != null &&
                     InputHint.Equals(other.InputHint)
                 ) &&
                 (
                     Summary == other.Summary ||
                     Summary != null &&
                     Summary.Equals(other.Summary)
                 ) &&
                 (
                     SuggestedActions == other.SuggestedActions ||
                     SuggestedActions != null &&
                     SuggestedActions.Equals(other.SuggestedActions)
                 ) &&
                 (
                     Attachments == other.Attachments ||
                     Attachments != null &&
                     Attachments.SequenceEqual(other.Attachments)
                 ) &&
                 (
                     Entities == other.Entities ||
                     Entities != null &&
                     Entities.SequenceEqual(other.Entities)
                 ) &&
                 (
                     ChannelData == other.ChannelData ||
                     ChannelData != null &&
                     ChannelData.Equals(other.ChannelData)
                 ) &&
                 (
                     Action == other.Action ||
                     Action != null &&
                     Action.Equals(other.Action)
                 ) &&
                 (
                     ReplyToId == other.ReplyToId ||
                     ReplyToId != null &&
                     ReplyToId.Equals(other.ReplyToId)
                 ) &&
                 (
                     Value == other.Value ||
                     Value != null &&
                     Value.Equals(other.Value)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     RelatesTo == other.RelatesTo ||
                     RelatesTo != null &&
                     RelatesTo.Equals(other.RelatesTo)
                 ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ));
        }
Пример #12
0
 public bool EqualByMembers(UserChannel model)
 {
     return(ChannelId.Equals(model.ChannelId, StringComparison.CurrentCultureIgnoreCase) &&
            UserId.Equals(model.UserId, StringComparison.CurrentCultureIgnoreCase));
 }