// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.SignalR.Infrastructure; namespace Microsoft.AspNet.SignalR { /// /// A message sent to one more connections. /// [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "Messags are never compared, just used as data.")] public struct ConnectionMessage { /// /// The signal to this message should be sent to. Connections subscribed to this signal /// will receive the message payload. /// public string Signal { get; private set; } /// /// The payload of the message. /// public object Value { get; private set; } /// /// Represents a list of signals that should be used to filter what connections /// receive this message. /// public IList ExcludedSignals { get; private set; } public ConnectionMessage(string signal, object value) : this(signal, value, ListHelper.Empty) { } /// /// Initializes a new instance of the class. /// /// The signal /// The payload of the message /// The signals to exclude. public ConnectionMessage(string signal, object value, IList excludedSignals) : this() { Signal = signal; Value = value; ExcludedSignals = excludedSignals; } } }