/// <summary>
 ///     Create a new RemotePropertyChangedMessage.
 /// </summary>
 /// <param name="action">Action that was executed on the remote collection.</param>
 /// <param name="sourceElement">Collection the change occurred on.</param>
 /// <param name="elements">Remote objects that are affected by the change.</param>
 /// <param name="sourceElementPropertyName">
 ///     Property name identifying the collection on the source element. If null then
 ///     sourceElement is the list itself.
 /// </param>
 public RemoteCollectionChangedMessage(NotifyCollectionChangedAction action, IObjectRemoteValue sourceElement, IObjectRemoteValue[] elements,
                                       string sourceElementPropertyName = null) : base(sourceElement)
 {
     Action   = action;
     Elements = elements;
     SourceElementPropertyName = sourceElementPropertyName;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new RemotePropertyChangedMessage.
 /// </summary>
 /// <param name="value">New value of the changed property.</param>
 /// <param name="oldValue">Old value of the changed property.</param>
 /// <param name="elementAffected">Oject affected by the property change.</param>
 /// <param name="propertyName">Name of the changed property.</param>
 public RemotePropertyChangedMessage(IObjectRemoteValue value, IObjectRemoteValue oldValue, IObjectRemoteValue elementAffected, string propertyName)
     : base(elementAffected)
 {
     Value        = value;
     OldValue     = oldValue;
     PropertyName = propertyName;
 }
        private StreamMessageSender <T> GetSenderForValue(IObjectRemoteValue <T> remoteValue)
        {
            StreamMessageSender <T> sender;

            if (ObjectToSenderMapping.TryGetValue(remoteValue.ReferenceComparable, out sender))
            {
                return(sender);
            }

            sender = Senders[_currentSenderIndex];
            ObjectToSenderMapping.Add(remoteValue.ReferenceComparable, sender);

            _currentSenderIndex = (_currentSenderIndex + 1) % Senders.Count;

            return(sender);
        }
        /// <summary>
        /// Send message containing added remote value.
        /// </summary>
        /// <param name="remoteValue">Added remote value.</param>
        public void EnqueueAddRemoteItem(IObjectRemoteValue <T> remoteValue)
        {
            var sender = GetSenderForValue(remoteValue);

            sender.EnqueueMessage(new RemoteItemAddMessage <T>(remoteValue.SingleValueToList()));
        }
 protected RemoteObjectStreamMessageBase(IObjectRemoteValue elementAffected)
 {
     ElementAffected = elementAffected;
 }