Beispiel #1
0
 /// <summary>
 /// Update the mesh with new data
 /// </summary>
 /// <param name="synchronizationUpdateMessage">the update message that sent from the peer , this message is base class that usually inherit from SynchronizationUpdateMessage<T/> that contain state property</param>
 void ISynchronizedState.SynchronizationUpdate(SynchronizationUpdateMessage synchronizationUpdateMessage)
 {
     if (synchronizationUpdateMessage.IsOwnMessage)
     {
         return;
     }
     try
     {
         businessLogic.OnUpdateReceived(synchronizationUpdateMessage.State);
     }
     catch (Exception exception)
     {
         HelperMethods.HandleBusinessLogicException(exception);
     }
 }
        public void Update <TState>(TState state, int hops = FloodMessageBase.MaxHopCount) where TState : BusinessLogicMessageBase
        {
            var updateMessage = new SynchronizationUpdateMessage
            {
                HopCount = hops,
                State    = state
            };

            try
            {
                synchronizedStateProxy.SynchronizationUpdate(updateMessage);
            }
            catch (Exception exception)
            {
                LogManager.GetCurrentClassLogger().Fatal(exception);
            }
        }
 /// <summary>
 /// Update the mesh with new data
 /// </summary>
 /// <param name="synchronizationUpdateMessage">the update message that sent from the peer to the mesh</param>
 void ISynchronizedState.SynchronizationUpdate(SynchronizationUpdateMessage synchronizationUpdateMessage)
 {
     Contract.Requires <ArgumentNullException>(synchronizationUpdateMessage != null);
 }